Let Ω be an open set in some Euclidean space and v a real-valued function on Ω.
Dirichlet’s integral for v, also called the Dirichlet energy of v, is
Among functions with specified values on the boundary of Ω, Dirichlet’s principle says that minimizing Dirichlet’s integral is equivalent to solving Laplace’s equation.
In a little more detail, let g be a continuous function on the boundary ∂Ω of the region Ω. A function u has minimum Dirichlet energy, subject to the requirement that u = g on ∂Ω, if and only if u solves Laplace’s equation
subject to the same boundary condition.
Dirichlet’s principle requires some hypotheses not stated here, as Hadamard’s example below shows.
Let g(θ) be the function 
The function g is continuous and so there exists a unique solution to Laplace’s equation on the unit disk with boundary values given by g, but the Dirichlet energy of the solution diverges.
The solution, in polar coordinates, is
The Laplace operator in polar coordinates is
and you can differentiate u term by-term to show that it satisfies Laplace’s equation.
Dirichlet’s integral in polar coordinates is
Integrating term-by-term, the nth term in the series for the Dirichlet energy in Hadamard’s example is
and so the series rapidly diverges.
Dirichlet’s principle requires that there be at least one function satisfying the specified boundary conditions that has finite Dirichlet energy. In the example above, the solution to Laplace’s equation with boundary condition g has infinite Dirichlet energy. It turns out the same is true for every function satisfying the same boundary condition, whether it satisfies Laplace’s equation or not.
 What is the motivation for this function? The function is given by a lacunary series, a Fourier series with increasingly large gaps between the frequency components. The corresponding series for u cannot be extended to an analytic function outside the closed unit circle. If it could be so extended, Dirichlet’s principle would apply and the example wouldn’t work.
2 thoughts on “Counterexample to Dirichlet principle”
I liked this nice post!
If i am right, f should be replaced by u inside the Dirichlet integral. Right?
Is the function constructed C^2 on the boundary? If one requires this contition, is Dirichlet principle valid and the counterexample ruled out?