Sums of Squares and Laplace’s Equation

What could a sum of squares have to do with the equation governing steady-state temperature? The connection begins with a deceptively simple observation: when we differentiate a sum of coordinate squares twice, the answer remembers the dimension of space. From there, sums and differences of squares produce harmonic functions, and a familiar two-square identity leads to an elegant solution of Laplace’s equation.

This article is an independent introduction to a connection suggested by Olga Taussky’s survey Sums of Squares. We will use only partial derivatives and elementary algebra. The focus is on harmonic functions and dimensions, rather than on the arithmetic question of which integers are sums of squares.

1. From a sum of squares to a differential equation

In n-dimensional space, write

r^2=x_1^2+x_2^2+\cdots+x_n^2.

The Laplacian of a twice continuously differentiable function is the sum of its second partial derivatives:

\Delta u=\frac{\partial^2u}{\partial x_1^2}+\cdots+\frac{\partial^2u}{\partial x_n^2}.

A function is called harmonic where \Delta u=0. In a region without heat sources, a steady-state temperature distribution is a standard example of a harmonic function.

Since every coordinate square contributes 2 when differentiated twice,

\boxed{\Delta(r^2)=2n.}

The right-hand side is not zero. Nevertheless, the formula tells us how to combine sums of squares to make harmonic functions.

2. A harmonic function made from two sums of squares

Split the variables into two groups: x_1,\ldots,x_p and y_1,\ldots,y_q, with p,q\geq1. Define

A=x_1^2+\cdots+x_p^2,\qquad B=y_1^2+\cdots+y_q^2.

Because \Delta A=2p and \Delta B=2q, the function

\boxed{u=qA-pB}

is harmonic: \Delta u=2pq-2pq=0.

For example, in three dimensions p=2 and q=1 give

u(x,y,z)=x^2+y^2-2z^2,\qquad\Delta u=2+2-4=0.

The zero set x^2+y^2=2z^2 is a double cone. The polynomial is positive outside the cone and negative inside it (away from the origin). This illustrates how the geometry of a sum of squares can organize a harmonic function.

xy++−−u = x² − y²Red lines: u = 0
A two-dimensional example: u=x^2-y^2 is harmonic. Its zero lines y=\pm x separate positive and negative regions.

3. Why the logarithm of a sum of two squares is special

In the plane, let s=x^2+y^2 and consider

u(x,y)=\log(x^2+y^2),\qquad (x,y)\ne(0,0).

Direct differentiation gives

u_x=\frac{2x}{s},\qquad u_{xx}=\frac{2}{s}-\frac{4x^2}{s^2},

u_{yy}=\frac{2}{s}-\frac{4y^2}{s^2}.

Adding the second derivatives,

\Delta u=\frac4s-\frac{4(x^2+y^2)}{s^2}=0.

Thus

\boxed{\Delta\log(x^2+y^2)=0\quad\text{when }x^2+y^2>0.}

Its level curves are circles. The origin must be excluded because the logarithm is undefined there; the function is not harmonic on the entire plane.

4. Why two dimensions are exceptional

Write a radial function as u(x_1,\ldots,x_n)=f(r), where r=\sqrt{x_1^2+\cdots+x_n^2}>0. A calculation using the chain rule gives

\boxed{\Delta u=f''(r)+\frac{n-1}{r}f'(r).}

To solve Laplace’s equation for radial functions, we therefore need

f''(r)+\frac{n-1}{r}f'(r)=0,\quad\text{equivalently}\quad (r^{n-1}f'(r))'=0.

Integrating twice yields two different-looking families:

\boxed{f(r)=C\log r+D\quad(n=2),}

\boxed{f(r)=Cr^{2-n}+D\quad(n\geq3).}

Here C,D are constants and the formulas hold on regions excluding r=0. In two dimensions the nonconstant radial solution is logarithmic; in three dimensions it is proportional to 1/r.

