Say we have the complex function $f(z)=z\bar{z}$, I want to show that this is differentiable only at the origin directly without using the Cauchy Riemann equations. ( It's a past exam paper I'm working through).
To do this we should use first principals
$$f'(z)=lim_{h \rightarrow0}\frac{f(z+h)-f(z)}{h}$$ where h is a complex number ( This is how complex differentiation was defined in class)
$z\bar{z}=(a+bi)(a-bi)=a^2+b^2$
So using this, I think that a derivative from first principals should look like...
$$f'(z)=lim_{h\rightarrow0}\frac{(a^2+b^2+h)-a^2-b^2}{h}$$
But using this we get $$f'(z)=lim_{h\rightarrow0}\frac{h}{h}=1$$
So either I made a mistake in my first principals or we should use the definition $z\bar{z}=|z|^2$. in which case a first principal argument would look like ;
$$f'(z)=\frac{|z+h|^2-|z|^2}{h}$$ which obviously can,t be differentiated unless z=0 as the denominator other wise will go to zero.
if we take it that z=0 then
$$f'(z)=lim_{h \rightarrow 0}\frac{|h|^2}{h}=\bar{h}$$
So did I do my first principal argument incorrectly when I said that $a^2+b^2=z\bar{z}$ or should we only use $z\bar{z}=|z|^2$ to show it is only differentiable at the origin?
As Lee Mosher said in the comments, $f(z+h) \neq z\overline z + h$, but rather $(z+h)\overline{(z+h)}$.
But, it doesn't seem to hard, because if we write $z = x + yi$ and $h = a + bi$, then \begin{align}f(z+h)-f(z) &= (x + a + (y + b) i) (x + a - (y + b) i) - (x + y i) (x - y i)\\ &= a^2 +b^2+2a x +2 b y\end{align}
and $$\frac{f(z+h)-f(z)}{h} = \frac{a^2 + b^2 + 2ax + 2by}{a + bi}.$$
Now, assume that limit of the RHS exists when $h\to 0$. In particular, it exists when $h$ approaches $0$ along the lines $a = 0$ and $b = 0$, and the limits must be equal. Use it to conclude that $ z = 0$.