# 12. Separation of Cartesian Variables in 3D

## Introduction

In general, Poisson and Laplace equations in three dimensions with arbitrary boundary conditions are not analytically solvable.  However, there are important cases where, with suitably parametrization, the equation can be solved as a product of three one-dimensional functions, which can be found separately, and a general solution is then a sum of such terms. The basic requirement is that the boundary conditions for the one-dimensional factor solutions be independent of the other parameters, so, for example, if our parameters are the Cartesian $\left(x,y,z\right)$ the boundaries will constitute a rectangular box (including possibly infinite in some directions).   (We've already seen one example: the equation for the potential for a point charge inside a grounded cubical conducting box discussed above.)  Later, we’ll find many examples of separation of variables in $\left(r,\theta ,\phi \right)$ co-ordinates for systems with some rotational symmetry, the angular boundaries are almost always the natural ones.

Let’s begin with the Laplace equation in Cartesian coordinates:

${\nabla }^{2}\phi =\frac{{\partial }^{2}\phi }{\partial {x}^{2}}+\frac{{\partial }^{2}\phi }{\partial {y}^{2}}+\frac{{\partial }^{2}\phi }{\partial {z}^{2}}=0.$

Try a solution of the form

$\phi \left(x,y,z\right)=X\left(x\right)Y\left(y\right)Z\left(z\right).$

Putting this in the equation and dividing the result by $\phi =XYZ$ yields

$\frac{1}{X\left(x\right)}\frac{{d}^{2}X\left(x\right)}{d{x}^{2}}+\frac{1}{Y\left(y\right)}\frac{{d}^{2}Y\left(y\right)}{d{y}^{2}}+\frac{1}{Z\left(z\right)}\frac{{d}^{2}Z\left(z\right)}{d{z}^{2}}=0.$

This is a sum of three terms adding to zero, the first is a function only of $x,$ the second a function only of $y,$ the third a function only of $z.$ It follows that for this to make sense all three must be constants$—$otherwise, we could vary one of them by varying its variable, which would not affect the values of the others, but would change the sum.

The constants necessarily can't all have the same sign, since they add to zero, we write

$\begin{array}{l}\frac{1}{X\left(x\right)}\frac{{d}^{2}X\left(x\right)}{d{x}^{2}}=-{\alpha }^{2},\\ \frac{1}{Y\left(y\right)}\frac{{d}^{2}Y\left(y\right)}{d{y}^{2}}=-{\beta }^{2},\\ \frac{1}{Z\left(z\right)}\frac{{d}^{2}Z\left(z\right)}{d{z}^{2}}={\alpha }^{2}+{\beta }^{2}={\gamma }^{2}.\end{array}$

The first equation

$\frac{{d}^{2}X\left(x\right)}{d{x}^{2}}=-{\alpha }^{2}X\left(x\right)$

has solutions of the form $A\mathrm{sin}\alpha x,B\mathrm{cos}\alpha x$ or equivalently $C{e}^{i\alpha x},\text{ }D{e}^{-i\alpha x}.$

On the other hand, the equation for $Z\left(z\right)$ has hyperbolic solutions, $\mathrm{sinh}\gamma x,\text{ }\mathrm{cosh}\gamma x,$ or ${e}^{\gamma x},{e}^{-\gamma x}.$

## Revisiting the Cubical Box with Faces Held at Different Potentials

In the previous lecture we found the potential at any point inside a cubical box with five sides at zero potential, the sixth having a potential varying as a function of position on the side. We solved that problem using the Reciprocation Theorem, and the Green’s function for the space inside the box.

Here we are going to attack the same problem but in a different way: we find a complete set of solutions of ${\nabla }^{2}\phi =0$ satisfying the boundary conditions. (Contrast the Green’s function approach in the previous lecture, built on sets of eigenstates of ${\nabla }^{2}$ having nonzero eigenvalues.)  Of course, we’d better get the same answer$—$but the equivalence is not immediately obvious.

We’ll suppose the cubical box is $0\le x,y,z\le 1,$ and all the faces except that at $z=1$ are at zero potential.

Let’s suppose for openers that the two faces perpendicular to the $x$ axis are both held at zero potential.

Then from the preceding section, in the $x$ -direction an orthonormalized set of solutions is

$\sqrt{2}\mathrm{sin}n\pi x=\sqrt{2}\mathrm{sin}{\alpha }_{n}x,$

and similarly in the $y$ -direction.

It follows that a basis of solutions of ${\nabla }^{2}\phi =0$ equal to zero on all boundaries except the top face is given by:

$\phi \left(x,y,z\right)=\sum _{n,m}^{\infty }{a}_{nm}\mathrm{sin}n\pi x\mathrm{sin}m\pi y\mathrm{sinh}\sqrt{{n}^{2}+{m}^{2}}\pi z$ ,

and if we’re given the potential on the top face to be $\phi \left({x}^{\prime },{y}^{\prime }\right)$ the coefficient

${a}_{nm}=\frac{4}{\mathrm{sinh}\pi \sqrt{{n}^{2}+{m}^{2}}}\underset{0}{\overset{1}{\int }}\underset{0}{\overset{1}{\int }}d{y}^{\prime }\phi \left({x}^{\prime },{y}^{\prime },1\right)\mathrm{sin}n\pi {x}^{\prime }\mathrm{sin}m\pi {y}^{\prime },$

And, putting this coefficient in the preceding equation, the potential at any point inside the cube is

$\phi \left(x,y,z\right)=\sum _{n,m}^{\infty }\underset{0}{\overset{1}{\int }}d{x}^{\prime }d{y}^{\prime }\phi \left({x}^{\prime },{y}^{\prime },1\right)\frac{4\mathrm{sinh}\sqrt{{n}^{2}+{m}^{2}}\pi z}{\mathrm{sinh}\pi \sqrt{{n}^{2}+{m}^{2}}}\mathrm{sin}n\pi x\mathrm{sin}n\pi {x}^{\prime }\mathrm{sin}m\pi y\mathrm{sin}m\pi {y}^{\prime }$

In the previous lecture, by quite a different method, we found

For these to be equal we need,

$\frac{\mathrm{sinh}\sqrt{{n}^{2}+{m}^{2}}\pi z}{\mathrm{sinh}\sqrt{{n}^{2}+{m}^{2}}\pi }=2\sum _{\ell =1}^{\infty }\frac{\ell \mathrm{sin}\ell \pi z\mathrm{cos}\ell \pi }{\pi \left({n}^{2}+{m}^{2}+{\ell }^{2}\right)}.$

Writing $K=\pi \sqrt{{m}^{2}+{n}^{2}},$ we see this is just the Fourier series for $\mathrm{sinh}Kz,$

$\frac{\mathrm{sinh}Kz}{\mathrm{sinh}K}=2\sum _{\ell =1}^{\infty }\frac{\ell \mathrm{sin}\ell \pi z\mathrm{cos}\ell \pi }{{K}^{2}+{\pi }^{2}{\ell }^{2}}.$

Exercise:  Check this Fourier series expression for $\mathrm{sinh}Kz$ by evaluating the appropriate integrals.

Note:  to compare our results with Jackson equation (3.169), what we’re looking at here is the derivative of the Green’s function: Jackson equates the Green’s functions.  Taking the derivative of his expression at ${z}_{>}=c=1$ (in our notation) gives our expression.

### Two Different Green’s Functions Again

In fact, this is another example of the two different representations of Green’s functions discussed for the simple one-dimensional case in the previous lecture.

Here type A is the standard sum over the complete states in the cube (taken to have unit length sides):

$G\left(\stackrel{\to }{r},{\stackrel{\to }{r}}^{\prime }\right)=8\sum _{n,m,\mathcal{l}}\frac{\mathrm{sin}n\pi x\mathrm{sin}n\pi {x}^{\prime }\mathrm{sin}m\pi y\mathrm{sin}m\pi {y}^{\prime }\mathrm{sin}\mathcal{l}\pi z\mathrm{cos}\mathcal{l}\pi {z}^{\prime }}{\pi \left({n}^{2}+{m}^{2}+{\mathcal{l}}^{2}\right)}$

And type B has the same set in the $x$ and $y$ directions, but a discontinuity in slope at $z={z}^{\prime }:$

$G\left(\stackrel{\to }{r},{\stackrel{\to }{r}}^{\prime }\right)=4\sum _{n,m}\mathrm{sin}n\pi x\mathrm{sin}n\pi {x}^{\prime }\mathrm{sin}m\pi y\mathrm{sin}m\pi {y}^{\prime }\frac{\mathrm{sinh}\left({K}_{mn}{z}_{<}\right)\mathrm{sinh}\left({K}_{mn}\left(1-{z}_{>}\right)\right)}{{K}_{mn}\mathrm{sinh}{K}_{mn}},$

where ${K}_{mn}=\pi \sqrt{{m}^{2}+{n}^{2}}.$  Notice that in this sum, unlike that in A, each individual term satisfies  ${\nabla }^{2}f\left(x,y,z\right)=0$ except at the one point $z={z}^{\prime }.$

At that point, the change in slope is

$\frac{1}{{K}_{\mathcal{l}m}\mathrm{sinh}{K}_{\mathcal{l}m}}\left[{K}_{mn}\mathrm{cosh}{K}_{mn}z\mathrm{sinh}\left({K}_{mn}\left(1-z\right)\right)+{K}_{mn}\mathrm{sinh}{K}_{mn}z\mathrm{cosh}\left({K}_{mn}\left(1-z\right)\right)\right]=1,$

from the formula for $\mathrm{sinh}\left(A+B\right).$ This doesn’t depend on ${K}_{mn}$ and is independent of $z,$ because it’s the Wronskian of the two solutions.

(Note on Wronskians (from Wikipedia): Given two solutions ${y}_{1},{y}_{2}$ to the differential equation ${y}^{″}+a\left(x\right){y}^{\prime }+b\left(x\right)y=0,$ it’s easy to check that the Wronskian $W\left(x\right)={y}_{1}{{y}^{\prime }}_{2}-{y}_{2}{{y}^{\prime }}_{1}$ obeys the differential equation ${W}^{\prime }\left(x\right)=a\left(x\right)W\left(x\right).$ )

Therefore, ${\partial }^{2}G\left(\stackrel{\to }{r},{\stackrel{\to }{r}}^{\prime }\right)/\partial {z}^{2}$ has a contribution from the slope change at $z={z}^{\prime }$ equal to

$4\delta \left(z-{z}^{\prime }\right)\sum _{n,m}\mathrm{sin}n\pi x\mathrm{sin}n\pi {x}^{\prime }\mathrm{sin}m\pi y\mathrm{sin}m\pi {y}^{\prime }=\delta \left(x-{x}^{\prime }\right)\delta \left(y-{y}^{\prime }\right)\delta \left(z-{z}^{\prime }\right).$

Bottom line: we’ve gone over this example in some detail because this is the technique used to construct Green’s functions in systems with spherical or cylindrical symmetry: typically, for the radial variable we can multiply together two solution functions, one for the lesser of the two radii is well-behaved at the origin, the other for the greater is well-behaved at infinity. At the point $r={r}^{\prime }$ the variables exchange roles. The consequent discontinuous change in slope (as a function of one of the radii) gives the delta function on differentiating twice.