Skip to main content

Section 9.1 Polynomial Approximations of Functions

Before we start, it might be helpful to remind ourselves of the way we have used linear functions to approximate other functions in Section 4.6 Linear Approximations.

Subsection What Do We Want From a Polynomial Approximation?

It’s always good to lay out our expectations clearly. We want to make sure that, when we create this new thing, that we have some clear idea of what we’re trying to accomplish in its creation. So let’s start with our Linear Approximation of a Function. What were the important properties of this linear function we created?
  1. The function’s output, \(f(x)\text{,}\) matched the output from the linear approximation, \(L(x)\text{,}\) at the center \(x=a\text{.}\)
    \begin{align*} L(x) \amp = f'(a)(x-a)+f(a) \\ L(a) \amp = f'(a)(a-a)+f(a)\\ \amp f(a) \end{align*}
  2. The function’s first derivative, \(f'(x)\text{,}\) matched the slope of the linear approximation, \(L'(x)\text{,}\) at \(x=a\text{.}\)
    \begin{align*} L'(x) \amp = \ddx{f'(a)(x-a)+f(a)} \\ \amp = f'(a)\\ L'(a) \amp = f'(a) \end{align*}
This seems like a good structure! We have \(f(a)=L(a)\text{,}\) giving us that nice intersection between our approximation and the function we’re approximating at the center. Then we used the slope of the function to estimate how our approximating function should move away from that center. The only real problem is that our function probably doesn’t have a constant slope, while a constant slope is the defining characteristic of the line we’re using.
So how do we extend this, then, into a better approximation? Well, an easy next step is to make the slope of our approximating function change as we move away from the center, \(x=a\text{.}\) That way, maybe the slopes change in a way that’s similar to the slopes of the actual function, and our approximating curve (not a line anymore) can follow the function for a bit longer.
What we’re saying is that we want a function where the second derivative is \(f''(a)\text{,}\) just like our first derivative matched \(f'(a)\text{.}\) Instead of using letters like \(L\) for linear and \(Q\) for quadratic, let’s just call these approximations by their function type (polynomials!) and degree. So \(p_1(x)=f'(a)(x-a)+f(a)\text{,}\) the first-degree polynomial approximation.
Now, to find \(p_2(x)\text{,}\) we’re going to add a term to the first-degree polynomial:
\begin{equation*} p_2(x) = \fillinmath{XXX}(x-a)^2+f'(a)(x-a)+f(a) \end{equation*}
Let’s differentiate this function twice, and force it to match \(f''(a)\) at \(x=a\text{.}\)
\begin{align*} p_2(x) \amp= \fillinmath{XXX}(x-a)^2+f'(a)(x-a)+f(a)\\ p_2'(x) \amp = 2(\fillinmath{XXX})(x-a)+f'(a)\\ p_2''(x) \amp = 2(\fillinmath{XXX} ) \end{align*}
What do we need to fill in the blank to make this match \(f''(a)\text{?}\)
\begin{align*} p_2''(x) \amp = 2\left(\frac{f''(a)}{2}\right) \\ \amp = f''(a) \end{align*}
So we get:
\begin{equation*} p_2(x) = \frac{f''(a)}{2}(x-a)^2+f'(a)(x-a)+f(a)\text{.} \end{equation*}
What if we wanted a higher degree? Like, \(p_3(x)\text{?}\) Let’s repeat the same process and see what happens!
\begin{align*} p_3(x) \amp = \fillinmath{XXX}(x-a)^3 + \frac{f''(a)}{2}(x-a)^2+f'(a)(x-a)+f(a)\\ p_3'(x) \amp = 3 (\fillinmath{XXX})(x-a)^2+f''(a)(x-a)+f'(a)\\ p_3''(x) \amp = 3(2)(\fillinmath{XXX})(x-a)+f''(a)\\ p_3'''(x) \amp = 3(2)(\fillinmath{XXX}) \end{align*}
If we, again, want this third derivative to match \(f'''(a)\) (so that the rate at which the slope changes as we move away from the center changes in the same way that it does on \(f\text{...}\)whew, that is going to be hard to interpret!), then we need to fill the blank in with \(\dfrac{f'''(a)}{3(2)}\text{.}\)

Subsection How Do We Build a Polynomial Approximation?

