If we want to expand $f(x)=\sin x$ with Taylor polynomial centered at $x=0$. and error of that for$x=\frac{\pi}{2}$ be at most $10^{-6}$. then what order of polynomial should be at? ($n=?$)
As a hint our lecturer said we should use $c=\frac{\pi}{2}$ at formula of remainder of Taylor series.
Here is my work:
The reminder of Taylor series for the function $f(x)$ where $x_0=0$ is :
$$R_n(x)=\cfrac{f^{(n+1)}(c)}{(n+1)!}x^{n+1}$$
And I estimate $\frac{\pi}{2}$ to closest integer which is $2$ for the value of $x$.
To find $n$ I should solve inequality:
$$|R_n(x)|\le 10^{-6}\quad\rightarrow\quad|\cfrac{f^{(n+1)}(\frac{\pi}{2})}{(n+1)!}\times2^{n+1}|\le 10^{-6}$$
$(n+1)$'st derivative of $f(x)=\sin x$ can be one of the $\pm\sin x$ ,$\pm\cos x$. So $|f^{(n+1)}(\frac{\pi}{2})|\in\{0,1\}$. If it is equal to zero then we have $0\le 10^{-6}$ and it is absolutely wrong so the best I can do is using $|f^{(n+1)}(\frac{\pi}{2})|=1$. hence the inequality is $\left|\cfrac{2^{n+1}}{(n+1)!}\right|\le 10^{-6}$ . After plugging in some $n$s I got $n\ge13$. so the order of the Taylor polynomial should be $13$.
Is my approach right ? as you can see in my answer I had some difficulties to find $|f^{(n+1)}(\frac{\pi}{2})|$ did I right at this point?