# Helmholtz Equation in Cartesian Coordinates

• I
• bob012345
In summary, the three equations give three solutions for the displacement u:

#### bob012345

Gold Member
TL;DR Summary
I'm a bit rusty and just want a set of eyes to check me on this solution of the Helmholtz equation for specific given boundary conditions in a defined region of space. Thanks.
So given the Helmholtz equation $$\nabla^2 u(x,y,z) + k^2u(x,y,z)=0$$ we do the separation of variables $$u=u_x(x)u_y(y)u_z(z)= u_xu_yu_z$$ and ##k^2 = k_x^2 + k_y^2 +k_z^2## giving three separate equations; $$\nabla^2_x u_x+ k_x^2 u_x=0$$ $$\nabla^2_y u_y+ k_y^2 u_y=0$$ $$\nabla^2_z u_z+ k_z^2 u_z=0$$ where the solutions are

$$u_x(x)= A_x\sin(k_x x) + B_x\cos(k_x x)$$
$$u_y(y)= A_y\sin(k_y y) + B_y\cos(k_y y)$$
$$u_z(z)= A_z\sin(k_z z) + B_z\cos(k_z z)$$

The given boundary conditions are ##u(x,y,0)=\sin(\pi x)\cos(\pi y)## and ##u(x,y,1)=0## in the region ##0<=x,y<=1##

So I have

$$\sin(\pi x)\cos(\pi y)=(A_x\sin(k_x x) + B_x\cos(k_x x))(A_y\sin(k_y y) + B_y\cos(k_y y))(A_z\sin(k_z 0) + B_z\cos(k_z 0))$$ setting ##B_x,A_y=0## we have

$$sin(\pi x)\cos(\pi y)=A_x\sin(k_x x)B_y\cos(k_y y)B_z$$ forcing the product of the constants=1 and ##k_x,k_y=\pi## Making ##u_x=A_x\sin(\pi x)## and ##u_y=B_y\cos(\pi y)## Then ##u(x,y,1)=0## we have
$$0=A_x\sin(\pi x)B_y\cos(\pi y)(A_z\sin(k_z) +B_z\cos(k_z))$$ but here is where I see several solutions because there aren't enough conditions to completely specify the solution. One solution would be setting ##A_z=0## and ##k_z=\frac{n\pi}{2}## giving ##u_z=B_z\cos(\frac{n\pi z}{2})## then there are infinite solutions of the form
$$u(x,y,z)_n= C_n\sin(\pi x)\cos(\pi y) \cos(\frac{n\pi z}{2})$$ and the most general solution is an infinite sum.

But also, if we set $$A_z=-B_z\frac{\cos(k_z)}{\sin(k_z)}$$ making
$$u_z=-B_z\frac{\cos(k_z)}{\sin(k_z)}\sin(k_z z) + B_z\cos(k_z z)$$ where ##k_z\ne n\pi## also meets the boundary conditions.

Last edited:
Edit, I think it needs to be
$$u_z=B_z\cos\left( (n-\frac{1}{2})\pi z \right)$$ for all integer ##n##

Last edited:
Independent of ##z## ?

##\LaTeX## notes:

use ##\cos## and ##\sin## to get ##\ \cos\ ## and ##\ \sin\ ## instead of ##\ cos\ ## and ##\ sin\ ##
use ## \left (## and ##\right ) ## to allow sizing of brackets $$u_z=B_zcos\left (\left (n- \frac{1}{2}\right )\pi\right )$$
I think nesting should work better, but forgot how to automatically get $$u_z=B_zcos\Biggl (\left (n- \frac{1}{2}\right )\pi\Biggr )$$

• bob012345
BvU said:
Independent of ##z## ?
It's not independent of ##z##. I put it in here

$$u(x,y,z)_n= C_n\sin(\pi x)\cos(\pi y) \cos(\frac{n\pi z}{2})$$ but that should be

$$u(x,y,z)_n= C_n\sin(\pi x)\cos(\pi y)\cos\left( (n-\frac{1}{2})\pi z \right)$$

Last edited:
Yep, with ##C_n = 1## to get ##u(x,y,0)=\sin(\pi x)\cos(\pi y)##.

• bob012345
BvU said:
Yep, with ##C_n = 1## to get ##u(x,y,0)=\sin(\pi x)\cos(\pi y)##.
Thanks, I missed that, the constant is always 1. In fact this boundary condition implies that while the solution could be
$$u(x,y,z)_n=\sin(\pi x)\cos(\pi y)\cos\left( (n-\frac{1}{2})\pi z \right)$$ for any n it cannot be a linear sum of solutions and meet that boundary condition else we would have

