Power Series Approximation

This Mathematica worksheet explores the use of power series to approximate functions.
How many terms of the power series do you need to get a good approximation for the function f(θ)= Sin(θ)?

First, we define and plot f(θ).

SetOptions[Plot,PlotStyle->Thickness[0.01]];
f=Sin[θ]
Plot[f,{θ,-Pi,Pi}, AxesLabel-> {θ}]

Now, fill in the missing information in the prompts below and press shift enter.

First order (n=1) term:
Why didn't we use the zeroth order term?

c[1]:=
g:=c[1]*θ

The function g(θ) is the approximation to f(θ).  The purple line is the approximation and the blue line is the function f(θ). 
For what values of θ is g(θ) a good approximation for f(θ)=Sin(θ)?

Plot[{f,g},{θ,-Pi,Pi}, AxesLabel-> {θ}]

Third order (n=3) term:
For what values of θ is g(θ) a good approximation for f(θ)=Sin(θ)?

c[3]:=
g:=c[1]*θ+c[3]*θ^3
Plot[{f,g},{θ,0,Pi}, AxesLabel-> {θ}]

Fifth order(n=5) term:
For what values of θ is g(θ) a good approximation for f(θ)=Sin(θ)?

c[5]:=
g:=c[1]*θ+c[3]*θ^3+c[5]*θ^5
Plot[{f,g},{θ,-Pi,Pi} ,AxesLabel-> {θ}]

Fifth order(n=5) term:
For what values of θ is g(θ) a good approximation for f(θ)=Sin(θ)?

c[7]:=
g:=c[1]*θ+c[3]*θ^3+c[5]*θ^5+c[7]*θ^7
Plot[{f,g},{θ,-Pi,Pi} ,AxesLabel-> {θ}]

Range of approximation
Can you determine how many terms of the power series, g(θ), are needed to yield an accurate approximation of Sin(θ) for θ values between -π and π? How good is your approximation outside this range?

Series expansions around a point other than zero
Now compare the series expansion h(θ) around the point θ=(π/6) to the function f(θ)=Sin(θ) for several different orders in the expansion parameter.

d[0]=
h:=d[0]
Plot[{f,h},{θ,-Pi,Pi}, AxesLabel-> {θ}]

d[1]=
h:=d[0]+d[1](θ-Pi/6)
Plot[{f,h},{θ,-Pi,Pi}, AxesLabel-> {θ}]

d[2]=
h:=d[0]+d[1](θ-Pi/6)+d[2](θ-Pi/6)^2
Plot[{f,h},{θ,-Pi,Pi}, AxesLabel-> {θ}]

d[3]=
h:=d[0]+d[1](θ-Pi/6)+d[2](θ-Pi/6)^2+d[3](θ-Pi/6)^3
Plot[{f,h},{θ,-Pi,Pi}, AxesLabel-> {θ}]

d[4]=
h:=d[0]+d[1](θ-Pi/6)+d[2](θ-Pi/6)^2+d[3](θ-Pi/6)^3+d[4](θ-Pi/6)^4
Plot[{f,h},{θ,-Pi,Pi}, AxesLabel-> {θ}]

By Corinne Manogue