Previous Up Next

6.36.2  Series expansion: taylor series

The taylor command finds Taylor expansions.
series is a synonym for taylor.

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).


Example.
Input:

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

or:

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

or (be careful with the order of the arguments!):

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

or:

series(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 consider

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

Input:

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

Output:

6−
27
10
 x2+x3+
711
1400
 x4+x6 order_size
x
6+-27/10*x^2+x^3*order_size(x)

which is only a 2nd degree expansion. Indeed the numerator and denominator valuation is 3, hence you lose 3 orders. To get order 4, you should use n=7.
Input:

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

Output:

6−
27
10
 x2+x3+
711
1400
 x4
737
14000
 x6+x8 order_size
x
6+-27/10*x^2+x^3+711/1400*x^4+x^5*order_size(x)

a fourth degree expansion.


Examples.


Previous Up Next