Okay, that seems to work (I don't have time to actually verify the
result right now, I can only see that it is giving a /R/ result :)
Thank you.
P.S. Strange bug.
Stavros Macrakis wrote:
>>I need to use the REVERT function but I can't get it working:
>
>
> This is a bug in the Revert package. Fortunately, it is a trivial
> bug, and can easily be fixed by putting the whole revert.mac file in
> lower case. See demo below, and lowercased source file after that.
>
> -s
>
> ---------------
>
> (%i1) load(revert);
> (%o1)
> C:/PROGRA~1/MAXIMA~1.9BE/share/maxima/5.9.0.9beta2/share/calculus/revert.mac
> (%i2) taylor(x/cos(x),x,0,5);
> 3 5
> x 5 x
> (%o2)/T/ x + -- + ---- + . . .
> 2 24
> (%i3) revert(%o2,x);
> 5 3
> 13 x - 12 x + 24 x
> (%o3)/R/ --------------------
> 24
> (%i4) taylor(%o3,x,0,5);
> 3 5
> x 13 x
> (%o4)/T/ x - -- + ----- + . . .
> 2 24
> (%i5) subst(%o4,x,%o2);
> (%o6)/T/ x + . . .
>
> --------------------------
>
> Here is revert.mac in lowercase.
>
> declare([v,w],special);
>
> revert(exp, t) := block([f, n, v, w, r1], n : hipow(exp, t),
> array([v,w], n), r1:1/ratcoeff(exp,t,1), v[1]:1,
> for k:2 thru n do (v[k]:ratcoef(exp, t, k)*r1 ,w[k]: - v[k] ), w[1]
> : 1,
> f : lambda([j], for i from j + 1 thru n do w[i]:w[i]-w[j]*v[i-j+1]),
> for j from 2 thru n - 1 do apply(f,[j]), for k from 2 thru n - 1
> do (for j from k thru n - 1 do apply(f,[j])), f : 0,
> for k thru n do f:f+w[k]*(t*r1)^k, f)$
>
> revert2(exp, var, n) := block([f, v, w, r1,n], n:hipow(exp,var),
> if n = 0 then return(exp), array([v,w], n),
> v[0] : ratcoef(exp, var, 0), r1:1/ratcoef(exp,var,1),
> v[1]:1,
> for k:2 thru n do (v[k]: ratcoef(exp, var, k)*r1, w[k]: - v[k] ),
> w[1]: 1,
> f : lambda([j], for i from j + 1 thru n do w[i] : w[i] -
> w[j]*v[i-j+1] ),
> for j from 2 thru n - 1 do apply(f,[j]), for k from 2 thru n - 1
> do (for j from k thru n - 1 do apply(f,[j])), f : 0,
> r1 : ratdisrep(r1), for k thru n
> do f:ratdisrep(w[k])*(ratdisrep(var-v[0])*r1)^k+f, f)$
>
>
>
>
>
> __________________________________
> Do you Yahoo!?
> Take Yahoo! Mail with you! Get it on your mobile phone.
> http://mobile.yahoo.com/maildemo
>
>
--
edA-qa mort-ora-y
Idea Architect
http://disemia.com/