Question about limit of a harmonic function I am trying assignments of complex analysis and need help in this particular question.

Let $u(z)=\Im\frac{(1+z^2)^2}{(1-z^2)^2}$.

*

*Show that $u$ is harmonic in $U$, the unit disk centered at the origin.

*Show that $\lim\limits_{r\to 1} u(r e^{i\theta}) = 0$ for all $\theta$. Why doesn't this contradict the maximum modulus principle for harmonic functions?


For 1. I proved that it is harmonic by the definition that sum of partial derivatives wrt both $x$ and $y$ is $0$. But is there any other way to prove that it is harmonic as using the definition involves a lot of calculations?
For 2. I tried writing $z=r \sin\theta +i \cos\theta$ and putting $r = 1$ but I don't get zero; instead I get $\frac{i\sin\theta}{ 1+\cos\theta}$.
If I use the maximum modulus principle, I get LHS $=0$ and RHS $=\int_{0}^{2\pi} f(r e^{i\theta}$). I don't understand what contradiction one should expect if limit given above tends to $0$ and why there must be no contradiction?
I request you to kindly shed some light on this.
 A: For $a)$; the real and the imaginary part of an holomorphic function are harmonic. Thus, it is enough to prove that $\frac{(1+z^2)^2}{(1-z^2)^2}$ on $U$.
A: What Joe said for first part; imaginary part of holomorphic is harmonic.
What TheSimpliFire said for the limit.
The limit does not contradict the maximum principle for harmonic functions because the maximum principle is for functions defined on the boundary; the above result would seem to say that the boundary value of $u$ is $0$, and hence $u\equiv 0$. But it is not defined everywhere on the boundary, in particular at $z=\pm1$. Maximum principle applies to functions continuous on $\overline U$. You might worry that only the real part blows up but that's not possible. We have the Laurent expansion at $z=1$,
$$ \frac{(1+z^2)^2}{(1-z^2)^2} = \frac{1}{(z-1)^{2}}+\frac{1}{z-1}+
(\text{bounded near } z=1)$$
and if you take $z=1+\epsilon e^{i\pi /4}$ then you see the imaginary part explodes as $\epsilon\to 0$.
A: As noted in other answers, $u$ is harmonic because it is the imaginary part of a holomorphic function.
The most general form of the maximum principle for harmonic functions doesn't require continuity, just boundness and supremum limit except at finite exceptional points on the boundary and here $u$ actually satisfies the second part since it clearly goes to $0$ everywhere but at $\pm 1$ where it goes to zero radially, but not generally, however, the crucial part is that $u$ is unbounded near $\pm 1$ so we cannot apply the general theorem (comes under Lindelof type of results)
Lindelof theorem states that if $u$ harmonic on $U$ where the boundary of $U$ is not a finite set and we have:
1: $u \le M$ on $U$
2: $\limsup_{z \to \zeta} u(z) \le m$ for all but finitely many points on $\partial U$
Then $u \le m$ in $U$
Note that in this case applying the above to $u, -u$ we would conclude that $u=0$ if it were bounded since the limit property applies except at $\pm 1$ as noted! But $u$ is not bounded so no contradiction!
A: As $e^{i\theta}=\cos\theta+i\sin\theta$ (you seem to have swapped the two in your post), we have \begin{align}u(re^{i\theta})&=\Im\left(\frac{1+r^2\cos2\theta+ir^2\sin2\theta}{1-r^2\cos2\theta-ir^2\sin2\theta}\right)^2=\Im\left(\frac{(1+ir^2\sin2\theta)^2-(r^2\cos2\theta)^2}{(1-r^2\cos2\theta)^2+(r^2\sin2\theta)^2}\right)^2\\&=\Im\left(\frac{1+2ir^2\sin2\theta-r^4}{1-2r^2\cos2\theta+r^4}\right)^2=\frac{4(1-r^4)r^2\sin2\theta}{1-2r^2\cos2\theta+r^4}\stackrel{r\to1}\longrightarrow0.\end{align} This does not contradict the Maximum Modulus Principle as $u$ has no imaginary part and is not constant, so $u$ is not holomorphic on the unit disc.