This is a genuine dimensional surprise. The same equation, \Delta u=0, produces different radial behavior depending on how many squares appear in r^2.

5. A higher-degree sum-of-squares identity

We can go beyond quadratic polynomials. Let s=x_1^2+\cdots+x_n^2. Then

\Delta\left(\sum_{j=1}^n x_j^4\right)=12s,\qquad\Delta(s^2)=4(n+2)s.

Consequently, the quartic polynomial

\boxed{H(x)=\sum_{j=1}^n x_j^4-\frac{3}{n+2}\left(\sum_{j=1}^n x_j^2\right)^2}

is harmonic for every n\geq2. Indeed,

\Delta H=12s-\frac{3}{n+2}\cdot4(n+2)s=0.

For n=2, multiplying H by 4 gives the familiar harmonic polynomial

x^4-6x^2y^2+y^4.

This is also the real part of (x+iy)^4, linking harmonic polynomials to complex numbers and the two-square identity.

6. From algebra to the mathematics of heat

Suppose a thin plate has a steady-state temperature T(x,y) and no internal heat sources, with constant isotropic thermal conductivity. Then \Delta T=0 in the interior. The harmonic polynomial T(x,y)=x^2-y^2 is one possible mathematical temperature profile on a bounded plate, provided the boundary is held at the values prescribed by that formula.

Its positive and negative values may be interpreted as temperatures relative to a chosen reference level. The important point is that the same algebraic cancellation which makes \Delta(x^2-y^2)=0 also makes the profile compatible with the steady-state heat equation.

7. What is—and is not—the connection?

There are two distinct questions. Arithmetic sums of squares ask which integers or rational numbers can be written as a_1^2+\cdots+a_k^2. Harmonic analysis studies functions satisfying \Delta u=0. They meet here because the Euclidean squared distance is itself a sum of squares, and differentiation exposes its dimension and symmetry.

Olga Taussky’s survey Sums of Squares motivates looking for connections beyond elementary number theory. The derivations in this article are independent, standard consequences of the Laplacian; they should not be read as claiming that every sum-of-squares theorem is a theorem about harmonic functions.

Try it yourself

Exercise 1. Find k so that u(x,y,z)=x^2+3y^2+kz^2 is harmonic.

Solution. \Delta u=2+6+2k=8+2k. Hence k=-4.

Exercise 2. Verify that u(x,y)=xy is harmonic and describe its zero set.

Solution. Both second partial derivatives vanish, so \Delta u=0. The zero set consists of the coordinate axes x=0 and y=0.

Exercise 3. Determine all real k for which u(x,y)=\log(x^2+ky^2) is harmonic everywhere its logarithm is defined.

Solution. At points where s=x^2+ky^2>0, differentiation yields \Delta u=\frac{2(1+k)}s-\frac{4(x^2+k^2y^2)}{s^2}. Multiplying by s^2 gives 2(k-1)x^2+2k(1-k)y^2. For this to vanish on an open domain, k=1.

Challenge. Prove that u(x,y,z)=1/\sqrt{x^2+y^2+z^2} is harmonic away from the origin.

Solution. With r=\sqrt{x^2+y^2+z^2} and f(r)=r^{-1}, we have f'(r)=-r^{-2} and f''(r)=2r^{-3}. The radial Laplacian in three dimensions is f''+2f'/r=2r^{-3}-2r^{-3}=0 for r>0.

Related reading and reference

For the algebraic side of the story, see Why Are 1, 2, 4, and 8 Special? and Sums of Squares and Galois Theory. These articles explore different connections; the present article concentrates on the Laplacian and harmonic functions.

For the same equation at work in physics, see How Does Electricity Know Where to Flow? Laplace’s Equation.

Background inspiration: Olga Taussky, “Sums of Squares,” The American Mathematical Monthly 77 (1970), 805–830, JSTOR. The calculations and examples here are independently developed.

Leave a Reply

Your email address will not be published. Required fields are marked *