# Partial differentiation of the absolute value of a function containing complex coefficients.

I have a function, $H$, which is a dependent on a number of parameters, $\theta_{i=1,\ldots,n}$ and a number of complex coefficients. The function hence gives a complex quantity. $H$ is relatively simple to differentiate w.r.t $\theta_i$.

What I am interested in finding is,

$$\sum_i \left| \frac{\partial|H|}{\partial \theta_i} \right|^2$$

Here is where I am unsure of myself: Because H is a function of theta

$$\frac{\partial|H|}{\partial \theta_i} = \frac{\partial|H|}{\partial H}\frac{\partial H}{\partial \theta_i}$$

My question is: How do I calculate the differential of $|H|$ w.r.t $H$, given that H is complex (I think that this differential is undefined everywhere except zero?)

Is there another way of expanding this in a form where I can calculate the differential.

Note: although I can calculate dH/dtheta, it is difficult to directly calculate d(abs(H))/dtheta.

Edit

If you will indulge me for one more question,

Am I right in saying:

$$\frac{\partial H_R}{\partial \theta_i} = 0.5 \left(\frac{\partial H}{\partial \theta_i} + \frac{\partial \overline{H}}{\partial \theta_i} \right)$$

So that I can use the partial differentials I have already calculated?

For a complex function $f(H)$, its derivative is defined as

$$f'(H)=\lim_{\Delta H\to 0}\frac{f(H+\Delta H)-f(H)}{\Delta H}$$

if the limit exists.

If $f(H)=|H|$, we have

\begin{align} f'(H)&=\lim_{\Delta H\to 0}\frac{|H+\Delta H|-|H|}{\Delta H}\\\\ &=\lim_{\Delta H\to 0}\frac{H \Delta \bar H+\bar H \Delta H+|\Delta H|^2}{\Delta H \left(|H+\Delta H|+|H|\right)}\\\\ \end{align}

which exists nowhere.

Therefore, we conclude that the function $|H|$ is nowhere differentiable.

Now, suppose that $H$ is a complex function of real variables, $\theta_i$, $i=1,\cdots,n$. Then, we can write

$$H(\vec \theta)=H_R(\vec \theta)+H_I(\vec \theta)$$

where $H_R$ and $H_I$ represent the real and imaginary parts of $H$, respectively. We can find the partial derivatives of $|H|$ as

\begin{align} \frac{\partial |H(\vec \theta)|}{\partial \theta_i}&=\frac{\partial \sqrt{H_R^2(\vec \theta)+H_I^2(\vec \theta)}}{\partial \theta_i}\\\\ &=\frac{H_R(\vec \theta)\frac{\partial H_R(\vec \theta)}{\partial \theta_i}+H_I(\vec \theta)\frac{\partial H_I(\vec \theta)}{\partial \theta_i}}{\sqrt{H_R^2(\vec \theta)+H_I^2(\vec \theta)}}\\\\ &=\frac{H_R(\vec \theta)}{|H(\vec \theta)|}\frac{\partial H_R(\vec \theta)}{\partial \theta_i}+\frac{H_I(\vec \theta)}{|H(\vec \theta)|}\frac{\partial H_I(\vec \theta)}{\partial \theta_i} \end{align}

• If you could address my edit I would be very great-full. – Will Sep 28 '15 at 10:34
• @will Yes. We can write $H_R=(H+\bar H)/2$ and proceed. Well done. – Mark Viola Sep 28 '15 at 13:50
• Thanks for your help. It is much appreciated! – Will Sep 28 '15 at 14:58
• You're welcome! My pleasure. – Mark Viola Sep 28 '15 at 14:59