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); |
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); |
| > | 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]](images/taylorseries_3.gif)
| > | 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]](images/taylorseries_4.gif)
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); |
| > |