Suppose we have a function $f(\theta)$ and it is $\mathbb{R} \rightarrow \mathbb{C}$. Consider the square of the absolute value of $f(\theta)$, $$g(\theta) = |f(\theta) |^2$$ Obviously, the function $g(\theta)$ is $\mathbb{R} \rightarrow \mathbb{R}$. What is the first order derivative of $g(\theta) $ over $\theta$? I do not know whether we can express the result by using $f(\theta)$.
By using chain rule, I think the result can be $2 f(\theta) \frac{\partial f(\theta)}{\partial \theta}$. However, I check with $f(\theta) = \exp(j\theta) +1$, it is wrong. Is there anything special about the chain rule for complexity function?