Exercise on showing that a function with a jump discontinuity must have infinite energy Let $u \in C(\bar B\setminus\{P,Q\})\cap C^1(B)$ where $B$ is the open unit ball in $\mathbb{R}^2$ centered at the origin and $P,Q$ are the points $(0,1),(0,-1)$. Suppose also that $u=1$ in the 'right' part of the boundary, i.e. $u=1$ in $\partial \bar B \cap \{(x,y) \in \mathbb{R}^2 \| \ x>0\}$ and  $u=0$ in the 'left' part of the boundary, i.e. $u=0$ in $\partial \bar B \cap \{(x,y) \in \mathbb{R}^2 \| \ x<0\}$. Prove that 
$$\int_B |\nabla u|^2 dxdy=+ \infty.$$
I had a similar exercise on a square and i managed to solve it, but I can't repeat the same argument for a circle. Any suggestions?
 A: It suffices to show that $\int_D |\nabla u|^2\, dx\, dy = +\infty$ for a small region $D$ around one of the discontinuities. By taking an appropriate smooth map, therefore, we can reformulate the problem in a more convenient way:
Reformulation: Let $H = \{(x, y) \in \mathbb{R}^2 : y \geq 0\}$ be the closed upper half-plane. Let $f: H \setminus \{(0, 0)\} \to \mathbb{R}$ be continuous, be differentiable in the interior of $H$, and satisfy $f(x, 0) = 1$ for $x < 0$ and $f(x, 0) = 0$ for $x > 0$. Let $D_\eta = \{(x, y) \in H: 0 < x^2 + y^2 < \eta^2\}$ be a half-disk of radius $\eta$ around the origin in $H$. Then $\int_{D_\eta} |\nabla f|^2\, dx\, dy = +\infty$ for any $\eta$.
Proof of the reformulation: Recast in polar coordinates: $$\int_{D_\eta} |\nabla f|^2\, dx\, dy = \int_0^\eta g(r)\, dr$$
where
$$g(r) = r \int_0^\pi |\nabla f(r \cos \theta, r \sin \theta)|^2\, d\theta = \int_{S_r} |\nabla f|^2\, ds$$
is the line integral of $|\nabla f|^2$ around a semicircular path $S_r$ of radius $r$. Note that $|\nabla f| \geq |\nabla f \cdot \hat{\theta}|$, where $\hat {\theta}$ is a counterclockwise-pointing unit vector, and that $\nabla f \cdot \hat \theta$ is the directional derivative of $f$ along the contour $S_r$, so $\int_{S_r} \nabla f \cdot \hat{\theta}\, ds = f(-r, 0) - f(r, 0) = 1$ by the Fundamental Theorem of Calculus. Therefore:
$$\begin{align*}
g(r) &= \int_{S_r} |\nabla f|^2\, ds  \\
&\geq \frac{1}{\pi r} \left( \int_{S_r} |\nabla f|\,ds \right)^2 \, \tag{Cauchy-Schwarz} \\
&\geq \frac{1}{\pi r} \left( \int_{S_r} |\nabla f \cdot \hat{\theta}|\, ds \right)^2 \\
&\geq \frac{1}{\pi r} \left( \int_{S_r} (\nabla f \cdot \hat{\theta})\, ds \right)^2  \\
&= \frac{1}{\pi r}
\end{align*}$$
so $$\int_{D_\eta} |\nabla f|^2\, dx\, dy = \int_0^\eta g(r)\, dr \geq \int_0^\eta \frac{1}{\pi r}\, dr = +\infty.$$
