# Cauchy Riemann equations for real functions.

Let $f(x+iy) = x^2 + i.0$.

Then $u(x,y) = x^2$ and $v(x,y) = 0.$

Hence $u_x = 2x$, $v_y = 0$, $u_y = 0$, and $v_x = 0.$

Clearly this doesn't satisfy Cauchy Riemann equations, and hence is not differentiable.

But we know from calculus that $f'(x) = 2x.$ So my question is, where I went wrong in my analysis?

-
You have $f(z) = (Rez)^2$ but Rez is not differentiable. Another thing is what $f'(z)$ is even if you know $f'(x) = 2x$ – Nikita Evseev Oct 21 '12 at 14:39

There is a difference between real differentiation and complex differentiation. The function $f(x+iy)=x^2$ is real differentiable as a function of $x$ (with derivative $2x$) but, as you showed from applying the Cauchy-Riemann equations, is not complex differentiable as a function of $z=x+iy$.

The question is: why is a function that is real differentiable not necessarily complex differentiable (as you've shown)? Recall that the derivative of a function $f(x)$ is defined as $$f'(x) = \lim_{h \rightarrow 0} \frac{f(x+h)-f(x)}{h}.$$ If $f$ is function of a real number then $h$ has to be real. Roughly speaking, the real number $h$ can only approach the limit 0 from two directions. Either you let $h$ be positive and make it smaller and smaller, or you let $h$ be negative and make it larger and larger, so approaching 0 in two ways. For the limit to exist these two ways of approaching 0 have to give the same result. This is why the function $f(x)=|x|$ is not differentiable at $x=0$: the result depends on whether you start with $h$ negative (giving "$f'(x)=-1$") or $h$ positive (giving "$f'(x)=+1$").

On the other hand, if $f$ is a function of a complex variable then $h$ is also complex. If $h$ is complex then it can approach 0 in an infinite number of ways. Think of the two dimensional complex plane: you can travel towards the origin $z=0$ though any of the infinite number of lines that pass through $z=0$. In particular, we could let $h$ approach 0 along the imaginary axis by setting $h=it$ for a real number $t$.

Let's try this out directly and show that your function $f(x+iy)=x^2+0i$ is not complex differentiable at $z=x+iy=1$. If we let $h$ be real then we get $$f'(1) = \lim_{h\rightarrow 0}\frac{f(1+h)-f(1)}{h}\\ f'(1) =\lim_{h\rightarrow 0}\frac{(1+h)^2-(1)^2}{h}\\ f'(1) =\lim_{h\rightarrow 0}\frac{1+2h+h^2-(1)^2}{h}\\ f'(1) =\lim_{h\rightarrow 0}(2+h) = 2$$ On the other hand, if we let $h$ be purely imaginary by setting $h=it$ for a real $t$ we get $$f'(1) = \lim_{h\rightarrow 0}\frac{f(1+it)-f(1)}{h}\\ f'(1) =\lim_{h\rightarrow 0}\frac{(1)^2+0t-(1)^2}{h}\\ f'(1) =\lim_{h\rightarrow 0}\frac{0}{h}=0$$ Thus when we allow $h$ to be complex it is possible for the limit defining the derivative to take on different values depending on the way in which you approach 0, and hence the limit doesn't exist.

-

It looks like you're trying to think of $f(x+iy)=x^2$ in a way similar to $f(z)=z^2$, where $f'(z)=2z$. Your calculations are correct though.

Another way to approach complex differentiability is to see if the function depends on the conjugate $\bar{z}$. One nice result is that a function is (complex) differentiable if and only if $\frac{\partial f}{\partial \bar{z} }=0$. Since $x=\frac{z+ \bar{z}}{2}$ your function can be expressed as $f(x+iy)= \left( \frac{z+ \bar{z}}{2} \right)^2$, which depends on $\bar{z}$.

-

The function you're describing is $f(z)=Re(z)^{2}$. Even if you break a function into its real and imaginary parts, you have to bear in mind that you're still dealing with a complex function - you can't just ignore that and say $f(x)=2x$, as that's only true for a subset of the domain of $f$.

-