1 /* find the taylor series of a function of x which is defined implicitly
2 by a polynomial equation in x and y, if there is a unique branch at a particular
4 implicit_taylor(f,pt,deg,init_a0) where F is the implicit defining equation,
5 pt is the value of x around which we wish to form the expansion, deg is the
6 highest degree of x to appear in the expansion, and init_a0 is the initial value
7 of y at point, for the branch for which we will form the expansion.
9 (C2) implicit_taylor(y^3+x*y^2+x*y+y-2,0,10,1);
11 83787 X 2847 X 5853 X 189 X 21 X 23 X 15 X X
12 (D2) - --------- + ------- + ------- - ------ - ----- + ----- - ----- - --
13 134217728 8388608 4194304 65536 32768 2048 1024 32
22 implicit_taylor(f,pt,deg,init_a0):=
23 block([n:deg,ratwtlvl:deg,ratweights:[],expansion,res,ans:[],eqns],
25 expansion:sum((x-pt)^i*concat(a,i),i,0,n),
26 res:sublis([y=expansion],f),
28 eqns:create_list(coeff(res,x,i),i,1,n),
30 eqns:sublis(ans,eqns),
31 for i:1 thru n do (ans:append(ans,solve(eqns[i],concat(a,i))),
32 eqns: sublis(ans,eqns)),
33 sublis(ans,expansion));