Why the real and imaginary parts of a complex analytic function are not independent? I have trouble understanding a whole array of things in complex analysis, which I have basically tracked to the statement "real and imaginary parts of a complex analytic function are not independent."
Because of that, I don't really understand the Cauchy-Riemann equations, the fact that for an analytic function, if its real part is constant, then the whole function is constant, and other fundamental things, such as Cauchy's Integral formula, Maximum modulus principle, etc. (the last two just make zero sense to me.)
The thing is, I pretty much understand the proofs, starting from the beginning, when we define differentiability of a complex function. I don't have any problems with the introduction of complex numbers as well, and different identities. 
But I just don't have any intuition for why things are like that, and it's very frustrating, because I always feel like I don't understand complex numbers at all, and just do some standard exercises in class, relying on proven facts that I just assume to be true as a starting point. 
But as soon as I go and try to understand the meaning of things we in the class work with, I just immediately stop understanding anything.
Can anyone help me understand why the real and imaginary parts of a complex function are not independent?
 A: It's really just a question of the definition of the derivative. If $z=x+yi,$ $f(z)=u(x,y)+iv(x,y)$ can be any pair of functions $u,v.$ 
But if $f$ is differentiable, then:
$$f'(z)=\lim_{h\to 0}\frac{f(z+h)-f(z)}{h}\tag{1}$$
then $h$ can approach $0$ in many different ways, since $h$ is complex. 
For example, you can have $h\to 0$ on the real line. Then: $$f'(z)=\frac{\partial u}{\partial x} +i\frac{\partial v}{\partial x}$$
But if $h\to 0$ along the imaginary part, then:
$$\begin{align}f'(z)&=\frac{1}{i}\left(\frac{\partial u}{\partial y}+i\frac{\partial v}{\partial y}\right)\\
&=\frac{\partial v}{\partial y}-i\frac{\partial u}{\partial y}
\end{align}$$
So for the limit to be independent of any path you take $h\to 0$ you must have at minimum that $$\frac{\partial u}{\partial x}=\frac{\partial v}{\partial y},\\\frac{\partial v}{\partial x}=-\frac{\partial u}{\partial y}\tag{2}$$
So for (1) to be true, we need $u,v$ to satisfy the differential equations in (2).
It turns out that $(2)$ is enough to ensure that $(1)$ converges to a single value, but that is not 100% obvious.
The equations in (2) are called the Cauchy-Riemann equations.

