Taylor Series with Maple

Example 1: Find the first ten terms of the Taylor series for e^x centered at 0.

> taylor(exp(x),x=0,10);

series(1+x+1/2*x^2+1/6*x^3+1/24*x^4+1/120*x^5+1/720*x^6+1/5040*x^7+1/40320*x^8+1/362880*x^9+O(x^10),x,10)

The O(x^10) means there are higher order terms of degree 10 or higher.

Example 2: Find the first 4 nonezero terms of the Taylor series of f(x)=e^(-x^2)*sin(x) centered at 0. Plot f(x) along with a few of its Taylor polynomials.

> taylor(exp(-x^2)*sin(x),x=0,8);

series(x-7/6*x^3+27/40*x^5-1303/5040*x^7+O(x^8),x,8)

> plot([exp(-x^2)*sin(x),x,x-(7/6)*x^3],x=-2*Pi..2*Pi,color=[black,blue,red],thickness=2,view=[-5..5,-2..2]);

[Plot]

> plot([exp(-x^2)*sin(x),x-7/6*x^3+27/40*x^5,x-7/6*x^3+27/40*x^5-1303/5040*x^7],x=-5..5,color=[black,green,brown],thickness=2,view=[-5..5,-2..2]);

[Plot]

Example 3: Find the first 10 terms of the Taylor series of tan(ln(x)) centered at 1.

> taylor(tan(ln(x)),x=1,10);

series((x-1)-1/2*(x-1)^2+2/3*(x-1)^3-3/4*(x-1)^4+11/12*(x-1)^5-9/8*(x-1)^6+88/63*(x-1)^7-251/144*(x-1)^8+19805/9072*(x-1)^9+O((x-1)^10),x = 1,10)

>