Pictures of Julia and Mandelbrot Sets/The Mandelbrot set

In appearance a Julia set can go from one extreme to the other. And if we have a family of functions containing a complex parameter "c", we will observe that by far the majority of "c"-values the Julia set is completely without interest. In fact, the attractive Julia sets are extremely rare.
And these Julia sets are just found by considering a family of iterations and from this constructing a set in the plane that can serve as an atlas of the Julia sets, in the sense that if we find an interesting locality in this set, we can be certain that some part of the pattern at this place will be reflected in the (self-similar) structure of the Julia sets associated to the points here. Such a set is called a "Mandelbrot set".
Therefore, if we have a function formula_1, we introduce a complex parameter "c" in it, usually by addition: formula_2.
Construction of the Mandelbrot set.
The construction of the Mandelbrot set is based on the choice of two critical points formula_3 and formula_4 for the function formula_1: The Mandelbrot set (associated to the family formula_2 and the critical points formula_3 and formula_4) consists of the complex numbers "c", such that the sequences of iteration (by formula_2) starting in formula_3 and formula_4, respectively, do not have the same terminus. This set is usually coloured black.
Colouring the domain outside the Mandelbrot set.
That a point "c" is lying outside the Mandelbrot set, means that the second critical point formula_4 is lying in the same Fatou domain (for the iteration formula_2) as the first critical point formula_3, and we can give "c" the colour of the point formula_4 in this Fatou domain.
In order to draw the Mandelbrot set and colour the domain outside it, we must have chosen a maximum iteration number M, a very small number formula_16 (for iteration towards a finite cycle) and a very large number N (for iteration towards ∞).
If formula_3 = ∞ (and "d ≥ 2", so that ∞ is a critical point and a (super-attracting) fixed point) we need of course not iterate formula_3: we iterate formula_4 (by formula_2) and if formula_21 &gt; N for some iteration number "k" &lt; M, then "c" is lying outside the Mandelbrot set, and we colour "c" in the same way as we have coloured a "z" in a Fatou domain containing ∞. If we have reached the maximum iteration number M, we regard "c" as belonging to the Mandelbrot set.
If formula_3 is a finite critical point and if the iteration of formula_3 (by formula_2) is running to the maximum number of iterations M is reached, the terminus is most probably a finite attracting cycle that is not super-attracting (if not, there can be a fault in the colour of the pixel, but this is without significance in practice). If the last point of this iteration is "z*", "z*" belongs to the cycle, but we must know the order and the attraction of the cycle. Therefore we continue the iteration: starting in "z*" and running until formula_25, then the number of iterations needed for this is the order "r" of the cycle, and we calculate the attraction formula_26 in the same way as before: 1/formula_26 is the product of the numbers formula_28 for the "r" points of the cycle. We hereafter iterate formula_4 (by formula_2), and stop when formula_25. If this iteration runs until the maximum number of iterations M is reached, we regard "c" as belonging to the Mandelbrot set. If formula_25 for "k" &lt; M, we colour "c" according to "k", or rather, the corresponding real iteration number, which is found in the same way as for a Fatou domain, by dividing "k" by "r" (and taking the integral part) and from this number subtract formula_33.
If the cycle contains ∞, that is, if the iteration of formula_3 is stopped by formula_21 &gt; N for "k" &lt; M, we let ∞ be the chosen point of the cycle, and we continue the iteration until we again have formula_21 &gt; N, then the number of iterations needed to do this is the order of the cycle. We then iterate formula_4 (by formula_2), and stop when formula_21 &gt; N. If this iteration runs until the maximum number of iterations M is reached, we regard "c" as belonging to the Mandelbrot set. If formula_21 &gt; N for "k" &lt; M, we colour "c" according to "k", or rather, the corresponding real iteration number, which is found in the same way as for a Fatou domain, by dividing "k" by "r" (and taking the integral part) and from this number subtract formula_41.
Colouring the boundary of the Mandelbrot set.
That a point "c" is lying outside the Mandelbrot set, means that the second critical point formula_4 is lying in the same Fatou domain (for the iteration formula_2) as the first critical point formula_3, and the estimation of the distance from formula_4 to the Julia set, in this Fatou domain, is an estimation of the distance from "c" to the boundary of the Mandelbrot set. So, the boundary of the Mandelbrot set can be coloured in the same way as a Julia set, but now the derivative of formula_46 is not with respect to "z", but with respect to "c". 
If we set formula_47, we have formula_48 (the k-fold composition)(the start value z is first formula_3 and then formula_4), and we find the derivative formula_51 of formula_46 with respect to "c" by recursion: we have formula_53, and we find formula_51 successively by performing this calculation for each iteration, starting with formula_55 = 0, together with (and "before") the calculation of the next iteration value formula_56, starting with "z" = formula_3 and formula_4, respectively.
As well as finding the point "z*" in the cycle by iterating formula_3 M times, we now also calculate the derivative "z*"' of "z*" with respect to "c", and when iterating formula_4 towards the cycle, we now also calculate the derivative formula_51 of formula_46 with respect to "c". The formulas for formula_63 are for the two cases:
When the value of this number for the last iteration number is smaller than a given small number, we colour the point "c" dark-blue, for instance.
Why the Mandelbrot set serves as an atlas of the Julia sets.
If we choose a point "c" near the boundary of the Mandelbrot set, then the Julia set for formula_2 will have a (self-similar) structure that has some features in common with the Mandelbrot set at that locality. In the simple case formula_69 (the usual Mandelbrot set), the structure of the Julia set for "c" is exactly the same as the local structure of the Mandelbrot at "c", but this is usually not the case for general rational functions, only that the structure of the Julia set reflects the local structure of the Mandelbrot set.
Why is this? When "c" is inside the Mandelbrot set, the sequence generated by formula_4 does not converge to the terminus of the sequence generated by formula_3, and this means that the two Fatou domains containing formula_3 and formula_4, respectively, are different. But when we let "c" pass over the boundary of the Mandelbrot set, the two sequences now have the same terminus, so that the two Fatou domains become identical. Because one of the Fatou domains has now disappeared, we can infer that the Julia set for formula_2 must change in a significant way (it becomes less connected).
It is only when "c" is near the boundary of the Mandelbrot set that we can predict something about the Julia set, but as there usually are several critical points, we can choose another pair and draw a new Mandelbrot set. Note that if we use two finite critical points and if we invert these, then the black is unaltered, but the colouring and the boundary can alter: the colour is determined by the value in formula_4 of the potential function of the Fatou domain for "c" containing formula_3. In order to get the most aesthetic colouring, we must use the value of the potential function in one and the same point (the second critical point) as "c" varies. When "c" passes the boundary of the Mandelbrot set, a Fatou domain disappears, but it is only when the second critical point leaves the Fatou domain, that we get the natural colouring and the boundary. 
The usual Mandelbrot set.
For the family formula_69, there are two critical points, 0 and ∞, and therefore only one Mandelbrot set. This set consists of the points "c" such that the sequence generated by 0 (by formula_78) remains bounded. For "c" outside the Mandelbrot set the sequence converges to ∞, and we can colour according to the number of iterations needed to bring the points outside a large circle with centre in origo. If we only colour according to the iteration number and if we do not draw the boundary, this circle needs only to have radius 2.
For this family, the Julia set for "c" has two Fatou domains when "c" is inside the Mandelbrot set, and one when "c" is outside. When "c" is inside the Mandelbrot set, the Julia set is connected, and when "c" is outside, the Julia set is disconnected (and more than that: totally disconnected - a dust cloud - because of the self-similarity). For "c" belonging to the boundary, the Julia set is connected, but it does not enclose an interior Fatou domain (this can be regarded as degenerated): the Julia set is just a fractal line with a "nose" and a "tail" and a "spine" connecting these two points.
The usual Mandelbrot set consists of an infinite system of cardioids and circles, all lying outside each other and some touching. When we zoom in, we find a swarm of "mini-mandelbrots". Such mini-mandelbrots (possibly deformed) appear in the Mandelbrot set for every complex (differentiable) function, even for transcendental functions (see the picture in the section ../Julia and Mandelbrot sets for transcendental functions/).
The different types of Mandelbrot and Julia sets.
Of all Mandelbrot sets the usual is the one that possesses most localities of beauty. All other Mandelbrot sets are more or less ugly in their entirety, especially when the function is not a polynomial. In return, it is in such Mandelbrot sets that we can be lucky enough to find the most interesting and original shapes.
When we draw the Mandelbrot set for different rational functions, of course some types of shape will recur, and it should be possible to classify these shapes. We cannot refer the any work in this direction, we can only state the most elementary differentiation:
1. d &gt; 1 (m &gt; n + 1). Then ∞ is a critical point and a super-attracting fixed point, and we usually use this as the first of the two critical points. For formula_79 (and critical point 0), we can find this motif in the Mandelbrot set (first picture):
2. d = 1 (m = n + 1). In this case formula_1 is usually constructed from the Newton procedure for solving an equation formula_81: formula_82. The critical points are just the solutions to formula_81, and we choose two having the largest distance from each other. For formula_84 and thus formula_85, we can find this motif in the Mandelbrot set (second picture):
3. d &lt; 1 (m &lt; n + 1). In this case we usually use two finite critical points, and as the critical points are lying symmetrically around the x-axis (if formula_1 has real coefficients), we let the pair consist of conjugate numbers (of largest distance). We let the family be formula_87, and we zoom in at the place where the most interesting things seem to be (third picture). We choose three points on the boundary and draw their Julia sets. First a point on the thin tangent line passing through the sea horse valley. Then a point in one of the holes inside the upper black. The last point presupposes that we invert the critical points, so that we can see a part of the boundary that is not visible on this picture of the Mandelbrot set. This boundary forms a continuation downwards of the indicated vertical line in the centre.
The parameter "c".
In order to get a "family" of iterations from the rational function "f(z)", we have here simply added the parameter "c" to "f(z)", so that the family is "z → f(z) + c". This way is the simplest, and as we can get every Julia set in this way and as a Mandelbrot set locally is like a Julia set and as the type of the Mandelbrot sets constructed from families of the form "z → f(z) + c" is satisfying in every way, there is no strong reason for letting "c" enter in a more sophisticated way. But we can find interesting Mandelbrot sets by letting "c" enter in a specific way. We can transform the Mandelbrot set by replacing the family by "z" → formula_88, for some functions formula_89 and formula_90, and we can construct Mandelbrot sets whose form in their entirety differ from those of the usual type by letting "c" appear in the coefficients of the rational function "f(z)".
Now the family is of the form "z → g(z, c)", and we assume that "g(z, c)" is rational in both "z" and "c". The critical points can now depend on "c" (we denote the two chosen formula_91 and formula_92, and in order to draw the boundary we must (besides formula_93) calculate the derivative of "g(z, c)" with respect to "c": "(d/dc)g(z, c)" (= formula_94 - see the section ../Terminology/). And we must also calculate the derivative with respect to "c" of the critical points formula_91 and formula_96: formula_97. The iteration is given by formula_98 (starting in formula_91 and formula_96), and the derivative formula_51 (with respect to "c") is calculated by
starting with formula_103 and formula_104.
We let "f(z)", formula_89 and formula_90 be respectively formula_107, "-iz" and 1, and formula_108, "i(z - 1/z)/√2" and "i(z + 1/z)/√2" (first and second picture below). In the last case the four parts meet in the points "±(√2 ± i√2)/2" which correspond to the points ±"i" belonging to the usual Mandelbrot set.
Let us now assume that "g(z, c)" is the rational function given by Newton iteration for the polynomial formula_109, that is, formula_110. The critical points are the solutions to the equation "g'(z, c) = 0", and as formula_111, the critical points are the roots of "f(z) = 0" (in our case 1 and "±√c") and the roots of formula_112 (in our case 1/3). As a critical point which is a root of "f(z) = 0" is a fixed point for "g(z, c)", the second of the critical points used in the construction of the Mandelbrot set (that is, formula_96) must be one of the roots of formula_114. In our concrete case we construct the Mandelbrot set from only one critical point: formula_115, so that only the boundary of the Mandelbrot set is drawn (third picture).
We have mentioned above that if the terminus of formula_3 is not ∞, then it is most likely a finite attracting cycle that is not super-attracting, and if not, there can be a fault in the colour of the pixel, but this is without significance in practice. However, in our just mentioned case where "g(z, c)" comes from Newton iteration, "all" the iterations (or rather, all the Fatou domains) outside the Mandelbrot set are super-attracting, therefore we must correct the formulas for the real iteration number and for the distance function by introducing log in the formulas.
Drawing Mandelbrot and Julia Sets in Practice.
A Julia set for a rational complex function is so well-defined and natural that, like with some other mathematical concepts, we are inclined to say that it belongs to nature: if they have computers in another world, they will also definitely have Julia sets. Also the definition of a Mandelbrot set is simple and obvious, and the drawing procedure must necessarily be in this way: we enter the coefficients of the two polynomials in some way, and then either some pairs of critical points are found automatically or a pair is chosen graphically by clicking in a picture where all the critical points are shown. Hereafter the Mandelbrot set appears, and we can zoom in and alter the colouring. We go to the Julia sets by pressing a key so that the point in the centre of the window can be moved by the arrows, and when we have chosen a point (usually on the boundary of the Mandelbrot set), the procedure for the Julia set is exactly the same as that for the Mandelbrot set.
When you draw a large picture, you ought to draw it at least twice as large as intended, and then reduce it so that the boundary is no longer only one colour. This will lessen the often sharp character of the boundary and it will remove dots arising from impossible calculations.