$$u(x,y,z)=\sin(\pi x)\cos(\pi y)\left(\cos\frac{\pi z}{2} + \cos\frac{3\pi z}{2} + \cos\frac{5\pi z}{2} + ... \right)$$ which solves the Helmholtz equation but for ##z=0## it gives

$$u(x,y,0)=\sin(\pi x)\cos(\pi y)\left(1 + 1 + 1 + ... \right)$$ which fails the boundary condition (and is infinity...)

Last edited:
BvU said:
Yep, with ##C_n = 1## to get ##u(x,y,0)=\sin(\pi x)\cos(\pi y)##.
I think I went too fast: doesn't$$u(x,y,z)=\sum_n C_n\sin(\pi x)\cos(\pi y)\cos\left( \bigl(n-\frac{1}{2}\bigr)\pi z \right)$$ with ##\displaystyle \sum_n C_n=1## satisfy both the equation and the boundary conditions ? ##\ ##

BvU said:
I think I went too fast: doesn't$$u(x,y,z)=\sum_n C_n\sin(\pi x)\cos(\pi y)\cos\left( \bigl(n-\frac{1}{2}\bigr)\pi z \right)$$ with ##\displaystyle \sum_n C_n=1## satisfy both the equation and the boundary conditions ? ##\ ##
I think now that won't work because the ##k's## have to be the same for all z terms or it fails the Helmholtz equation because there would be cross terms that do not cancel out so a series solution like

$$u(x,y,z)= \sin(\pi x)\cos(\pi y) \sum_n C_n\cos(k_z z)$$ works but there could be different ##k_z's## as before where ##k_z=(m-\frac{1}{2})\pi## for integer ##m## and a different series for each.

• BvU
Paging @Charles Link : do we have a unique solution here, or is there some undeterminedness left over ?

##\ ##

• bob012345
BvU said:
Paging @Charles Link : do we have a unique solution here, or is there some undeterminedness left over ?

##\ ##
This one is not my area of expertise, but @Orodruin can usually give a definitive answer to something like this.

• bob012345
I would set $u = f(z) \sin (\pi x) \cos (\pi y)$ with $f(0) = 1$ and $f(1) = 0$. Then $$f'' + (k^2- 2\pi^2 )f = 0$$ and we will have sinusoidal dependence if $k^2 > 2\pi^2$ and exponential dependence if $k^2 < 2\pi^2$. If $k^2 = 2\pi^2$ then we have $f(z) = 1 - z$. Technically we do not have a unique solution, because no boundary condition is given on $x = 0, 1$ or $y = 0, 1$.

The general method here would be to choose ${k_x}_n$ and ${k_y}_m$ to satisfy the boundary conditions, and for each combination of $n$ and $m$ we solve $$f_{nm}'' + (k^2 - {k_x}^2_n - {k_y}^2_m)f_{nm} = 0$$ subject to $f_{nm}(0) = 1$ and $f_{nm}(1) = 0$.

Last edited:
pasmith said:
I would set $u = f(z) \sin (\pi x) \cos (\pi y)$ with $f(0) = 1$ and $f(1) = 0$. Then $$f'' + (k^2- 2\pi^2 )f = 0$$ and we will have sinusoidal dependence if $k^2 > 2\pi^2$ and exponential dependence if $k^2 < 2\pi^2$. If $k^2 = 2\pi^2$ then we have $f(z) = 1 - z$. Technically we do not have a unique solution, because no boundary condition is given on $x = 0, 1$ or $y = 0, 1$.

The general method here would be to choose ${k_x}_n$ and ${k_y}_m$ to satisfy the boundary conditions, and for each combination of $n$ and $m$ we solve $$f_{nm}'' + (k^2 - {k_x}^2_n - {k_y}^2_m)f_{nm} = 0$$ subject to $f_{nm}(0) = 1$ and $f_{nm}(1) = 0$.
Remember that ##f(z)## must be of the form $$f(z)=A_zsin(k_z z) + B_zcos(k_z z)$$ because it must be a solution of the separated Helmholtz equation ##\nabla^2_z u_z+ k_z^2 u_z=0##.

However, interestingly, one of our previous solutions above was $$u_z=- \frac{\cos(k_z)}{\sin(k_z)}\sin(k_z z) + \cos(k_z z)$$ which for small ##k_z## approximates as $$f(z) ≈ 1 - \frac{1 }{ k_z } k_z z = 1 - z$$