matlab-enhanced Swiki= [View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide]

Jodie Simkoff, Ryan McLynn, Jeffrey Chen, James Dong, Maziar Adloo, Section QH2

Taylor Polynomials and LaGrange Error

Taylor Polynomials are used to approximate a function. Since it is an approximation, the LaGrange Error formula is used to calculate the error between the actual function and the Taylor Polynomial.

Now, you may be thinking, how can this be applied to real life?! Well: Imagine that you're strolling down the street carrying a matrix that you're going to give to Dr. Morley for his birthday, and someone threatens to mug you. UNLESS, you can approximate ex around x=0.

Now, that seems kinda tricky. We know e is 2.7-Andrew Jackson-Andrew Jackson (or 2.718281828 for those of you who don't know your history), but it's kinda hard to calculate the powers of e (especially if the mugger already took your calculator). Whatever to do?!


USE TAYLOR POLYNOMIALS!!!

Given f(x) as your function, the general formula for a Taylor Polynomial is:

f(0) + f'(0)x + [f''(0)x2]/2 + ... + [fn(0)xn]/n! (+ error)

Now evaluate ex.

f(x) = ex
f'(x) = ex
f''(x) = ex

... Do you see a pattern yet?

Thus: fn(0) = 1

So,
ex = 1 + x + x2/2 + ... + xn/n! (+ error)


So you've outsmarted the mugger. But he has one last trick up his sleeve...
"You think you're so smart?! Well what's the approximation of e2/3 within 10-3?! HUH?!?!" (As an act of grace, the mugger gives back your calculator, but with the ability to compute e2/3 disabled.)

First we need to determine what n to use in our Taylor Polynomial. For this we need to calculate the error. (Reminder: n is the degree of the Taylor Polynomial.)

Uh oh. Error. What do we use for that?


LaGrange Error Formula, of course!!

For a Taylor Polynomial, the error E is given by:
error formula

where M is the maximum value of the function (or greater) over the interval [0,x]. But remember, the smaller M is, the better your approximation. In this case, x = 2/3, so, to be safe, we'll say M = 2. It is important to remember that the maximum value of the function can actually be a negative number because we are considering the distance between the approximation and the true value on a number line.

For our mugger:

10-3 ≥ [2(x)n+1]/[(n+1)!]
10-3 ≥ [2(2/3)n+1]/[(n+1)!]


Plug in different values for n (starting with one) until you satisfy the inequality. This n is the degree of your Taylor Polynomial. Here, n = 5.

P(x) = 1 + x + x2/2 + x3/3! + x4/4! + x5/5!
P(2/3) = 1 + (2/3) + (2/3)2/2 + (2/3)3/3! + (2/3)4/4! + (2/3)5/5!
P(2/3) = 7099/3645 =
1.9476

The mugger, grudgingly, lets you go. But memorize these formulas! You never know when they might be useful!

(On a side note, there actually is no real use for Taylor Polynomials outside of your calculus class, according to Wikipedia. However, you might be able to pick up women with your mad approximation skillz.)


The following are for entertainment purposes only!

Why was six afraid of seven?
Uploaded Image: 7 8 9.jpg
Because seven ate nine!


Uploaded Image: ang s s.jpg


Uploaded Image: asymptote.jpg


Uploaded Image: bacon.gif


Uploaded Image: dork.gif


Uploaded Image: drink and derive.gif


Uploaded Image: fraction.jpg


Uploaded Image: helpline.jpg


Uploaded Image: lim.jpg


This is how we feel on Quiz days:
Uploaded Image: math test.png


Uploaded Image: simple math.jpg


Uploaded Image: notice.jpg


Uploaded Image: pi.jpg


Uploaded Image: rational and real.jpg


Uploaded Image: six.jpg

----
links to this page