# Using a Taylor polynomial to calculate the error in using $x$ as an approximation for $\sin{x}$

I'm trying to calculate the error involved in using $x$ to approximate $\sin({1^\circ})$. The Taylor polynomial is centered around $x=0$ (i.e. $x_0=0$), by the way. Since I have to use $x$ as the approximation for $\sin({x}),$ I'm guessing the Taylor polynomial will have to be of degree one:

$$f(x)=e^x=P_1(x)+R_1(x)$$ since the polynomial $P_1(x)$ does result in $f(x_0)+f'(x_0)(x-x_0)=\sin({0})+\cos({0})x=x$.

When calculating the remainder (i.e. $R_1(x)$), I get that it is given by: $$\frac{f^{(1+1)}(z)}{(n+1)!}(x-x_0)^2$$ where $z$ is a real number between $x$ and $x_0$. Plugging in the information for this case, then, $$R_1(x)=\frac{f''(z)}{2!}x^2$$ Since $f(z)=\sin({z})$, $f''(z)=-\sin({z})$. The error is then given by $|R_1(x)|=\lvert-\frac{1}{2}x^2 \sin{(z)}\rvert$.

Trying to find the boundaries for the error specifically when $x=1$ (since the question asks for the error in using $x$ to approximate $\sin(1^\circ)$) gets me that the lower bound is zero (if the estimation were perfectly accurate, which it isn't). I'm having trouble finding the upper boundary, though. The maximum value for |$\sin{(z)}$| is 1 (since the absolute value of the sine function oscillates between 0 and one). Since I'm being asked to calculate the error for when $x=1$, I think $x$ is supposed to be $1$. This would mean that the upper bound would be given by: |$-\frac{1}{2}(1)^2$|$=\frac{1}{2}$. The given answer, though, is that the error is approximately $8.86 \cdot 10^{-7}$.

What did I do wrong? It always struck me that $x$ would be an unsuitable approximation for $\sin{(1^\circ)}$ since, at $x=1$, $\sin({1^\circ})$ is very small, certainly less than one (the maximum value for the sine function). I don't understand how the error can be so relatively small.

• Two comments: Did you convert degrees into radians? And, more subtly, because $\sin$ is an odd function, the Taylor polynomial of degree $1$ at $0$ is in fact the polynomial of degree $2$, so you get a higher-order error estimate. – Ted Shifrin Jun 7 '18 at 1:17
• Would I need to convert degrees into radians for the $x$ function? Or would I only need to do that for the sine function? – A. Lieber Jun 7 '18 at 1:18

## 1 Answer

The error is that you are plugging in $x=1$, instead of $x=1^\circ$. A degree is $\frac{\pi}{180}$ radians, so you should set $x=\frac{\pi}{180}$ instead.

(The right way to think about this is that the sine function is just defined by $\sin x=\sum_{n=0}^\infty \frac{(-1)^n}{(2n+1)!}x^{2n+1}$. When $x$ is an angle measure in radians, then $\sin x$ defined in this way happens to also coincide with the geometric "sine" function you learn about in trigonometry. But if you measure $x$ in degrees it does not.)

Also, you can get a much better upper bound for the $\sin(z)$ part. Since $z$ is between $0$ and $1^\circ$ and sine is increasing on this interval, the most that $\sin(z)$ could be is $\sin 1^\circ=\sin\frac{\pi}{180}$. Of course, you are trying to estimate $\sin\frac{\pi}{180}$, so you don't yet have an exact value for this that you can plug in. But you can use this to iteratively get a better bound for the error: once you have one bound for the error by saying $|\sin(z)|\leq 1$, you can then plug in the bound on $\sin \frac{\pi}{180}$ you got as a new bound on $|\sin z|$ to get a better estimate of the error.

• So, then, would the upper bound be |$-\frac{1}{2}(\frac{\pi}{180})\sin\frac{\pi}{180}$|? – A. Lieber Jun 7 '18 at 1:24
• Yes, modulo some obvious typos you seem to have. – Eric Wofsey Jun 7 '18 at 1:31
• Ah. I see now. Thank you, Eric Wolfsey! – A. Lieber Jun 7 '18 at 1:31
• Follow up question, why is it obligatory to use |$R_2(x)$| when calculating the error here (i.e. abs[$\frac{1}{3!}(-\cos{\frac{\pi}{180}})(\frac{\pi}{180})^3$)]$\approx 8.86 \cdot 10^{-7}$? I was told above that since "sine is an odd function, the Taylor polynomial of degree 1 at 0 is in fact the polynomial of degree 2". Is it just customary to always use the highest possible degree? – A. Lieber Jun 7 '18 at 1:38
• You might as well use the highest possible degree, since it will give a better bound on the error. – Eric Wofsey Jun 7 '18 at 2:02