# Revision history [back]

Let f be your function, here a symbolic expression:

sage: f = arctan(x)
sage: f.parent()
Symbolic Ring


If you search for "pade sagemath" you will get this page http://doc.sagemath.org/html/en/reference/power_series/sage/rings/power_series_poly.html so you have first to transform the symbolic expression arctan(x) into a power series. As you can see, the symbolic expression has a method named power_series, so let us try it:

sage: f.power_series(QQ)
TypeError: unable to convert arctan(x) to a rational


The problem is that, currently, Sage is not able to transform such a symbolic expression into a power series, only the expressions that are polynomials, see the doc of the method by typing f.power_series

So, you have first to approximate f to a truncated power series, also known as Taylor expansion:

sage: f.taylor(x,0,12)
-1/11*x^11 + 1/9*x^9 - 1/7*x^7 + 1/5*x^5 - 1/3*x^3 + x


Then you can get it as a power series over the rationals:

sage: f.taylor(x,0,12).power_series(QQ)
x - 1/3*x^3 + 1/5*x^5 - 1/7*x^7 + 1/9*x^9 - 1/11*x^11 + O(x^12)


sage: f.taylor(x,0,12).power_series(QQ).pade(3,3)

sage: f.taylor(x,0,12).power_series(QQ).pade(10,10)