Why does the Mandelbrot set appear when I use Newton's method to find the inverse of $\tan(z)$
Specifically for the equation $y = \tan(z)$ I use Newton's method ($20$ iterations) to solve $0 = \tan(y) - z$ for $y$, where $y_0 = \tan(z)$ ($y_0$ doesn't seem that important in this case, both $0$ and $z$ worked The resolution was actually just too low to see any differences in the original image. $y_0 = 0$ produces the best results). I didn't expect this to converge for most $z$, but why are there Mandelbrot set shaped regions that did converge?
Here are the results:
To be a bit more explicit:
$f(y) = \tan(y)-z$, where $z$ is the point on the complex plane I am finding an inverse for in $y = \tan(z)$.
The function I am iterating per newtons method is
$$y_{n+1} = y_n - \frac{f(y_n)}{f'(y_n)} = y_n - (\sin(y_n)\cos(y_n)-z\cos^2(y_n))~~~\text{with}~~~y_0 = 0$$
Here is a clearer picture along with a picture generated with the regular equation for the Mandelbrot set, each with 100 iterations.
The $y_{n+1}$ equation above:
The Mandelbrot set, $y_{n+1} = y_{n}^2 + z$:
Coloring:
For colors I take the result of each recursion, $y_{100}$, and convert to HSV colors as $H=-\arg(y_{100})+\pi$, $S=1$, $V=\frac{1}{\ln(c|y_{100}| +e)}$, which are then converted to RGB. $c$ was some constant, I think $c=0.1$ in the above images.
Essentially this is domain coloring with cyan indicating the positive real axis, red indicating the negative real axis, yellow/green indicating the positive imaginary axis, and purple indicating the negative imaginary axis. Black indicates the number either went to infinity or was indeterminate.
You'll notice that the sign of my recursion seems to have flipped since the first picture. I'm not quite sure what the cause of that is, but distributing the negative sign in my recursion so
$$y_{n+1} = y_n - \sin(y_n)\cos(y_n)+z\cos^2(y_n)$$
seems to resolve the issue.
Regardless, it is clear that that numbers that result from my recursion are large, while the numbers that result from the Mandelbrot recursion are small.
It seems the fractals occur where $z\approx m\pi$, where $m$ is an integer (besides $0$).
I found something else interesting. If you alter the recursion which gives the Mandelbrot set to be $y_{n+1} = y_{n}^2 - m\pi(z-m\pi)$ then the mandelbrot set appears at the exact location as in the other equation, and is the same size! I would really like to know why.
Here is an example
My $y_{n+1}$ equation:
Modified Mandelbrot equation, $y_{n+1} = y_{n}^2 - m\pi(z-m\pi)$, $m=-1$:
Closely zoomed in you can see the shapes of the two fractals are not entirely the same (unless that's a numerical error). Still, the similarity is striking.
On further inspection the Mandelbrot set (or something like it) appears in a lot more places in this fractal than I initially thought. Just zooming around I can see lots of them.
They appear on all the spindles coming off the colorful area around $z=0$ (the center of the original image).
To the upper left of the big orange blob above the set in the previous image:
And you might have seen this in the earlier images, but the sets on the real axis aren't just at $m\pi$. The big one on the left is the one at $-\pi$. The center one is at about $2.12$, but note that there are a lot of smaller ones as you move to the right.
Really it seems like the Mandelbrot-like sets appear for
$$y_{n+1} = y_n - \sin(y_n)\cos^m(y_n)+z^s\cos^t(y_n)$$
Where $m,s,t$ are nonzero integers.