Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version


sage: S=cos(x).taylor(x,0,10).power_series(QQ).pade(2,4);S
(-244/3*x^2 + 200)/(x^4 + 56/3*x^2 + 200)
sage: M=mathematica.PadeApproximant(cos(x),[x,0,[2,4]]).sage();M
-4*(61*x^2 - 150)/(3*x^4 + 56*x^2 + 600)
sage: bool(M==S)

By the way, the Padé approximation is slightly less precise than the Taylor development of the equivalent degree:

sage: S(x=pi).n()
sage: cos(x).taylor(x,0,6)(x=pi).n()

And FredericC's solution is equivalent:

sage: t=QQ[['t']].0
sage: T=t.cos().pade(2,4);T
(-244/3*t^2 + 200)/(t^4 + 56/3*t^2 + 200)
sage: bool(T(x)==S)

Your Sage version (which is antique, by Sage standards...) gives you bullshit.