# Get equation for real and complex coordinate of different level Mandelbrot Sets directly?

What I consider one of the most beautiful equations is $z\rightarrow z^2+c$.

If you take a complex plane, and iterate this equation for every complex coordinate $c$, starting with $z=0$ and iterate it $n$ times, it displays a beautiful fractal known as the Mandelbrot Set in the neighborhood of the origin. The more iterations is given, the more detailed and beautiful the picture is.

So in other words, a complex point $z$ is a part of the Mandelbrot Set when it meets the requirement of $|z|<2$.

Programmers who visualize the Mandelbrot Set using this formula have to iterate this equation for individual pixels which are assigned $x$ and $y$ coordinates, where $x$ is the real part, and $y$ is the imaginary part. The equation turns into more complex one:

$$(x+yi)\rightarrow (x+yi)^2+(a+bi)$$

A complex point $(x+yi)$ would be part of the set if it met the requirements $|x+yi|<2$

The only problem is that using the equation like this would require computing solutions to operations performed on imaginary part of complex numbers which would require additional implementation of such functions which would increase the computing power needed for each pixel, and taking much more time to display the Mandelbrot Set, which is unwanted.

So programmers came with a genius cheat for this problem by explicitly iterating the value of $y$ separatly from $x$ rather than iterating them together as a complex number $z$.

Someone have come up that the equation above can be rewritten for getting and iterating $y$ separatly from $x$, which eliminates having to do operations on complex numbers:

$$y\rightarrow 2xy+b$$ $$x\rightarrow x^2-y^2+a$$

The complex point $(x+yi)$ would have to meet the requirements of $|x+yi|<2$ which can be rewritten to eliminate the operations on complex numbers also:

$$|x+yi|<2$$ $${\sqrt{(x+yi)^2}}<{\sqrt{4}}$$ $$(x+yi)^2<4$$ Now since points above the origin of the Mandelbrot set are the mirror image of the points below the origin, $(x+yi)$ is the same thing as $(x-yi)$. $$(x-yi)^2<4$$ $$x^2+y^2(-1)<4$$ $$x^2-y^2<4$$ Now, again negative y is the same as positive y, because it is reflection of each other, so we end with: $$x^2+y^2<4$$

Now we have simplified the iteration and eliminated operations on complex number into two equations and one restriction:

$$y\rightarrow 2xy+b$$ $$x\rightarrow x^2-y^2+a$$ $$x^2+y^2<4$$

Now, what if I want to visualize the Mandelbrot Set for the equation $z\rightarrow z^3+c$ or $z\rightarrow z^6+c$. Then it would be the same thing as $(x+yi)\rightarrow (x+yi)^3+(a+bi)$ and $(x+yi)\rightarrow (x+yi)^6+(a+bi)$.

Let's say I also want to eliminate the operations on complex numbers (eliminate the imaginary unit), and get explicit iterated equations for coordinate elements $x$ and $y$ separatly, and transform the requirement to eliminate the imaginary unit with those equations.

So, what I'm looking for is a generalised formula for the questionmarks:

$$(x+yi)\rightarrow (x+yi)^n+(a+bi)$$ $$y\rightarrow ?$$ $$x\rightarrow ?$$ $$|x+yi|<2 \Longrightarrow ?$$

• Apply the binomial theorem to $(x+iy)^n$ and gather terms using $i^2=-1$, $i^3=-i$, $i^4=1$, ... For example, $(x+iy)^4 = x^4 + 4ix^3y + 6i^2x^2y^2 + 4i^3xy^3 + i^4y^4$ $= (x^4 - 6xy + y^4) + i(4x^3y - 4xy^3)$. Frankly, for large $n$ it would be easier to work directly with complex numbers.
– user856
Nov 25, 2016 at 17:56

The iterated function for a Mandelbrot set of order $n$: $$z\rightarrow z^n+c\;\;\;\Longrightarrow\;\;\; (x+yi)\rightarrow (x+yi)^n+(a+bi)$$
Can be rewritten in the way I described into: $$x\rightarrow \Bigg(\sum_{k=0}^{\lceil{\frac{n-1}{2}}\rceil}(-1)^k{{n}\choose{2k}}x^{n-2k}y^{2k}\Bigg)+a$$ $$y\rightarrow \Bigg(\sum_{k=0}^{\lceil{\frac{n-2}{2}}\rceil}(-1)^k{{n}\choose{2k+1}}x^{n-2k-1}y^{2k+1}\Bigg)+b$$
I don't know if it works for irrational, fractional, complex, or negative numbers $n$ though. I'll have to check.