A function of two variables

is called harmonic if it is a solution of the Laplace equation

. An example of a harmonic function is the real or the imaginary part of a complex analytic function viewed as a function of two real variables. The Dirichlet problem in two dimensions is this: given a reasonable domain in

and a continuous function

on its boundary, find a smooth function

that coincides with

on the boundary and is harmonic in the interior of the region. In 1944 Kakutani showed that the solution can be expressed in term of Brownian motion. This Demonstration illustrates the Kakutani construction for the case of the unit disc. You can choose one of three functions using the setter bar. The first two are harmonic, the third one is not. The harmonic functions are given by the formulas

and

. The nonharmonic function is a polynomial of degree five with positive coefficients.