# Differentiating a complex function using the definition

I need to differentiate the complex function $$f(z)=z^2+z$$.

I know that the definition of a derivative is $$f'(z)=\frac{f(z)-f(z_0)}{z-z_0}$$. In this case, $$f'(z)=\frac{(z^2+z)-(z_0^2+z_0)}{z-z_0}$$.

According to the solution, the numerator factorises into $$(z-z_0)(z+z_0+1)$$. I am assuming that $$(z-z_0)$$ was factored out so that cancellation could be performed with the denominator, but I am struggling to understand how this factorisation was carried out, since this is not a conventional factorisation which I am accustomed to performing.

I understand how to proceed from here: $$(z-z_0)$$ cancels and we are left with $$\lim_{z \to z_0}(z+z_0+1)=2z_0+1$$, and thus $$f'(z)=2z+1$$.

So, the only step which I am struggling to grasp is the factorisation step! How do I perform a factorisation like this?

• In this case, the fact that $(a+b)(a-b)=a^2-b^2$ is useful. – kimchi lover Apr 20 at 14:12

$$(z^2+z)-(z_0^2+z_0)=(z^2-z_0^2)+(z-z_0)=(z-z_0)(z+z_0)+(z-z_0)=(z-z_0)(z+z_0+1)$$
Just use the fact that\begin{align}(z^2+z)-({z_0}^2+z_0)&=z^2-{z_0}^2+z-z_0\\&=(z-z_0)(z+z_0)+z-z_0\\&=(z-z_0)(z+z_0+1).\end{align}
Whenever $$z\mapsto f(z)$$ is a polynomial such a factorization is possible. For the proof it is sufficient to observe that for all $$n\in{\mathbb N}_{\geq0}$$ one has $$z^n-z_0^n=(z-z_0)\bigl(z^{n-1}+z^{n-2}z_0+\ldots+z_0^{n-1}\bigr)\ .$$