1

I have this problem I know I need to approximate the value with taylor polynomial and its error formula is $$|R_n(x)|\leq \frac{1}{(n+1)!}|x-a|^{n+1}$$ but i couldnt figured it out i should calculate up to which degree. Should I use radians? Can anyone help me about that

  • 1
    Is $43$ degrees or radians? I would guess degrees, but radians is standard. If degrees, you know the value and all the derivatives at $a=45^\circ$, so that is a good place to start. To find the degree, you need to make the right hand side smaller than the requirement. Note that $x-a$ should be expressed in radians, so will be rather small. It won't take a very high degree. – Ross Millikan Jun 25 '20 at 23:15
  • so i need to take $a=\pi/4$ am i right – Sameen Shaw Jun 25 '20 at 23:19
  • but how can i bound the error? it is not a good bound i think – Sameen Shaw Jun 25 '20 at 23:21
  • I wish but i still have trouble with this – Sameen Shaw Jun 25 '20 at 23:24
  • You know what $x-a$ is. Just compute the right hand side for various $n$ until it falls below $8/60000$. I find even without the $(n+1)!$ factor $n=2$ is good enough. There should be a factor of one of the derivatives of $f$, but they are bounded by $1$ here so you can ignore it. – Ross Millikan Jun 25 '20 at 23:28
  • I'm sorry but I am confused, how can $n=2$ give me something like $8/60000$ – Sameen Shaw Jun 25 '20 at 23:34
  • 1
    $x-a=\frac \pi{90} \approx \frac 1{30}$, so $(x-a)^3 \approx \frac 1{27000}\lt \frac 8{60000}$ – Ross Millikan Jun 26 '20 at 00:05

1 Answers1

2

Too complex for sure but interesting problem.

Making the problem more general, since by Taylor we have $$\cos \left(\frac{\pi }{4}-x\right)=\sum_{n=0}^p (-1)^n \frac{\cos \left(n\frac{\pi }{2}+\frac{\pi }{4}\right)}{n!} x^n+\sum_{n=p+1}^\infty (-1)^n \frac{\cos \left(n\frac{\pi }{2}+\frac{\pi }{4}\right)}{n!} x^n$$ $$|R_p|=\frac 1 {\sqrt 2} \frac{x^{p+1}}{(p+1)!}$$ and you want to know $p$ such that $|R_p|\leq \epsilon$.

This write $$(p+1) ! > \frac {x^{p+1}} {\epsilon\sqrt 2}$$ If you look at this question of mine, you will see a magnificent approximation provided by @robjohn. Adapted to your problem, this will give $$p=e x \exp\Big[W\left(-\frac{\log \left(4 \pi x \epsilon ^2\right)}{2 e x}\right) \Big] -\frac 32$$ where appears Lambert function. For sure, you will need to take $\lceil p\rceil$.

Appled to your case, this would give $p=1.267$ then $p=2$. Checking for $x=\frac \pi {90}$ $$|R_2|=\frac{\pi ^3}{64 \sqrt{2}}\approx \frac{\pi ^3}{4374000 \sqrt{2}}\approx 5.0 \times 10^{-6} < \frac 8 {60000}$$ while $$|R_1|=\frac{\pi ^2}{16200 \sqrt{2}}\approx 4.3 \times 10^{-4} > \frac 8 {60000}$$

Just to show the quality of the approximation, the exact solution for your numbers would be $p=1.271$.

Doing the same for a value of $\epsilon$ $1000$ times smaller, would give $p=2.282$ then $p=3$.