3

Out of curiosity, I tried to solve the eqation

$$x = \tan x$$

but it was harder than I first thought. Eventually I built an algrothim to solve this eqution using the bisection method. But, is there any way to arrive to an exact solutions?

I tried using taylor series of both $\frac{\sin(x)}{\cos(x)}$ and $\tan(x)$, but in both cases, excpet for $x = 0$, all the solutions were complex (I only try to find real solutions), and every time I tried to use euler's formula, I reached a dead end.

  • This can be solved in terms of the generalized Lambert function, which is the (multi-valued) inverse of $\frac{x-a}{x-b}e^x$, but only if you are willing to deal with complex numbers and multi-valued functions. – Conifold Jan 24 '20 at 22:47
  • @Ofek Are you looking for a numerical (i.e., $x=4.493\ldots$) or an analytic (i.e., $x=\cos(\sin(\ldots))$) solution? Different methods are appropriate in each case. – Jam Jan 24 '20 at 23:09
  • @Jam analytic solutions. I used the bisection method (after multiplying by cos(x)) to find numerical solutions and it worked just fine. – Ofek Tevet Jan 25 '20 at 15:14

2 Answers2

2

Despite lacking exact analytic solutions, a simple and fairly accurate close-form approximation is known,

$$x_k = \frac{(1+2n)\pi}2 - \frac2{(1+2n)\pi}$$

with $n=1,2,3\>...$ for all positive roots and $-x_n$ For all negative roots. Here are the first few with their exact values in parentheses: $x_1$ = 4.500 (4.493), $x_2$ = 7.727 (7.725), $x_3$ = 10.904 (10.904) ...


Edit: Derivation of the close-from solutions.

Note that all roots are near $r_n= \frac\pi2+n\pi$. So express $\tan x = \cot(r_n-x)$ and rewrite the equation $x=\tan x$ as

$$f(x)=\cot^{-1}x+x-r_n=0$$

Apply the first-order approximation around $r_n$ to get

$$x_n=r_n-\frac{f(r_n)}{f'(r_n)}=r_n - \frac{\cot^{-1}r_n}{-\frac1{1+r_n^2}+1} =r_n - \frac{1+r_n^2}{r_n^2}\>\tan^{-1}\frac1{r_n}$$

Recognize that $ \tan^{-1}\frac1{r_n} = \frac1{r_n}+ O(\frac1{r_n^3})$ and ignore the high-order terms to obtain the analytical solutions given above

$$x_n = r_n - \frac1{r_n}$$

Quanto
  • 97,352
  • Okay I tried the approximation, it works for a few digits, but I wonder, but how do we now that this approximation is correct? and how it was discovered? someone was just bored and tried it? or is there a reason behind the accuracy of this approximation? – Ofek Tevet Jan 25 '20 at 15:03
  • @Ofek Tevet - the close-form can be analytically derived, as shown in the added edit in the answer. – Quanto Jan 25 '20 at 20:43
0

To get rid of the discontinuities, it looks better to look for the zero's of function $$f(x)=\sin(x)-x\cos(x)$$ Expand as Taylor series around $x_0=\frac{(2k+1)\pi}2 $ and use series reversion to get $$x_k=q-\sum_{i=1}^n \frac {a_i}{q^{2i-1}}\qquad \text{where} \qquad q=\frac{(2k+1)\pi}2$$where the $a_i$ are the sequence $$\left\{1,\frac{2}{3},\frac{13}{15},\frac{146}{105},\frac{781}{315},\frac{16328}{346 5},\frac{6316012}{675675},\frac{38759594}{2027025},\frac{9655714457}{241215975}, \frac{50134571594}{587577375},\cdots\right\}$$