Taylor Series Approximations

A Taylor series is a way to represent a function in terms ofpolynomials. Since polynomials are usually much easier to work with than complicated functions, Taylor series have numerous applications in both math and physics.

There are many equations in physics — like the one describing the motion of a pendulum — that are impossible to solve in terms of elementary functions. “Approximations using the first few terms of a Taylor series can make [these] otherwise unsolvable problems” solvable for a restricted area of interest [1].

The GIF above shows the five-term Taylor series approximation of a sine wave about x=0.

Mathematica code:

f[x_] := Sin[x]

ts[x_, a_, nmax_] :=

        Sum[(Derivative[n][f][a]/n!)*(x - a)^n, {n, 0, nmax}] 

Manipulate[Plot[{f[x], ts[x, 0, nmax]}, {x, -2*Pi, 2*Pi}, 

            PlotRange -> {-1.45, 1.45}, 

            PlotStyle -> {{Thick, Cyan}, {Thick, Dotted, Yellow}},

              AxesStyle -> LightGray, Background -> Darker[Gray, 0.8]], 

            {nmax, 1, 30, 1}]

评论
热度(1)
©Looks Like Physics | Powered by LOFTER

Looks Like Physics is a project developed to challenge the stereotypical perception of Physics and change the perception of who and what a physicist is or isn't.