Minimise the functional $\int_D \| \operatorname{grad}u(M)\|^2\,\mathrm dM$ I have the following problem: 

Let $k \in \mathbb{N}^*$ and $D$ be the closed disk of radius $1$ in $\mathbb{C}$ and $g\colon \mathbb{U} \to \mathbb{R}:z \mapsto \sin(k\mathrm{Arg}(z))$. Now let $E$ be the set of functions from $D$ to $\mathbb{R}$ which are continuous on $D$, $C^1$ on $\overset{\circ}{D}$ and whose partial derivatives can be continuously extend to $D$ and whose restrictions at $\mathbb{U}$ is $g$. Find the minimum of the functional: 
  $$u \in E \mapsto\int_D \| \operatorname{grad}u(M)\|^2 \,\mathrm{d}M.$$

I would like to have some thoughts on it, the problem is that I do not know at all how to abord it and where to look at.
I know that most of the time in order to find the maximum of a function we need to find the critical point of this function in order to see if these points are relatives minimum and then ajust. But here it is not clear to me how I should find the critical points or if I should apply an other technique.
Thank you.
 A: $\def\∆{\mathord{∆}}\def\d{\mathrm{d}}\def\vec{\boldsymbol}$Using polar coordinates, $g(θ) = \sin(kθ) \in C([0, 2π])$, thus the solution to the equation$$
\begin{cases}
-\∆u = 0, \quad x \in D^\circ\\
u|_{∂D} = g
\end{cases}
$$
satisfies $u \in C(D) \cap C^∞(D^\circ)$ and\begin{align*}
u(r, θ) &= \frac{1}{2π} \int_{-π}^π \frac{1 - r^2}{1 + r^2 - 2r \cos(α - θ)}g(α) \,\d α\\
&= \frac{1}{2π} \int_{-π}^π \frac{1 - r^2}{1 + r^2 - 2r \cos(α - θ)} \sin(kα) \,\d α.
\end{align*}
Next, it will be proved that this $u \in \mathscr{E}$ minimizes $\displaystyle J(v) = \int_D |∇u|^2 \,\d x$ in $\mathscr{E}$. For any fixed $v \in \mathscr{E}$, denote $φ = v - u$. Note that $u + tφ \in \mathscr{E}$ for any $t \in \mathbb{R}$. Define $j(t) = J(u + tφ)$ for $t \in \mathbb{R}$, then$$
j'(t) = \int\limits_D \frac{\d}{\d t} \bigl(∇(u + tφ) · ∇(u + tφ)\bigr) \,\d x = 2 \int\limits_D ∇(u + tφ) · ∇φ \,\d x,\\
j''(t) = 2 \int\limits_D \frac{\d}{\d t} \bigl( ∇(u + tφ) · ∇φ \bigr) \,\d x = \int\limits_D |∇φ|^2 \,\d x \geqslant 0.
$$
Note that $u|_{∂D} = v|_{∂D} = g$ implies $φ|_{∂D} = 0$, and $\∆ u = 0$ on $D^\circ$, thus\begin{align*}
\frac{1}{2} j'(0) &= \int\limits_D ∇u · ∇φ \,\d x = \int\limits_{∂D} φ∇u · \vec{n} \,\d s - \int\limits_D φ\∆ u \,\d x = 0,
\end{align*}
which implies $J(v) = j(1) \geqslant j(0) = J(u)$. Therefore, $u$ minimizes $J$. Finally,\begin{align*}
J(u) &= \int\limits_D |∇u|^2 \,\d x = \int\limits_{∂D} u∇u · \vec{n} \,\d s - \int\limits_D u\∆ u \,\d x\\
&= \int\limits_{∂D} g\frac{∂u}{∂\vec{n}} \,\d s = \int\limits_{∂D} \left. g\frac{∂u}{∂r} \right|_{r = 1} \,\d s = \int_{-π}^π \sin(kα) · \frac{∂u}{∂r}(1, α) \,\d α.
\end{align*}

Now for this particular $g(θ) = \sin(kθ)$, after solving for $u$ for small $k$, the solution for general $k$ can be guessed as $u(r, θ) = r^k \sin(kθ)$. To verify this, note that in polar coordinates,$$
\∆ = \frac{∂}{∂r^2} + \frac{1}{r} \frac{∂}{∂r} + \frac{1}{r^2} \frac{∂^2}{∂ θ^2},
$$
thus\begin{align*}
\∆ u(r, θ) &= \frac{∂}{∂r^2}(r^k \sin(kθ))  + \frac{1}{r} \frac{∂}{∂r}(r^k \sin(kθ)) + \frac{1}{r^2} \frac{∂^2}{∂ θ^2}(r^k \sin(kθ))\\
&= k(k - 1) r^{k - 2} \sin(kθ) + \frac{1}{r} · k r^{k - 1} \sin(kθ) - \frac{1}{r^2} · r^k k^2\sin(kθ) = 0.
\end{align*}
Therefore,$$
J(u) = \int_{-π}^π \sin(kα) · \frac{∂u}{∂r}(1, α) \,\d α = \int_{-π}^π \sin(kα) · k\sin(kα) \,\d α = kπ.
$$