Let’s jump into a generalization of what we’ve just done. Answer these few questions with yourself, just to make sure you can see where we’re going:
  1. Why, in the coefficients for each term, do we have the derivative that matches the degree of the term? (First derivative for the first degree term, second derivative for the second degree term, and third derivative for the third degree term.)
  2. Why, in the coefficients for each term, do we divide? What are we dividing by, and why do we need these numbers specifically?
  3. If we add a 4th, 5th, and 6th term, what will we divide those 4th, 5th, and 6th derivatives (\(f^{(4)}(a)\text{,}\) \(f^{(5)}(a)\text{,}\) and \(f^{(6)}(a)\)) by?

Definition 9.1.1. Polynomial Approximation.

If \(f(x)\) is a function that is \(n\)-times differentiable at \(x=a\) (that is, the function/derivative values \(f(a)\text{,}\) \(f'(a)\text{,}\) \(f''(a)\text{,}\) ..., \(f^{(n)}(a)\) all exist), then the \(n\)th degree polynomial approximation of \(f(x)\) centered at \(x=a\) is:
\begin{align*} p_n(x) \amp = f(a)+ f'(a)(x-a)+\frac{f''(a)}{2}(x-a)^2+...+ \frac{f^{(n)}(a)}{n!}(x-a)^n\\ \amp = \sum_{k=0}^n \frac{f^{(k)}(a)}{k!}(x-a)^k \end{align*}

Activity 9.1.1. Build a Polynomial.

We’re going to use the formula in Definition 9.1.1 to construct two different polynomials that approximate two different approximations. Then, we’ll use them to approximate things!
(a)
We’re going to start with approximating the function \(f(x)=\sin(x)\) centered at \(x=0\text{.}\) Let’s choose to look at a 5th degree polynomial.
This means we’ll need to find the first five derivatives of \(f(x)=\sin(x)\text{.}\) Then, we’ll evaluate our function and the five derivatives at the center. After that, we can divide by the relevant factorial in order to create the coefficients of our polynomial.
Fill out the following chart to produce these coefficients.
Table 9.1.2. Coefficients for Polynomial Approximation
\(k\) \(f^{(k)}(x)\) \(f^{(k)}(a)\) \(\dfrac{f^{(k)}(a)}{k!}\)
\(k=0\) \(f(x)=\sin(x)\) \(f(0)=\fillinmath{XXXXX}\) \(\fillinmath{XXXXX}\)
\(k=1\) \(f'(x)=\fillinmath{XXXXX}\) \(f'(0)=\fillinmath{XXXXX}\) \(\fillinmath{XXXXX}\)
\(k=2\) \(f''(x)=\fillinmath{XXXXX}\) \(f''(0)=\fillinmath{XXXXX}\) \(\fillinmath{XXXXX}\)
\(k=3\) \(f'''(x)=\fillinmath{XXXXX}\) \(f'''(0)=\fillinmath{XXXXX}\) \(\fillinmath{XXXXX}\)
\(k=4\) \(f^{(4)}(x)=\fillinmath{XXXXX}\) \(f^{(4)}(0)=\fillinmath{XXXXX}\) \(\fillinmath{XXXXX}\)
\(k=5\) \(f^{(5)}(x)=\fillinmath{XXXXX}\) \(f^{(5)}(0)=\fillinmath{XXXXX}\) \(\fillinmath{XXXXX}\)
(b)
Now we can use these coefficients to construct the polynomial! These coefficients should all be on power functions in the form \((x-a)^k\) for \(k=0,1,...,5\text{.}\) These (added together) will form your polynomial, \(p_5(x)\text{.}\)
(c)
Approximate \(f(1)=\sin(1)\) using your polynomial.
(d)
Let’s repeat this for another function. Let’s build a 5th degree polynomial approximation of \(g(x)=e^x\) centered at \(x=0\text{.}\) We can construct the coefficients in the same way.
Table 9.1.3. Coefficients for Polynomial Approximation
\(k\) \(g^{(k)}(x)\) \(g^{(k)}(a)\) \(\dfrac{g^{(k)}(a)}{k!}\)
\(k=0\) \(g(x)=e^x\) \(g(0)=\fillinmath{XXXXX}\) \(\fillinmath{XXXXX}\)
\(k=1\) \(g'(x)=\fillinmath{XXXXX}\) \(g'(0)=\fillinmath{XXXXX}\) \(\fillinmath{XXXXX}\)
\(k=2\) \(g''(x)=\fillinmath{XXXXX}\) \(g''(0)=\fillinmath{XXXXX}\) \(\fillinmath{XXXXX}\)
\(k=3\) \(g'''(x)=\fillinmath{XXXXX}\) \(g'''(0)=\fillinmath{XXXXX}\) \(\fillinmath{XXXXX}\)
\(k=4\) \(g^{(4)}(x)=\fillinmath{XXXXX}\) \(g^{(4)}(0)=\fillinmath{XXXXX}\) \(\fillinmath{XXXXX}\)
\(k=5\) \(g^{(5)}(x)=\fillinmath{XXXXX}\) \(g^{(5)}(0)=\fillinmath{XXXXX}\) \(\fillinmath{XXXXX}\)
(e)
And now, again, we can use these coefficients to construct the polynomial! These coefficients should all be on power functions in the form \((x-a)^k\) for \(k=0,1,...,5\text{.}\) These (added together) will form your polynomial, \(p_5(x)\text{.}\)
(f)
Approximate \(g(-3)=\dfrac{1}{e^3}\) using your polynomial.
Now that we know how to build and use these, we should probably think about accuracy. Are the estimations coming from these polynomials even accurate? How do we talk about that?
We won’t formally define this too much for now: instead, we’ll just look at things visually and see if we can figure out what might go into how we talk about accuracy of our estimations.

Activity 9.1.2. How Good Are Our Approximations?

We’re going to think more carefully about our approximations of \(\sin(1)\) and \(e^{-3}\) from Activity 9.1.1. In order for us to do this, let’s visualize the function and the 5th degree polynomial for it.
(a)
How good of a job did the polynomial approximation do when approximating \(\sin(1)\text{?}\) How can you tell, visually?
(b)
How good of a job did the polynomial approximation do when approximating \(e^{-3}\text{?}\) How can you tell, visually?
(c)
How does the relationship between the “center” and the \(x\)-value that we’re approximating at impact the accuracy of our approximation?
(d)
How do you think you could make these approximations better (without changing the center)?
So we have a couple of main ideas about the accuracy of our approximations. We don’t need to formalize them, but we can use them as a guiding rule for how we talk about these polynomial approximations.

Accuracy in Polynomial Approximations.

  • Approximations using \(x\)-values closer to the center are likely to be more accurate than approximations using \(x\)-values farther away from the center.
  • Polynomials with larger degrees give more accurate approximations than polynomials with smaller degrees at the same \(x\)-values.

Subsection Are These Partial Sums?

We have been using some familiar language here...we’re talking about these “approximations” improving as we increase some parameter, \(n\text{.}\) We have some intuition that when we increase \(n\text{,}\) these approximations “approach” an object (in this case, a function) in some sense.
We’re adding more and more terms to this sum as we increase \(n\text{.}\) Is a polynomial approximation just a partial sum?
Are we just going to look at a limit as \(n\to\infty\) and see what happens?

Activity 9.1.3. Partial Sums of What?

Let’s revisit our 5th degree polynomial approximations from Activity 9.1.1.
\begin{align*} \sin(x) \amp \approx x-\frac{x^3}{3!} +\frac{x^5}{5!}\\ e^x \amp \approx 1+x+\frac{x^2}{2!} + \frac{x^3}{3!} + \frac{x^4}{4!} + \frac{x^5}{5!} \end{align*}
These approximations work well for \(x\)-values that are close to 0, but we will not be more formal than that.
(a)
Make a conjecture about what the 7th degree polynomial approximations are for each of these functions.
What about the 15th degree?
(b)
Make a conjecture about what the general formula would be for these terms. If you were to write these out using summation notation, what would they look like?
(c)
Why does the polynomial approximation for the sine function only have odd-exponent terms?
(d)
Make a conjecture about what a polynomial approximation for \(f(x)=\cos(x)\) centered at \(x=0\) would be.
We’ll explore these polynomials more, but we’re specifically interested in the infinite-series version of these things. We’ll give these polynomials a name, for easy reference: Taylor polynomials.
The main result to come out of this has to do with the relationship between these polynomials and the function they are approximating.
This result is great, in that it gives us the confidence to approximate these functions. We can add on to this the idea that we expect \(R_n(x)\) to get smaller as \(n\to\infty\text{.}\) This should lead us to some idea of convergence, which we can think about here.

Activity 9.1.4. How Do These Polynomials Converge?

We’re going to end here by thinking about these polynomials as some partial sum from an infinite series. If there is an infinite series, we should be prepared to think about convergence!
We’re going to think about convergence in the same way that we have already: as an end behavior limit of the partial sums. So let’s spend our time investigating this end behavior by visualizing polynomial approximations as the degree increases.
(a)
What happens to the polynomial approximation of \(\sin(x)\) centered at \(x=0\) as the degree \(n\to\infty\text{?}\)
(b)
Does this behavior change if we centered our approximation elsewhere?
(c)
What happens to the polynomial approximation of \(e^x\) centered at \(x=0\) as the degree \(n\to\infty\text{?}\)
(d)
Does this behavior change if we centered our approximation elsewhere?
(e)
What happens to the polynomial approximation of \(\cos(x)\) centered at \(x=0\) as the degree \(n\to\infty\text{?}\)
(f)
Does this behavior change if we centered our approximation elsewhere?
(g)
What happens to the polynomial approximation of \(\ln(x)\) centered at \(x=2\) as the degree \(n\to\infty\text{?}\)
(h)
Describe the difference in what you’re seeing with the log function compared to the other functions we’ve thought about. Describe how the polynomial approximations converge: do they converge to the log function? How? More importantly, where?
(i)
Does this behavior change if we centered our approximation elsewhere?
Ok, so this is pretty interesting! For some functions, like \(\sin(x)\text{,}\) \(e^x\text{,}\) and \(\cos(x)\text{,}\) it seems like the polynomials that we built will end up matching (converging to) the functions pretty much everywhere: as \(n\to\infty\) we can get any function value from the polynomial, approximated to whatever accuracy we’d like!
But that’s different for the log function. We were only able to get our polynomial to match the function’s behavior on a specific interval of \(x\)-values. No matter how high the degree of the polynomial was, we weren’t able to get it close to approximating something like \(\ln(10)\text{,}\) for instance. Unless we changed the center, of course!
This is going to bring up some great questions about how these partial sums converge to functions. We’ll talk all about that in the next section!

Practice Problems Practice Problems

1.

Consider a polynomial approximation of some function \(f(x)\) centered at \(0\text{.}\) Explain how the degree of the polynomial approximation impacts the accuracy of the approximation.

2.

Consider a function \(f(x)\) with a a second degree polynomial, \(p(x) = \frac{f''(a)}{2}(x-a)^2 + f'(a)(x-a) + f(a)\text{.}\) We want to approximate \(f(b)\) using the polynomial by evaluating \(p(b)\text{.}\) Explain how the location of \(b\) in relation to the center \(a\) impacts the accuracy of the approximation.

3.

Say we want to approximate \(\sqrt[3]{7}\) using a third degree polynomial.
(a)
Which function, \(f(x)\text{,}\) will you use to build the polynomial?
(b)
What is an appropriate value for the center, \(a\text{,}\) for your polynomial? Why is this value appropriate?
(c)
Build the polynomial approximation, \(p(x)\text{,}\) to approximate \(f(x)\text{.}\)
(d)
Evaluate your polynomial at \(x=7\text{.}\) What does this tell you about the value of \(\sqrt[3]{7}\text{?}\)

4.

Consider the function \(f(x)=\sin(x)\text{.}\) Our goal is to approximate \(\sin(0.023)\text{.}\)
(a)
Build a third degree polynomial approximation of \(f(x)\) centered at \(0\) and use it to approximate \(\sin(0.023)\text{.}\)
(b)
Build a fifth degree polynomial approximation of \(f(x)\) centered at \(0\) and use it to approximate \(\sin(0.023)\text{.}\)
(c)
What would you do to get a better approximation of the value \(\sin(0.023)\text{?}\)
(d)
What could you do to get the exact value of \(\sin(0.023)\) using polynomials?

5.

For each of the following functions, find a fourth degree polynomial to approximate the given value.
(a)
Approximate \(\sqrt{1.05}\) using \(f(x) = \sqrt{1+x}\text{.}\)
(b)
Approximate \(\ln(0.95)\) using \(f(x) = \ln(x)\text{.}\)
(c)
Approximate \(e^{-0.12}\) using \(f(x) = e^{-x}\text{.}\)
(d)
Approximate \(\cos(-0.15)\) using \(f(x) = \cos(x)\text{.}\)
(e)
Approximate \(\frac{1}{1.02}\) using \(f(x) = \frac{1}{x+1}\text{.}\)