# Power series as approximation

I have to estimate the error when I approximate the function $$e^{\sin x}$$ to $$1+x+x^{2}+x^{3}$$ when $|x|<0.1$.

I really don't know how to do because my teacher didn't teach me. But what I did it was: I found the Taylor's polynom of $e^{\sin x}$ for $a=0$: $$T_{0}(x)=f(0)+f'(0)(x-0)+\frac{f''(0)}{2!}(x-0)^{2}+\frac{f'''(0)}{3!}(x-0)^{3}$$ then $$T_{0}(x)=1+x+\frac{1}{2}x^{2}$$ My question is: until here, is that the right way to solve it? If yes, what should I do now? How I use the fact that $|x|<0.1$? If it is wrong, where can I find some solved example to understand it? I didn't find anything good on google.

• Your education isn't restricted to what your teacher did or didn't teach. If you have a textbook, presumably that book discusses the remainder theorem which gives an expression for the error involved. Read that theorem. Understand it. Use it. – John Coleman Jun 26 '16 at 20:22
• "Estimate the error" is pretty broad, we must know what is the measure for that in your class. Usually, the error measure means the measure of the quadratic error. For a function $f$ approximated by $g$ within the interval $(a,b)$ the quadratic error is $$\int_a^b (f(x) - g(x))^2 \;\text{d}x$$ Since $|x| < 0.1$ we have $-0.1 < x < 0.1$ as the bounds, $f(x) = e^{\sin x}$ and $g(x) = 1+x+x^2+x^3$. Throwing this in WA gives numerical result $1.032\cdot10^{-6}$. But as as I said, we need more background here. – Maximilian Gerhardt Jun 26 '16 at 20:23
• @JohnColeman I know, actually, I've already read three textbooks, internet articles, tried to understand, did some other exercises, but I couldn't solve it, I'm not asking you to solve it for me, just some tips, or some article so I could understand it better. – mvfs314 Jun 26 '16 at 20:24

The Taylor expansion of $\exp\sin x$ around zero is $1+x+x^{2}/2+O(x^{4})$. Therefore, the error is \begin{align*} \left|\exp\sin x-(1+x+x^{2}+x^{3})\right| & =\left|-x^{2}/2+O(x^{3})\right|\\ & \leq|x^{2}|/2+|O(x^{3})|\\ & \approx|x^{2}|/2 & \text{for }|x|\text{ small}. \end{align*}
• When $|x|\leq0.1$, $|x^{2}|/2\leq0.1^{2}/2=0.005$. To verify that your estimate is OK, note that $1+0.1+0.1^{2}+0.1^{3}=1.111$ and $$1.111-\exp\sin0.1\approx0.006\approx0.005.$$ – parsiad Jun 27 '16 at 14:36
• Also, here is a plot of the error, which you can see is always approximately $\leq 0.006$: wolframalpha.com/input/… – parsiad Jun 27 '16 at 14:39
As you noted the Taylor series for $f(x) = e^x$ is $f(x) \approx 1 + x + \frac{x^2}{2} + \frac{x^3}{6}$. Now plug in $\sin x$ and use the fact that for values close to $x$ we have $\sin x \approx x$. So we have:
$$e^{\sin x} \approx 1 + x + \frac{x^2}{2} + \frac{x^3}{6}$$
Now the error of the first approximation is around $\frac{x^2}{2} + \frac{5x^3}{6}$. Use the fact that $\mid x \mid \le 0.1$ and plug it into the estimation to get the numerical approximation of the error.