2
$\begingroup$

I'm looking to bound the error for the Taylor series of $\tan(x)$ so that I will know how many terms I need to go out to get a desired precision. I've already searched and came across this, but the bound provided in that answer doesn't make much sense.

In particular, for $f(x):=\tan(x)$, I want to first expand around $x=0$ then approximate $\tan(1)$ to a precision of $N$ digits (note that $\tan$ is analytic for $x\in (-\pi/2,\pi/2)$). After using the Lagrange error bound from elementary calculus I have $$R_n=\frac{f^{(n+1)}(c)}{(n+1)!}(1-0)^{n+1}$$ for $c\in (0,1)$. We want $|R_n|\leq 10^{-N}$. The problem is that I can't find a good way to bound the term $f^{(n+1)}(c)$, as higher-order derivatives of $\tan$ are polynomials in $\tan(x)$ and have a very nasty closed form.

The first answer in the link I referred to had some $\frac{c}{(n+1)!}$ bound on it, but because of the way $c$ is defined, after using Mathematica I see that $\frac{c}{(n+1)!}\rightarrow \infty$ for $n\rightarrow \infty$, which doesn't make sense since increasing the number of terms should decrease the error.

In the above, $R_n\rightarrow \infty$ as $n\rightarrow \infty$ as well. I'm not sure if I'm just overlooking something--am I just doing something wrong? Could anybody give me any suggestions?

This is on a complex analysis assignment by the way, but it seems that complex-analytic methods aren't required here.

  • 1
    Doing `Limit[c/(n + 1)!, n -> Infinity, Assumptions -> 0 < c < 1]` _MMA_ provides the right answer.2012-10-03
  • 0
    The problem is that $c$ is not a constant, but an expression that depends on $n$: in the other thread, $c=(\pi/4)^{n+1}tan^{(n+1)}(\pi/4)$. Edit: sorry for the notation abuse, but the $c\in (0,1)$ above is not the same as the $c$ referred to in the other thread.2012-10-03
  • 0
    That doesn't make sence at all. $\frac{\pi}{4} < 1$ and $\tan(\frac{\pi}{4}) = 1$, so $c_{n+1}. Still, `Limit[(\[Pi]/4)^(n + 1) Tan[\[Pi]/4]^(n + 1)/(n + 1)!, n -> Infinity]` gives the correct answer in MMA 8.2012-10-03
  • 0
    $\tan^{(n+1)}$ denotes the $n+1$-st derivative, and not power, of $\tan$...2012-10-03

1 Answers 1