0

The question was to find the minimum order of the Taylor polynomial centered at $0$ for $\cos x$ required to approximate $ \cos(-0.25)$ with an absolute error no greater than $10^{-3} $​?

The answer that I provided was: $n$th derivative of $\cos x$ is $$ f^{(n+1)}=\cos\left(x+\frac{1}{2}(n+1)\pi\right)$$ Since $\cos(x)<1$ for whatever value of $x$ then: $$ \vert {f^{(n+1)}}\vert<M$$ then $ M=1$ $$ R_n(x)<M\frac{x^{n+1}}{{(n+1)!}}$$ $$ R_n(x)=\frac{(-0.25)^{n+1}}{{(n+1)!}}<10^{-3}$$ then $n=3$. I found the value of $n$ by using the calculator. But I don't know how I would find it differently using the graph, for example or by solving the inequality.

RobPratt
  • 45,619
Kasiopea
  • 109

2 Answers2

1

Consider the usual Taylor expansion of the cosine close to the origin, $$ \cos(x) = 1 -\frac{x^2}{2!} +\frac{x^4}{4!} - \frac{x^6}{6!} +... $$ Now, $\cos(-0.25) = \cos(0.25) \approx 0.9689 $. Inserting $0.25$ into the series, truncated at $O(x^3)$ gives $ 1 -\frac{0.25^2}{2!} = 0.96875$. Since $|\cos(0.25) - 0.96875| <10^{-3} $ the answer is that an expansion to the second order is enough.

Alternatively, you have to find the smallest $k = 0, 2, 4, 6...$ such that $$ \frac{(0.25)^{k}}{k!} =\frac{1}{4^k k!} = \frac{1}{2^{2k} k!} < 10^{-3} = \frac{1}{2^3 5^3} $$ This is equivalent to $$ 2^{2k-3} k! > 5^3 $$ This is obviously satisfied for $k\geq 6$, so you just have to check $k=2$ (the inequality is not satisfied) and $k=4$ (the inequality is satisfied). However, this does not tell you that stopping at $k=2$ is sufficient (like the direct check), but only that stopping at $k=4$ is sufficient (but not necessary, since it is an alternating series).

Quillo
  • 2,083
0

Making the problem more general, you want to know the value of $n$ such that $$\frac{x^{n+1}}{{(n+1)!}} \leq 10^{-k}$$ that is to say $$(n+1)! \geq x^{n+1}\,10^k$$

If you look at this question of mine, you will see a magnificent approximation made by @robjohn, an eminent user on this site. Applied to your case, this will give $$n\sim e\, x\,\exp\Big[W\left(\frac{2k \log (10)-\log (2 \pi x)}{2 e x}\right)\Big]-\frac 32$$ where appears Lambert function.

Using for your example $k=3$ and $x=\frac 14$ this would give, as a real, $n=2.3517$ so $n=3$. Checking $$\frac {(0.25)^4} {4!}=\frac{1}{6144}=1.63 \times 10^{-4} < 10^{-3}$$ while $$\frac {(0.25)^3} {3!}=\frac{1}{384}=2.60 \times 10^{-3} > 10^{-3}$$