Calculus 2, Fall 2016

## Idea of Taylor polynomials

1. Polynomials $$a_0 + a_1 x + a_2 x^2 + \cdots + a_n x^n$$ are nice to evaluate because they rely on addition and multiplication and because we understand them very well. By extension, power series $$a_0 + a_1 x + a_2 x^2 + \cdots$$ are also nice, but we need to work to understand them better.

2. Given any function $$f$$, is there a (best) linear approximation to $$f$$ at a point $$x=a$$? What about a (best) quadratic, cubic,…, or degree $$n$$ polynomial approximation to $$f$$ at $$a$$? If we let the degree $$n$$ go to infinity, does the power series converge to $$f$$ near $$a$$? For what values of $$x$$ will the power series converge to $$f$$?

## Idea of linear approximation

If $$f$$ is differentiable at $$c$$, then the linear approximation (i.e., tangent line) to $$f$$ at $$c$$ is $$p_1(x) = f(c) + f'(c) (x-c)$$ and for $$x$$ "near" $$c$$, $$f(x) \approx p_1(x)$$. Notice: $$f$$ and $$p_1$$ have the same zeroth and first derivative at $$c$$: $f(c) = p_1(c),$ $f'(c) = p_1'(c).$

Can we construct a quadratic approximation (i.e., tangent parabola)? What properties should it have?

## Best polynomial approximation

The best degree $$n$$ polynomial approximation to $$f$$ at $$c$$ should satisfy $\begin{array}{rcll} f(c) & = & p(c) & \text{(same value)}, \\ f'(c) & = & p'(c) & \text{(same 1st deriv.)}, \\ f''(c) & = & p''(c) & \text{(same 2nd deriv.)}, \\ & \vdots & \\ f^{(n)}(c) & = & p^{(n)}(c) & \text{(same nth deriv.)}. \end{array}$

A degree $$n$$ polynomial centered at $$c$$ has the form $$p(x) = a_0 + a_1 (x-c) + a_2 (x-c)^2 + \cdots + a_n (x-c)^n$$. What should the coefficients be for the best approximation?

## Taylor polynomials

The coefficients in the best local approximation are $a_k = \frac{f^{(k)}(c)}{k!},$ and the best degree $$n$$ polynomial approximation to $$f$$ at $$c$$ is the Taylor polynomial $\begin{array}{rcl} p_n(x) & = & f(c) + f'(c)(x-c) + \frac{f''(c)}{2!} (x-c)^2 \\ && + \frac{f'''(c)}{3!} (x-c)^3 + \cdots + \frac{f^{(n)}(c)}{n!} (x-c)^n \\ & = & \displaystyle \sum_{k=0}^{n} \frac{f^{(k)}(c)}{k!} (x-c)^k. \end{array}$

## Example

Find the Taylor polynomials of degree $$\leq 4$$ centered at $$c=1$$ that approximate $$f(x) = \ln(x)$$. Use the Taylor polynomial of degree $$4$$ to find an approximate value for $$\ln(1.5)$$. What is the error in your approximation?

## Taylor's theorem

Theorem: Let $$f$$ be a function with $$n+1$$ derivatives on an interval $$I$$ containing $$c$$. Then, for each point $$x$$ in $$I$$, there's a point $$z$$ between $$x$$ and $$c$$ such that $f(x) = p_n(x) + R_n(x)$ where $$p_n(x)$$ is the degree $$n$$ Taylor polynomial to $$f$$ at $$c$$, $R_n(x) = \frac{f^{(n+1)}(z)}{(n+1)!}(x-c)^{n+1}$ is the error (or remainder) of the approximation, and the absolute value of the error is less than the maximum value of $$|R_n(x)|$$ on the interval $$I$$.

## Taylor series

If the absolute error $$| R_n(x) | \to 0$$ as $$n \to \infty$$ for any $$x$$, then $f(x) = \lim_{n \to \infty} (p_n(x) + R_n(x)) = p_\infty(x)$ and thus $f(x) = \sum_{k=0}^{\infty} \frac{f^{(k)}(c)}{k!} (x-c)^k$ is the Taylor series for $$f$$ centered at $$c$$.

## Example

Find the first four Taylor polynomial approximations to $$f(x) = e^x$$ centered at $$c=0$$. Use them to estimate $$e^{0.1}$$.

## Example

$$f(x) = p_n(x) + R_n(x)$$, and at $$x = 0.1$$:

$$n$$ $$f(0.1)=e^{0.1}$$ $$p_n(0.1)$$ $$R_n(0.1)$$
0 1.10517 1.00000 0.10517
1 1.10517 1.10000 0.00517
2 1.10517 1.10500 0.00017
3 1.10517 1.10517 0.00000

## Examples

For each function below, find it's Taylor series and interval of convergence.

1. $$f(x) = \cos(x)$$ centered at $$c=0$$.

2. $$f(x) = x^2 \cos(\sqrt{x})$$ centered at $$c=0$$. What is the interval of convergence?

3. $$f(x) = \sin(x)$$ centered at $$c=0$$.

4. $$\displaystyle f(x) = \frac{\sin(x)}{x}$$ centered at $$c=0$$. Then, find $$\displaystyle \lim_{x \to 0} \frac{\sin(x)}{x}$$.

5. $$f(x) = \arctan(x)$$ centered at $$c=0$$. Hint: $$\displaystyle \frac{d}{dx} \arctan(x) = \frac{1}{1+x^2}$$.

## Example

$\cos(x) = 1 - \frac{x^2}{2!} + \frac{x^4}{4!} - \frac{x^6}{6!} + \cdots = \sum_{n=0}^{\infty} \frac{(-1)^n x^{2n}}{(2n)!}$

Show that $$e^{i \theta} = \cos(\theta) + i \sin(\theta)$$.