Checking where the complex derivative of a function exists I have the  following function:
$$f(x+iy) = x^2+iy^2$$
My textbook says the function is only differentiable along the line $x = y$, can anyone please explain to me why this is so? What rules do we use to check where a function is differentiable?
I know the Cauchy-Riemann equations, and that $u=x^2$ and $v=y^2$ here. 

A perhaps more accessible perspective is to understand that the definition of the complex derivative, as in the real case, relies on the existence and uniqueness of a certain limit. In particular, given a point and a function, one considers evaluation of the function in a small neighbourhood of the point in question in the domain of the function. The limit in question is of course the ratio of the difference in the value of the function between the distinguished point and close neighbours to the difference in the argument.  In the familiar real case, the limit must be uniquely defined, regardless of the direction from which the point is approached (from above or below). For example, a piecewise linear function has an upper derivative and a lower derivative everywhere; it only has a full derivative where they are equal (which may not be true at the boundaries of the pieces). Failure to meet this condition corresponds to a loss of regularity of the function; it is both intuitively and rigorously meaningless to assign a value to the derivative or slope of such a function at points where the full derivative does not exist. 
The intuition is identical in the complex case; the difference is that the distinguished point may be approached from an infinity of directions. In common with the real case, the derivative is defined iff the limit agrees regardless of this choice. Similarly, the intuition behind this is captured by the idea that the "slope" - here generalised to include the phase as well as the magnitude of the defining ratio, since a ratio of complex numbers is in general complex - must agree at a point, independent of the direction from which it is approached. This is reflected in the structure of the Cauchy-Riemann equations. A slightly counterintuitive aspect of complex analysis is that this can easily be the case even if the real and imaginary parts of the function under consideration are smooth as real functions; agreement with the complex structure is a rigid constraint on differentiability. Try evaluating the limit from several directions for your function and this will persuade you that the limit is not independent of the choice. If the gradient of this function represented a force on a particle in imaginary space, which direction would it move in? It wouldn't be able to make its mind up. 
