Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

Introduction:

Importance of learning Math to comprehend physical phenomena. In this course, we will also see
some programming tools to solve Math problems.

Taylor series
Take the example of a pendulum:

Without calculator or a table of all values, it’s hard to compute cos(θ). Also knowing that (L=R(1-
cos(θ))) will oscillate between two max, it’s hard to visualize it intuitively from cos(θ). Instead, if we
plug (1- θ2/2) in cos(θ) place, we could visually understand the oscillatory nature of the pendulum
with small values of theta.

It’s a tool to approximate functions. In physical world, we often need to compute functions like cos(x)
or exp(x).etc. These functions are hard to compute directly, so a polynomial approximation is
beneficial.

Let’s take the example of: cos(x):

Let’s say that we can approximate this function by a 2nd order polynomial:
P(x) = c1 + c2  x + c3  x2
We can start nudging coefficients values and see how much we get closer to cos(x).

First, we take P(x) value when x = 0, to neglect higher order terms:

P(0) = c + c 0 + c 02 = c ;
(x = 0)   1 2 3 1
cos(0) =1;

 c1 =1.

Now we update P(x) to get: P(x) =1+ c2  x + c3  x2 .


The key idea is to try getting one coefficient each time at “power_0” place (like the c1 above). To do
so, we derivate the expression of P(x):

dP d
= (1+ c2  x + c3  x2 )
dx dx
= c2 + 2c3  x

On the other hand:


d cos(x) =−sin(x)
dx
−sin(0) = 0

Again, taking these values when x=0, we get: dP (0) = c   c2 = 0
dx 2

Intuition here: the tangent at x=0 is horizontal, so the derivative must be zero which is (-sin(0) = 0). On
the other hand, the derivative of our polynomial at (x=0) is c2. Now if we want the derivative to be
zero here, c2 must equal zero).
d 2P d
2
= (c2 + 2c3  x)
We derivate P(x) again: dx dx
= 2c3

So, knowing that:


d 2 cos(x) =−cos(x) , and by taking values at: x=0, we get:
dx2
−cos(0) = −1
 1
d 2 P (0) = 2c   c3 = − 2
dx2 3

2
Using the resulted coefficients, we get: P(x) =1− x
2

We see now that our polynomial is a good approximation of cos(x) around “0”. To generalize this
approximation, we add high order terms. In the following figure, we compute the approximation with
polynomial degree from 2 to 20:

You might also like