I asked this question on MSE  [here][1].




---
I am investigating the number of roots of the equations:
 

$$\tan(z) - z^n = 0$$
$$\sin(z)-z^n=0$$
$$\cos(z)- z^n=0$$



within the vertical strip $|\text{Re}(z)| \leq \frac{\pi}{2}$ for positive integers $n$. Numerical computations suggest interesting behavior:

-----
$$\tan(z)-z^n=0$$
--

 - The equation $\tan(z) - z = 0$ has only the trivial solution $z = 0$.
 - For $n \ge 2$, the number of roots appears to depend on the value of $n$. Plots for some cases are shown below:




 $\tan(z)-z$:
[![\tan(z)-z:][2]][2]

 $\tan(z)-z^2$ (showing 3 roots):
[![\tan(z)-z^2][3]][3]

$\tan(z)-z^3$ (showing 5 roots):
[![\tan(z)-z^3][4]][4]

$\tan(z)-z^4$ (showing 5 roots):
[![\tan(z)-z^4 ][5]][5]

$\tan(z)-z^5$ (showing 5 roots):
[![enter image description here][6]][6]

$\tan(z)-z^{11}$ (showing 11 roots):
[![enter image description here][7]][7]

$\tan(z)-z^{12}$ (showing 12 roots):
[![\tan(z)-z^{12}][8]][8]


----
I used this python code: 

```python

import cplot
import numpy as np
print("enter  n  ")
n= int(input())

def f(z):
    res =np.tan(z)-z**n
    return res

plt = cplot.plot(f, (-1.6, +1.6, 1000), (-1.6, +1.6, 1000))
plt.show()
```






Define $t_n$ to be the number of roots that $\tan(z)-z^n$ have for $n \in \mathbb{N}$, $\frac{-\pi}{2}\le \Re(z)\le \frac{\pi}{2}$

The first few values are 

| $n    $  | $t_n$          |
| -------- | -------------- |
| 1        | 1              |
| 2        | 3              |
| 3        | 5             |
| 4        | 5              |
| 5        | 5              |
| 6        | 6              |
| 7        | 7              |
| 8        | 8              |
| 9        | 9              |
| 10       | 10             |
| 11       | 11             |
| 12       | 12             |
| 13       | 13             |
| 14       | 14             |
| 15       | 15             |

$1,3,5,5,5,6,7,8,9,10,11,12,13,14,15,16$, it seems that for $n\ge5, \ a_n=n$ but I couldn't explain this behaviour or if it is true for all $n\ge5$.    



----



 In contrast to $\tan(z) - z^n$, the equations $\sin(z) - z^n = 0$ and $\cos(z) - z^n = 0$ **always** have exactly $n$ roots in the strip $|\text{Re}(z)| \leq \frac{\pi}{2}$. 
Also the equations $\cot(z) - z^n = 0$ and $\csc(z) - z^n = 0$ **always** have exactly $n+1$ roots in the strip $|\text{Re}(z)| \leq \frac{\pi}{2}$, **However** the equations $\sec(z) - z^n = 0$ is like the equation  $\tan(z)-z^n$  i.e (have   $n$ roots in the strip $|\text{Re}(z)| \leq \frac{\pi}{2}$ for $ n \ge 5$) .


How to explain this behavior?

 


  [1]: https://math.stackexchange.com/questions/4951421/how-many-roots-does-tanz-zn-have-for-n-in-mathbbn-frac-pi2-l
  [2]: https://i.sstatic.net/AJ2zBBp8.png
  [3]: https://i.sstatic.net/jyAyRMMF.png
  [4]: https://i.sstatic.net/r9auRbkZ.png
  [5]: https://i.sstatic.net/HlsgbROy.png
  [6]: https://i.sstatic.net/65Uc863B.png
  [7]: https://i.sstatic.net/JVWZCN2C.png
  [8]: https://i.sstatic.net/rUN8AVLk.png