Can anyone help me in this: I'm trying to find the derivative with respect to $x$, where $x$ is real, for the following function $\log\left|1-\frac{x}{w}\right|$ where $w$ is a nonreal number (complex number)?
Derivative of $\log|...|$
2 Answers
Let $w=u+\imath\ v$, with $v\neq 0$.
Note that your $\log$ is the usual real logarithm, for its argument is a positive real number. Hence, all you have to do is to compute the derivative (w.r.t. $x$ of course) of the real function: $f(x):=\log \sqrt{\frac{(u-x)^2+v^2}{u^2+v^2}} =\frac{1}{2}\ \log \Big( (u-x)^2+v^2\Big) - \frac{1}{2}\ \log \Big( u^2+v^2\Big)\; ,$ which can be done using the usual chain rule.
Note that $\left| 1 - \frac{x}{w} \right| = \sqrt{ \left(1- \frac{x}{w} \right) \left(1- \frac{x}{w^*} \right) }.$ Thus, we have (as we take the derivative later, we do not have to worry about the branches) $\log \left| 1 - \frac{x}{w} \right| = \frac12 \left[ \log\left(1- \frac{x}{w} \right) + \log\left(1- \frac{x}{w^*} \right) \right]. $
Thus, the derivative is given by $ \frac{d}{dx}\log \left| 1 - \frac{x}{w} \right| = \frac{1}{2} \left[ \frac{w}{w-x} + \frac{w^*}{w^*-x} \right] = \frac{ \mathop{\rm Re} (w) \,x - |w|^2}{ |w-x|^2}.$