0% found this document useful (0 votes)
26 views3 pages

Taylor

This document discusses Taylor series as a tool to approximate functions. Taylor series allows functions like cosine and exponential, which are difficult to directly compute, to be approximated by polynomials. As an example, the document shows how to approximate the cosine function with a 2nd order polynomial using Taylor series expansion around zero. By equating the polynomial and cosine function and their derivatives at zero, the coefficients of the polynomial are determined. Increasing the degree of the polynomial improves the approximation of the cosine function globally. Taylor series is thus useful for computational purposes when direct evaluation of functions is challenging.

Uploaded by

hicham henna
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views3 pages

Taylor

This document discusses Taylor series as a tool to approximate functions. Taylor series allows functions like cosine and exponential, which are difficult to directly compute, to be approximated by polynomials. As an example, the document shows how to approximate the cosine function with a 2nd order polynomial using Taylor series expansion around zero. By equating the polynomial and cosine function and their derivatives at zero, the coefficients of the polynomial are determined. Increasing the degree of the polynomial improves the approximation of the cosine function globally. Taylor series is thus useful for computational purposes when direct evaluation of functions is challenging.

Uploaded by

hicham henna
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 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