# Finding a solution to Laplace's equation

Tags:
1. Dec 2, 2015

### H Smith 94

So here I have Laplace's equation with non-homogeneous, mixed boundary conditions in both $x$ and $y$.

1. The problem statement, all variables and given/known data

Solve Laplace's equation $$\label{eq:Laplace}\nabla^2\phi(x,y)=0$$ for the following boundary conditions:
1. $\phi(0, y)=2$;
2. $\phi(1, y)=0$;
3. $\phi(x, 0)=0$;
4. $\frac{\partial}{\partial y}\phi(x,1)=1$.
Here, $\phi$ is the potential.

2. Relevant equations

In two dimensions:$$\nabla^2 = \frac{\partial^2}{\partial x^2} + \frac{\partial^2}{\partial y^2}.$$

3. The attempt at a solution

As far as I can tell, a solution exists in $$\label{eq:phi1}\phi(x,y)=\phi_0(x) + \Delta\phi(x,y),$$ where $\phi_0(x)$ satisfies the $x$-boundaries, in that $$\phi_0(x)=A_0+B_0 x$$ and $\Delta\phi(x,y)$ satisfies the $y$-boundaries, with a separable solution of the form $$\Delta\phi(x,y)=\sum_{n}\chi_n(x)\gamma_n(y).$$

Applying boundary condition 1: $$\phi_0(0,y) = 2 \implies \boxed{A_0 = 2},$$ so now $\phi_0= 2+B_0 x$.

Applying boundary condition 2: $$\phi_0(1,y) = 2+ B_0 = 0 \implies \boxed{B_0 = -2}.$$ Hence, have that $$\phi_0(x,y) = 2-2x.$$

Now, equation $\ref{eq:phi1}$ can be substituted into Laplace's equation ($\ref{eq:Laplace}$) to yield $$\frac{\partial^2\Delta\phi(x,y)}{\partial x^2} + \frac{\partial^2\Delta\phi(x,y)}{\partial y^2} = 0.$$ This has the separable solution in $\Delta\phi(x,y) = \chi(x)\gamma(y)$: $$\frac{\mathrm{d}^2\chi}{\mathrm{d}x^2} = \kappa \chi(x) \\ \frac{\mathrm{d}^2\gamma}{\mathrm{d}y^2} = -\kappa \gamma(y)$$ so that \begin{align}\chi(x) = E \cos{\kappa x} + F \sin{\kappa x} \\ \gamma(y) = G e^{\kappa y} + H e^{-\kappa y}, \end{align} for which I found using the homogeneous boundary conditions produced from $\phi_0(x)$ that $F = -E$ and, in turn, $E = 0$ -- so $$\chi(x) = 0\ \forall x \implies \boxed{\Delta\phi(x,y) = 0}$$ and so $$\boxed{\boxed{\phi(x,y)=2 - 2x}},$$ which just cannot be correct!

I have tried solving the solution directly using separation of variables with all types of attempted forms of solutions and---after pages and pages of working---have come up with nothing. I feel like there's a very simple but essential point I'm missing here.

Last edited: Dec 2, 2015
2. Dec 2, 2015

### Orodruin

Staff Emeritus
You are fine until the point you claim that the homogeneous boundary conditions give $E = - F = 0$. This is not correct.

3. Dec 2, 2015

### H Smith 94

Hi!

For this step, I used the boundary conditions $\Delta\phi(0,y) = \Delta\phi(1,y) = 0$, originating from 1 and 2. Was this incorrect?

4. Dec 2, 2015

### Orodruin

Staff Emeritus
No, that is correct. Your solution of the resulting equations is not.

5. Dec 2, 2015

### H Smith 94

Right you are!

I had that $e^{\xi} - e^{-\xi} = 2 \cosh{\xi}$—which would imply the only way $\chi(1)=0$ is if $E = 0$ since $\cosh{x}\not=0$ for any $x$—when instead, $e^{\xi} - e^{-\xi} = 2 \sinh{\xi} \implies e^{\kappa x} - e^{-\kappa x} = 2 \sinh{\kappa x}$, so $$\chi(x) = 2E \sinh{\kappa x}$$ which means $$\chi(1) = 2E\sinh{\kappa} = 0$$ which is only true for either $E = 0$ (trivial) or for $\kappa = 0$.

Fig 1.
Blue line is $\sinh{x}$; red line is $\cosh{x}$.​

Does this look like a good place to continue from? The implications of $\kappa = 0$ on $\gamma(y)$ also worries me.

6. Dec 2, 2015

### Orodruin

Staff Emeritus
No, you are not using the actual form you wrote down for the solution in the x-direction. Also remember that you must check all values of $\kappa$.

There is also an error in your solution, the argument of the functions is not $\kappa x$, this would give $\kappa^2$ as a factor when differentiating twoce instead of $\kappa$, which is in your differential equations.

7. Dec 2, 2015

### H Smith 94

Oh yes! I hadn't even noticed that! Thank you for pointing this out.

This was a typo on my part -- sorry! I also should have the opposite signs on the $\kappa$ for each $x$ and $y$ solution in order to adequately satisfy the solutions $\chi$ and $\gamma$ I gave.

Thank you for all your help -- you've been of great assistance!

8. Dec 2, 2015

### H Smith 94

Solution:
For anyone reading this who is interested in the solution:

Applying the new homogeneous boundary conditions in $x$:
1. $\Delta\phi(0,y) = 0 \implies \boxed{F = 0};$
2. $\Delta\phi(1,y) = 0 \implies \boxed{\kappa = n \pi}$ for $n\in\mathbb{N}$.
means that $$\chi(x) = E \sin{n\pi x}.$$ We can hence determine $G$ and $H$ using the original boundary conditions 3 and 4. 3 finds that $\boxed{A = -B}$, so $$\gamma(y) = A\sinh{n\pi y}.$$ Hence, using the separable solution and summing over all possible (infinite) solutions, we find that $$\label{eq:phisol} \boxed{\boxed{ \Delta\phi(x,y) = \lim_{M\rightarrow\infty} \sum_{n=1}^{M} c_n\,\sin{n\pi x}\, \sinh{n\pi y} }},$$ where $c_n \equiv A_nE_n$ and $M$ is simply included for a computational application.

Now, we use 4 to calculate the $c_n$ coefficient. We differentiate \ref{eq:phisol}, apply Fourier's trick (as David J. Griffiths calls it) and hence find that $$\label{eq:cnsol} \boxed{ \boxed{ c_n = \frac{ 2 (1 - \cos{ n \pi }) }{ ( n \pi )^2 \cosh{ n \pi } } } }.$$

Using this solutions, we find that for $M = 20$, the potential looks like the attached graph.

#### Attached Files:

• ###### Potential.png
File size:
13.1 KB
Views:
31
Last edited: Dec 2, 2015