Differentiate a recurrence relation

1.6k Views Asked by At

How do I calculate the derivative of an equation like:

$z_n = (z_{n-1} + c)^2$ with respect to $n$

where $z_0 = 0$ and $z,c \in \mathbb{C}$

I suspect that, for a given $z$, the derivative is not simply $z + c$.

Any advice appreciated.

3

There are 3 best solutions below

0
On BEST ANSWER

This is not differentiable in the usual sense, because it's not a continuous function. You can find the "difference derivative" - in fact there are many difference derivatives:

  1. Forward difference: $\Delta z_n = z_{n + 1} - z_n$, or $\Delta_k z_n = \dfrac{z_{n + k} - z_n}{k}$
  2. Backward difference: $\nabla z_n = z_n - z_{n-1}$ or $\nabla_k z_n = \dfrac{z_n - z_{n-k}}{k}$
  3. Central difference: $\delta z_n = \dfrac{z_{n+1} - z_{n - 1}}{2}$.

Notice that all the definitions are analogous to that of the classical derivative. In each case, you are calculating $\dfrac{\delta z}{\delta n}$, with the difference defined in various manners. In the classical case, you have a continuous variable $x$ instead of the discrete variable $n$, and the derivative is defined as the limit of $\dfrac{\delta z}{\delta x}$ as $\delta x \to 0$.

Now here, you have $z_n = (z_{n-1} + c)^2$. So for example: \begin{align} \Delta z_n & = z_{n + 1} - z_n\\ & = (z_n + c)^2 - (z_{n-1} + c)^2\\ & = (z_n - z_{n-1})(z_n + z_{n-1} + 2c) \end{align}

Now, as you have $z \in \mathbb{C}$, if you wish to study complex functions of the more general form $z_{m,n}$ with $m, n \in \mathbb{N}$, you might also want to look into discrete analytic functions, the discrete analogue (ha, discrete analogue!) of the analytic (or more correctly, holomorphic) functions of classical complex analysis. These are also called monodiffric functions. Actually the more common notation for a function, in this case, would be $f(z)$ with $z = m + in \in \mathbb{Z} + i\mathbb{Z}$ (the set of Gaussian integers). You will find several different definitions of the discrete "derivative", in this field, each with a slew of results associated with them (analogues of results in classical complex analysis).

3
On

You can't compute the derivative of a function defined by a recurrence relation like the one you gave. This is essentially because differentiable functions need to be defined on intervals (like the set of numbers between $0$ and $1$) but your function is defined on a discrete set of points, the natural numbers.

Instead, you may want to look into the "discrete derivative", which is defined to be $z_n-z_{n-1}$. The discrete derivative of your sequence probably does not have a simple form.

0
On

As stated by others the function is not continuous, however if using it as it would be for the associated Mandelbrot or Julia fractals, i.e. if iterating yourself, then one can obtain the numerical value of the analytical derivative for any given n (providing you don't get overflow of the iterated value or derivative) by using the chain rule:

For a Mandelbrot:

complex z = 0.0

complex c = pixel

complex dz = 0.0

float dc = 1.0

For a Julia:

complex z = pixel

complex c = seedvalue

complex dz = power*z^(power-1)

float dc = 0.0

Then:

int n = 0

repeat:

z = z^power + c

dz = power*dz*z^(power-1) + dc

until (n=n+1)==maxiter || |z|>bailout

Here dz is the derivative for the nth iteration and if bailout occurs it can be used in the standard Distance Estimation formula for colouring the fractal or for Ray-stepping in the case of 3D+ fractals such as quaternions or bicomplex fractals or indeed the triplex math that gives the Mandelbulb.

Guess what the derivative set looks like ;) (i.e. if you bailout using dz instead of z)