Another way of looking at it is, given a function $f:\mathbb R^2\to\mathbb R^2$ mapping $\begin{pmatrix}x\\y\end{pmatrix}\mapsto \begin{pmatrix}u(x,y)\\v(x,y)\end{pmatrix}$ there is a matrix derivative standard from multi-variable calculus:
$$Df\begin{pmatrix}x\\y\end{pmatrix}=\begin{pmatrix}\frac{\partial u}{\partial x}&\frac{\partial u}{\partial y}\\\frac{\partial v}{\partial x}&\frac{\partial v}{\partial y}\end{pmatrix}\tag{3}$$
For small vectors $$\mathbf h=\begin{pmatrix}h_1\\h_2\end{pmatrix}$$ you get $f\left(\begin{pmatrix}x\\y\end{pmatrix}+\mathbf h\right)\approx  f\begin{pmatrix}x\\y\end{pmatrix}+Df\begin{pmatrix}x\\y\end{pmatrix}\mathbf h.$
In particular, $Df$ is in some sense the "best" matrix, $\mathbf A,$ for estimating $f(\mathbf v+\mathbf h)\approx f(\mathbf v)+\mathbf A\mathbf h.$
Now, these matrices are not complex numbers. But an interesting fact is that the set of matrices of the form:
$$\begin{pmatrix}a&-b\\b&a\end{pmatrix}\tag{4}$$
are a ring isomorphic to the ring of complex numbers. Specifically, the above matrix corresponds to $a+bi.$
We also have that:
$$\begin{pmatrix}a&-b\\b&a\end{pmatrix}\begin{pmatrix}x\\y\end{pmatrix}=
\begin{pmatrix}ax-by\\bx+ay\end{pmatrix}$$
compare that with:
$$(a+bi)(x+yi)=(ax-by)+(ay+bx)i.$$
So these matrices (4) act on $(x,y)^T$ the same way that $a+bi$ acts on $x+yi$ by multiplication.
The Cauchy-Riemann equations (2) just mean that $Df\begin{pmatrix}x\\y\end{pmatrix}$ is an example of (4) - that is, when the Cauchy-Riemann equations are true for $u,v$ then the multi-variate derivative (3) can be thought of as a complex number.
So we see that when we satisfy Cauchy-Riemann, $Df\begin{pmatrix}x\\y\end{pmatrix}\cdot\mathbf h$ can be seen as multiplication of complex numbers, $f'(z)$ and $h=h_1+h_2i.$ Then you have:
$$f(z+h)\approx f(z)+f'(z)h.$$
where $f'(z)$ is not just the best estimating complex number for this approximation, but also $f'(z)$ is the best linear operation on $h$ for this estimation.
So complex analysis is taking the vector function and asking, $f$ "when does it make sense to think of the derivative of the $\mathbb R^2\to\mathbb R^2$ as a complex number?" That is exactly when Cauchy-Riemann is true.
In the general case $f:\mathbb R^2\to\mathbb R^2,$ we can't really take the second derivative and get an estimate $f(z+h)\approx f(z)+Df(z)\cdot h +\frac{1}{2}D^2f(z)\cdot h^2+\cdots.$ We can't get easy equivalents to power series approximations of $f.$
But when $Df$ satisfies Cauchy-Riemann, we can think if $Df$ as a complex-valued function. 
So complex analysis is a subset of the real analysis of functions $\mathbb R^2\to\mathbb R^2$ such that the derivative matrix $Df$ can be thought of as a complex number. This set of functions turns out to have a lot of seemingly magical properties.
This complex differentiability turns out to be fairly strong property on the functions we study. The niceness of the Cauchy-Riemann equations gives up some truly lovely results.
A: Other people have answered this question very nicely. Here is another way of saying the same things again, in a more geometric way.
When you differentiate a function $f:\mathbb{R}\to\mathbb{R}$, you're trying to approximate its graph by a straight line.
When you differentiate a function $f:\mathbb{R}^2\to\mathbb{R}^2$, you're trying to approximate its graph (which now lives in $\mathbb{R}^2\times\mathbb{R}^2=\mathbb{R}^4$) by a plane. Indeed, the two components of the function are completely independent, i.e. the projections of this plane to the two copies of $\mathbb{R}^3$ (that you get by forgetting one of the two components of the target) are completely independent of one another.
When you differentiate a function $f:\mathbb{C}\to\mathbb{C}$, you're trying to approximate its graph by a complex line. Complex lines in $\mathbb{C}^2$ are, in particular, planes in $\mathbb{R}^4$, but they are a restricted class of planes (not every 2-plane is a complex line). This restriction is precisely expressed by the Cauchy-Riemann equations.
A: While others have already given excellent detailed answers, I want to contribute a more "basic" idea, which hopefully can help you.
The special thing about complex analysis as compared to real analysis is that you have multiple "directions" from which you can approach a certain point (remember that a derivative says something about the vicinity of a point in a certain direction). The fact that you cannot only approach the point from the purely imaginary axis or the purely real axis, but from all directions in between imposes certain conditions on the function and thus interdependence between real and imaginary parts. All these derivatives have to exist and they have to "smoothly" blend into each other - somewhat like your right-side derivative and left-side derivative have to correspond in real analysis for the function to be considered differentiable at this point.
In a way, this concept of "no matter from which side I approach the point" HOLDING FOR EVERY POINT is a very strong requirement for a function, which means that if these requirements hold (=function is complex differentiable) this allows us to deduce surprisingly strong statements about the properties of such a function.
A: The most sensible way, I believe, to understand this is that differentiation characterizes the micro-local behavior of a function at a point. In particular, one of several interpretations of the derivative of any function $f$ at some input point $x_0$ is that in a suitably tiny region around that point, $f$ "acts" like (up to some shifts to get things suitably centered) a multiplication by $f'(x_0)$.
When $f$ is a complex function, then complex differentiability means that it must act like multiplication by a complex number, namely the complex derivative $f'(z_0)$ for a now complex test point $z_0$. And multiplication by a general complex number scrambles together the real and imaginary parts of the number so multiplied.
A: Since the independence was nicely addressed in the accepted answer, I address the relationship between the Cauchy integral formula and the maximum principle first. (Below the line there's a very similar explanation for why real and imaginary parts are not independent)
The Cauchy integral formula intuitively states that the value at a point is the average of the values in a circle around a point, weighted somehow according to their distance (and angle). This is not easy to see directly from the Cauchy-Riemann equations (i.e., linearity of the differential). It is quite a deep theorem that $f$ is holomorphic if and only if $f$ satisfies the Cauchy integral formula (the proof usually involves this cycle: holomorphic $\Rightarrow$ integral formula $\Rightarrow$ power series $\Rightarrow$ holomorphic). The nicest proof of the Cauchy integral formula I have seen so far just uses homotopy invariance and the fact that integrals along contractible curves are zero, but this is a story for another question I guess. Let me just remark that the Cauchy integral formula is true more generally, e.g.,


*

*The Mean Value Equality for harmonic functions

*The Stokes Equation for differential forms on smooth manifolds with boundary


Both of these results may offer geometric insight when the time comes. Perhaps it is best for now to think about "functions satisfying the Cauchy integral formula" just as "some class of functions that has this mean value property", knowing in the back of your head that you will eventually understand that these functions are actually the same as "functions that have $\mathbb C$-linear differential".
Believing in the Cauchy integral formula has the advantage of making the maximum principle seem intuitive: If the function is the weighted average of itself at all the circles around it, it cannot get bigger inside these circles than it is on the circles. If you look closely, this is probably basically the argument in your proof of the maximum principle.

Recall that the differential of a (real-)differentiable function $f: \mathbb R^2 \rightarrow \mathbb R^2$ at a point $x \in \mathbb R^2$ is the $\mathbb R$-linear map $Df_x: \mathbb R^2 \rightarrow \mathbb R^2$ that approximates $f$ best at the point $x$. You might have seen this as
$$\lim_{h \rightarrow 0}\frac{f(x + h) - f(x) - Df_x(h)}{\Vert h \Vert} = 0.$$
This could be visualised by saying that every (real-)differentiable function $f: \mathbb R^2 \rightarrow \mathbb R^2$, after zooming in enough, looks like a linear transformation. Maybe check out some visualizations by 3blue1brown if you do not have a concrete picture in mind.
Now consider a holomorphic function $f: \mathbb C \rightarrow \mathbb C$. In this case, the differential of $f$ at $z$ is the $\mathbb C$-linear map $Df_z: \mathbb C \rightarrow \mathbb C$ that approximates $f$ best at $z$. Emphasis lies on the fact that $Df_z$ is $\mathbb C$-linear this time, i.e., $Df_z$ is just multiplication by some complex number denoted $f'(z)$. 
Now comes the important observation:
 Let $a \in \mathbb C$ be a complex number. Then the map $z \mapsto az$ is given by stretching and rotating, but not shearing. As a map $\mathbb R^2 \rightarrow \mathbb R^2$, it has the form
$$\begin{pmatrix}
x & -y \\
y & x
\end{pmatrix},$$
where $a = x + iy$ if that helps you to visualize it (otherwise, please ignore the matrix).
Why is this important? This shows, that when zooming in, $f$ looks like stretching and rotating. But, as you may gather from the above matrix, from intuition or just by blind faith, if you know what stretching and rotating does to one vector, then you also know what it does to all other vectors. 
This is why real and imaginary parts are not independent.
A: Consider the linear function, 
$$ f(z) = m z + b.$$
The transformations of the complex plane which can be written this way include only the following:


*

*Rotations.

*Translations.

*Dilations.


The Cauchy-Riemann equations are the conditions that a function $f(z)$ must meet so that locally its transformations are a combination of the above transformation. If a function doesn't obey the Cauchy-Riemann equations then it may introduce some shear or change angles between curves at points of intersection.
A: As others have said, one way to look at why the real and imaginary parts of a complex differentiable function are not independent is because the derivative of such a function is required to be a complex number. 
Geometrically complex numbers represent combinations of rotations and scaling, and if you start modifying the real part independently of the imaginary part, the derivative (which still exists as a vector function) may no longer represent a rotation-scaling combination and therefore cannot be written as a complex number, and therefore the function is not complex differentiable at that point. 
Complex analysis can be very geometrical and intuitive. As an aside I highly recommend the book Visual Complex Analysis by Tristan Needham.
So let’s try an example. Consider the function $f(z) = z^2$. This is a complex differentiable function which sends the complex plane $\mathbb{C}$ onto itself with a twist. If we consider the point $p=i$, it’s clear that $f$ sends $p$ to $f(p) = -1$:

Now let’s consider a small piece of the complex plane around $i$ (here shown in blue). I’m going to call this a neighbourhood. Since $f$ is continuous it sends this neighbourhood of $i$ to a (possibly deformed) neighbourhood of $f(i)$:

Questions about whether $f$ is differentiable, or complex differentiable amount to how $f$ deforms this blue blob. If we want $f$ to be just regular differentiable (not complex differentiable) then $f$ has to transform this blob using a linear transformation - any old linear transformation will do. This is a stronger condition than simple continuity but it’s not that strong (relatively speaking). But if we want it to be complex differentiable (a requirement for being complex analytical), then it has to transform this blob using only a rotation and a scaling transformation - this is a very strong condition.
So let’s take a closer look at this. The derivative of $f$ is $f’(z) = 2z$, which at $p = i$ gives us $f’(p) = 2i$.
What does it mean to say that the derivative of $f$ at $p$ is $2i$ ? 
The derivative at $p$ describes how the blue blob around $p$ is sent to a blue blob around $f(p)$. the complex number $i$ represents a 90 degree counter-clockwise rotation, and so in this case we’re saying that $f$ deforms the blob around $p$ by rotating it by 90 degrees and scaling it by 2 (zooming in so everything is twice as big). It looks something like this (where we zoomed in really really close to $p$ on the left and $f(p) = -1$ on the right):

So far so good. But why can’t we change the real and imaginary parts independently?
To get an intuitive understanding of this, and to make the real and imaginary parts more visible, let’s look at $f$ not as a complex function, but as a function of the euclidean plane $\mathbb{R}^2$ into itself. It’s important to understand that complex numbers can be viewed as an “extra” feature that exists on top of the regular 2D euclidean plane. So any time you have a complex function, you also have a regular 2D function and it’s useful to be able to jump between the two representations. In our case If we write:
$$z = x + i y$$
Then we can write $f$ (still as a complex function):
$f(x + iy) = (x + iy)^2 = x^2 + 2i xy - y^2 = (x^2 - y^2) + 2 xy i$
So as a function of vectors from $\mathbb{R}^2$ to $\mathbb{R}^2$ $f$ can be written as:
$f(\begin{bmatrix}x\\y\end{bmatrix}) = \begin{bmatrix}x^2 - y^2\\2xy\end{bmatrix}$
Viewed as $\mathbb{R}^2$ $i$ is $\begin{bmatrix}0\\1\end{bmatrix}$ and we can confirm that $f(\begin{bmatrix}0\\1\end{bmatrix}) = \begin{bmatrix}-1\\0\end{bmatrix}$ which corresponds to $-1$ in the complex plane.
Now what is the derivative of f in this picture? It’s the jacobian matrix:
$Df_{(x,y)} = \begin{bmatrix}\frac{\partial f_x}{\partial x}&&\frac{\partial f_x}{\partial y}\\ \frac{\partial f_y}{\partial x}&&\frac{\partial f_y}{\partial y}\end{bmatrix} = \begin{bmatrix}2x&&-2y\\2y&&2x\end{bmatrix}$
This is like the derivative in 1D in that it tells us how $f$ changes near a point, but instead of a number it’s a matrix - or well, it’s a formula for a matrix at any given point $(x, y)$. We agreed that $i$ corresponds to $x = 0, y= 1$ so at this point we get this specific matrix
$Df_{(0,1)} = \begin{bmatrix}0&&-2\\2&&0\end{bmatrix} = 2 \begin{bmatrix}0&&-1\\1&&0\end{bmatrix}$
This matrix tells us how the blue blob around $\begin{bmatrix}0\\1\end{bmatrix}$ is transformed into the blue blob around $\begin{bmatrix}-1\\0\end{bmatrix}$.
Note that the matrix 
$\begin{bmatrix}0&&-1\\1&&0\end{bmatrix}$
Represents a 90 degree rotation, so again we see that $f$ transforms the blob around $p$ by rotating by 90 deg and scaling by a factor of 2 (this matrix can be seen as the matrix version of the imaginary number i). And in fact it had better be the case, because $f$ is the same function! We’re just writing it down in two equivalent ways, and if they showed us two different behaviours we’d be in trouble. 
So now let’s try modifying the real part and see where we lose complex differentiability. Suppose we modify the real part from $2xy$ to $xy$ and we call this new function $g$:
$g(x + iy) = (x^2 - y^2) + i (xy)$
Note that this is a perfectly valid function from the complex plane to itself. It’s not complex differentiable (as we’ll see in a moment), but it does map $\mathbb{C}$ to $\mathbb{C}$. Now let’s forget the “extra” complex “structure” of $g$ and write it as a function of $\mathbb{R}^2->\mathbb{R}^2$:
$g(\begin{bmatrix}x\\y\end{bmatrix}) = \begin{bmatrix}x^2 - y^2\\xy\end{bmatrix}$
The derivative is:
$Dg_{(x,y)} = \begin{bmatrix}2x&&y\\-2y&&x\end{bmatrix}$
And at $\begin{bmatrix}0\\1\end{bmatrix}$:
$Dg_{(0,1)} = \begin{bmatrix}0&&1\\-2&&0\end{bmatrix}$
So far so good. Again, note that there is nothing wrong with this derivative - g is differentiable as function from $\mathbb{R}^2$ to $\mathbb{R}^2$. Now let's try to jump back into the complex picture and write this derivative as a complex number. To help us let's visualize what this matrix does around $p$:

Yikes, we're stuck! See how one axis is elongated but the other isn’t? This cannot be represented as a complex number - it cannot be achieved by a rotation followed by scaling because rotating and scaling always affect both axes equally (imagine rotating and scaling a photo in photoshop, but where you're not allowed to change the height without changing the width or vice-versa). This means the derivative of $g$ does not correspond to a complex number. So $g$ is not complex-differentiable at this point - we started with a complex differentiable function, modified just the imaginary part, and we "broke" the complex differentiability, which shows some form of dependence between the real and imaginary parts.
This is a very specific example, but the same intuition applies generally. Since locally (when we zoom in very close to a point) a complex differentiable function is only allowed to rotate and scale it places strong constraints on the real and imaginary parts. Of course you could have seen that with the Cuachy-Riemman equations more quickly, but that skips a lot of the intuitive geometry. And actually a lot of crazy-sounding phenomena in complex analysis can be traced back to geometric explanations such as this one. 
