# Thread: Function Approximation

1. ## Function Approximation

I'm having trouble with the following question:

Let f(x) = sinx and P5(x) be the fifth-order Maclaurin polynomial for f.

a) What does Theorem 2 imply about the maximum approximation error committed by P5 over the interval [-2,2]?

b) What is the maximum actual approximation error committed by P5 over the interval [-2,2]?

Any help would be greatly appreciated .

2. Let $\displaystyle P_5(x)$ be the 5th degree Taylor polynomial, and $\displaystyle f(x) = \sin x$. Define $\displaystyle R_5(x) = f(x) - P_5(x)$ then if $\displaystyle x_0$ is any non-zero point on $\displaystyle (-2,2)$ it means by Lagrange's remainder there exists $\displaystyle y$ between $\displaystyle 0$ and $\displaystyle x_0$ so that $\displaystyle R_5(x_0) = \frac{f^{(6)}(y)}{6!} y^{6}$. Now $\displaystyle f^{(6)}(y) = -\sin y$. This means $\displaystyle |R_5(x_0)| = \left| \frac{-\sin y}{6!} y^6 \right| \leq \frac{2^6}{6!} = .0\bar 8$, but maybe we can improve this estimate. Let us use Cauchy's remainder, $\displaystyle R_5(x_0) = \frac{f^{(6)}(y)}{6!}(x_0 - y)^n x_0$, note $\displaystyle |x_0 - y|\leq 1$ and $\displaystyle |x_0|\leq 1$ thus, $\displaystyle |R_5(x_0)| \leq \frac{1}{6!} = .0013\bar 8$.

3. Originally Posted by larson
I'm having trouble with the following question:

Let f(x) = sinx and P5(x) be the fifth-order Maclaurin polynomial for f.

a) What does Theorem 2 imply about the maximum approximation error committed by P5 over the interval [-2,2]?

b) What is the maximum actual approximation error committed by P5 over the interval [-2,2]?

Any help would be greatly appreciated .
I not sure what theorem 2 is in your book, but I would guess it would be Taylor's Inequality...

if
$\displaystyle |f^{n+1}(x)| \le M$ for $\displaystyle |x-a|\le d$ , then the remainder $\displaystyle R_n(x)$ of the Taylor series satisfies the inequality

$\displaystyle |R_n(x)|\le\frac{M}{(n+1)!}|x-a^{n+1}|$

Since the 6th derivative of Sin(x) is -Sin(x)

Its max on [-2,2] is 1 so M =1. so in the formula a=0 because it is a Maclaurin series n=5 because it is 5th degree taylor poly.

Plugging all that in gives us

$\displaystyle |R_n(x)| \le \frac{1}{(5+1)!}2^{5+1}=\frac{64}{720}=\frac{4}{45 }$

The alternating series estimation could also be used and is much easier as well.
simplifying

4. Thank you so so much.

### actual approximation for f(x) = |x| matlab

Click on a term to search for related topics.