Power Series Approximation
Physics 309, Math Methods

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

f:=Sin[θ]

Plot[f,{θ,0,2π},
PlotRange->{{0,2π},{-1.1,1.1}},
 AxesLabel-> {Theta},
PlotStyle->{RGBColor[0, 0.501961, 1],Thickness[0.010]},
ImageSize->600,
AspectRatio->0.8]

Now type in the missing information at the prompts below and press shift enter.

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

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

The function g(θ) is the approximation to f(θ).  The thin orange line is the approximation and the thicker blue line is the function f(θ).

Plot[{f,g},{θ,0,π},
PlotRange->{{0,π},{0,2.1}},
AxesLabel-> {Theta},
PlotStyle->{{RGBColor[0, 0.501961, 1],Thickness[0.010]},{Thick,Orange}},
ImageSize->600,
AspectRatio->0.8]

For what values of θ is g(θ) a good approximation for f(θ) = Sin(θ)?

Third order (n = 3) term:

c[3]:=
g:=c[1]*θ+c[3]*(θ^3)

Plot[{f,g},{θ,0,π},
PlotRange->{{0,π},{0,1.1}},
AxesLabel-> {Theta},
PlotStyle->{{RGBColor[0, 0.501961, 1],Thickness[0.010]},{Thick,Orange}},
ImageSize->600,
AspectRatio->0.8]

For what values of θ is g(θ) a good approximation for f(θ) = Sin(θ)?

Fifth order (n = 5) term:

c[5]:=
g:=

Plot[{f,g},{θ,0,π},
PlotRange->{{0,π},{0,1.1}},
AxesLabel-> {Theta},
PlotStyle->{{RGBColor[0, 0.501961, 1],Thickness[0.010]},{Thick,Orange}},
ImageSize->600,
AspectRatio->0.8]

For what values of θ is g(θ) a good approximation for f(θ) = Sin(θ)?

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.

h:=

Plot[{f,h},{θ,-π,π},
PlotRange->{{-π,π},{0,1.1}},
AxesLabel-> {Theta},
PlotStyle->{{RGBColor[0, 0.501961, 1],Thickness[0.010]},{Thick,Orange}},
ImageSize->600,
AspectRatio->0.8]