Previous Up Next

2.33.2  Taylor expansion : taylor

taylor takes from one to four arguments :

Note that the syntax ...,x,n,a,... (instead of ...,x=a,n,...) is also accepted.
taylor returns a polynomial in x-a, plus a remainder of the form:
(x-a)^n*order_size(x-a)
where order_size is a function such that,

∀ r>0,    
 
lim
x→ 0
 xr order_size(x) = 0 

For regular series expansion, order_size is a bounded function, but for non regular series expansion, it might tend slowly to infinity, for example like a power of ln(x).
Input :

taylor(sin(x),x=1,2)

Or (be carefull with the order of the arguments !) :

taylor(sin(x),x,2,1)

Output :

sin(1)+cos(1)*(x-1)+(-(1/2*sin(1)))*(x-1)^2+ (x-1)^3*order_size(x-1)

Remark
The order returned by taylor may be smaller than n if cancellations between numerator and denominator occur, for example

taylor(
x3+sin(x)3
x−sin(x)

Input :

taylor(x^3+sin(x)^3/(x-sin(x)))

The output is only a 2nd-order series expansion :

6+-27/10*x^2+x^3*order_size(x)

Indeed the numerator and denominator valuation is 3, hence we loose 3 orders. To get order 4, we should ask n=7, input :

taylor(x^3+sin(x)^3/(x-sin(x)),x=0,7)

Output is a 4th-order series expansion :

6+-27/10*x^2+x^3+711/1400*x^4+x^5*order_size(x)

Previous Up Next