r/MathHelp • • Sep 04 '20

Why does the Taylor series approximation work? Like - conceptually, how does taking more and more derivatives of a function get you closer to the actual one?

And why do you add each derivative

16 Upvotes

17 comments sorted by

8

u/BootyIsAsBootyDo Sep 04 '20

Let's try to work out the square root of 69.

If you say the answer is 8, then that's using the 0th derivative to make an estimation, aka you have a nearby known point (64,8) and can recognize that sqrt(69) should be near this.

We can instead get a better estimate by looking at the rate of change near x=64. If we just extended the line straight from (64,8), we would get another approximation but this one accounts for the expected increase when we go from x=64 to x=69. This is using the 1st derivative.

Similarly, we can account for the concavity in our estimate by considering the second derivative. Accounting for higher order derivatives means that we more closely account for each aspect of the curve, and in the limit we approach the exact value

3

u/redditjule Sep 04 '20

By accounting for each successive derivative - why do we add them?

4

u/BootyIsAsBootyDo Sep 04 '20

Take any polynomial of degree n. If you take the kth derivative of the polynomial, then all terms of degree <k vanish to 0 (consult the power rule to see that).

Essentially, each finite Taylor polynomial is assuming that the function's nth derivative is 0, but adding more terms will adjust these derivatives to be whatever you want

7

u/hausdorffparty Sep 04 '20

So, a fun fact is that Taylor series approximation doesn't work for every function out there. For example, take the function e^(-1/x^2) when x!=0 and 0 when x=0. It looks like this. EVERY derivative of this function is 0 at when x=0 (it does take work to show it is differentiable), so if you tried to graph its Taylor series centered at x=0, you'd get out the 0 function! Isn't that weird?

However, most of the "nice" functions you work with usually work. Why? Well, in most nice cases, the derivatives of the function grow "subexponentially". They don't get too extreme as you take more and more derivatives. It turns out that's good enough: a short explanation can be found using Taylor's inequality, but then that just shunts the question to "why is Taylor's inequality true?" and, well, if you're still wondering, it might be worth taking a course in Analysis!

1

u/redditjule Sep 04 '20

But how does addingup each derivative ensure that the two cars stay parallel?

1

u/hausdorffparty Sep 04 '20

Think about what happens to the first term when you take the first derivative: It disappears, so it's just the second term and later that determines the first derivative.

If you take the first two derivatives, the first two terms of the Taylor series disappear. What's left determines the second derivative.

Each term you add makes sure that your "nth" derivative is correct and doesn't affect the "n+1"st derivative because when you take the "n+1"st derivative, the "nth" term goes to 0.

4

u/Munch7 Sep 04 '20

Here’s a great video by 3Blue1Brown that talks about it conceptually while also show a visual representation

3

u/edderiofer Sep 04 '20

More accurately, it's the sum of (the nth derivative, multiplied by some factor, multiplied by the nth power of x) that gets you closer to the actual one.

The idea is that this sum up to n is the best nth-degree polynomial approximation to the polynomial, because the derivatives of this polynomial (up to the nth derivative) are the same as those of the original function.

2

u/math3matico Sep 04 '20

Suppose we find the Taylor Series, T(x), of f(x) at x0. Each term in T(x) is a coefficient multiplied by (x - x0)^n.

To make sure T(x) is equal to f(x) at x0, we must define T(x0) = f(x0). When x = x0, all other terms of T(x) disappear. So far we have T(x) = f(x0).

When x - x0 is small, (x - x0)^2 terms and higher are very small, so we ignore them. We can make T(x) close to f(x) in this locale by adding a correction term: so now T(x) = f(x0) + f'(x0) * (x - x0). Adding this term doesn't affect the fact that T(x0) = f(x0).

When (x - x0)^2 is small, (x - x0)^3 and higher are very small, so we ignore them. We can make T(x) closer to f(x) in this locale by adding a correction term: so now T(x) = f(x0) + f'(x0) * (x - x0) + f''(x0)/2! * (x - x0)^2. Adding this term doesn't (really) affect the quality of the approximation provided by the previous step, when we added the linear term, f'(x0) * (x - x0), because when x - x0 is small, (x - x0)^2 is very small, so this term becomes negligible.

As we proceed adding more and more terms, we are adding corrections which don't affect too much the more local improvements made by the previous addition, but which help bend y = T(x) less and less locally to approximate y = f(x). The reason we add the terms is a little bit like the principle of superposition and harmonics: adding a new term will affect every point on the previous curve, but it will have certain areas where that effect is most salient.

The reason we use the derivatives can be intuitively understood by imagining two cars drag racing. Suppose we want them to stay parallel all times. Then they had better start off at the same position. To make sure they stay parallel they had better start with the same speed. Even better if they start with the same speed and acceleration. Even better if...

1

u/AutoModerator Sep 04 '20

Reminder:

  • What have you tried so far? (See Rule #2)

  • Please don't delete your post. (See Rule #7)

We, the moderators of /r/MathHelp, appreciate that your question contributes to the MathHelp archived questions that will help others searching for similar answers in the future. Thank you for obeying these instructions.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

1

u/Armang211 Sep 04 '20 edited Sep 04 '20

It matches up every derivative. Imagine a function f(x) is a polynomial and say you want the value of the nth derivative of f(x) at a certain point (x=a). So, let’s just assume 3rd order, this would be f’’’(a). So this f’’’(a) is your function’s third derivative at x=a, it’s a constant. Well you can integrate this to get f’’’(a)*x + f’’(a) and then integrate again to get (1/2!)*f’’’(a)*x2 + f’’(a)*x + f’(a) and then again integrate to get (1/3!)*f’’’(a)*x3 + (1/2!)*f’’(a)*x2 + f’(a)*x + f(a). Which would be the Taylor polynomial. So basically you start with matching the ‘last’ derivative and integrate till you get the original function. For non-polynomial functions this can take on infinite terms, but it’s clear how this pattern emerges. (Note that in the polynomials it should have (x-a)n ... just imagine a is 0 at first but then if you change a you just need to shift the polynomial over so it matches the function value with that specific a value of x)

1

u/[deleted] Sep 06 '20 edited Sep 06 '20

It dosen't always work. By construction, the nth Taylor approximation p_n of f at c matches the 0 through nth derivatives of f at c. The approximation need not be accurate, and it need not converge to f as n -> infinity.

To figure out accuracy and convergence you need to study the remainder, E_n(x) = f(x) - p_n(x).

According to the Lagrange remainder, the remainder is what would be the next term in the approximation at some unknown point \xi between c and x (called the Lagrange form of the remainder):

https://en.wikipedia.org/wiki/Taylor%27s_theorem#Explicit_formulas_for_the_remainder. You can then study the remainder and make conclusions about the error of the approximation and convergence. The proof of the Lagrange remainder is relatively simple and makes use of the generalized mean value theorem. See here for the proof (this is a good book for intro real analysis in general): https://elliespathtostatistics.files.wordpress.com/2018/03/abbott-second-edition.pdf

1

u/[deleted] Sep 04 '20

[removed] — view removed comment

1

u/redditjule Sep 04 '20

Why do we add each term though