# [SOLVED]Laplace equation

#### dwsmith

##### Well-known member
Consider Laplace's equation $\nabla^2u = 0$ on the rectangle with the following boundary conditions:
$$u_y(x,0) = f(x)\quad u(L,y) = 0\quad u(x,H) = 0\quad u(0,y) = g(y).$$

How does one of the boundary conditions being defined by a derivative alter the solving of this problem? I have never done a Laplace equation with derivative BC.

#### Sudharaka

##### Well-known member
MHB Math Helper
Consider Laplace's equation $\nabla^2u = 0$ on the rectangle with the following boundary conditions:
$$u_y(x,0) = f(x)\quad u(L,y) = 0\quad u(x,H) = 0\quad u(0,y) = g(y).$$

How does one of the boundary conditions being defined by a derivative alter the solving of this problem? I have never done a Laplace equation with derivative BC.
Hi dwsmith,

Let me suggest a way to solve this problem. The first boundary condition is redundant and you can replace it with $$u(x,0)=h(x)$$. Then you will have to solve the Laplace's equation separately for boundary conditions,

$u_{1}(x,0) = f(x)\quad u_{1}(L,y) = 0\quad u_{1}(x,H) = 0\quad u_{1}(0,y) = 0$

and

$u_{2}(x,0) = 0\quad u_{2}(L,y) = 0\quad u_{2}(x,H) = 0\quad u_{2}(0,y) = g(y)$

The solution to the original problem will then be,

$u(x,y)=u_{1}(x,y)+u_{2}(x,y)$

Further details of this method can be found >>here<<.

Kind Regards,
Sudharaka.

#### dwsmith

##### Well-known member
Hi dwsmith,

Let me suggest a way to solve this problem. The first boundary condition is redundant and you can replace it with $$u(x,0)=h(x)$$. Then you will have to solve the Laplace's equation separately for boundary conditions,

$u_{1}(x,0) = f(x)\quad u_{1}(L,y) = 0\quad u_{1}(x,H) = 0\quad u_{1}(0,y) = 0$

and

$u_{2}(x,0) = 0\quad u_{2}(L,y) = 0\quad u_{2}(x,H) = 0\quad u_{2}(0,y) = g(y)$

The solution to the original problem will then be,

$u(x,y)=u_{1}(x,y)+u_{2}(x,y)$

Further details of this method can be found >>here<<.

Kind Regards,
Sudharaka.
So we can disregard the fact that it is a partial derivative?

#### Sudharaka

##### Well-known member
MHB Math Helper
So we can disregard the fact that it is a partial derivative?
I think you are referring to the first boundary condition. When you differentiate $$u(x,y)$$ with respect to $$y$$ and then substitute $$y=0$$ it is obvious that you get a function of $$x$$ since we have substituted for $$y$$. Hence I don't see any usefulness in that boundary condition. In other words, even if it's not given we know that $$u_{y}(x,0)=\mbox{a function of }x$$. So we don't know anything about $$u(x,0)$$ except the fact that it's a function of $$x$$.

#### chisigma

##### Well-known member
Consider Laplace's equation $\nabla^2u = 0$ on the rectangle with the following boundary conditions:
$$u_y(x,0) = f(x)\quad u(L,y) = 0\quad u(x,H) = 0\quad u(0,y) = g(y).$$

How does one of the boundary conditions being defined by a derivative alter the solving of this problem? I have never done a Laplace equation with derivative BC.
The 'classical' approach permits to find a solution in the form...

$\displaystyle u(x,y)= v(x)\ w(y)$ (1)

... and consists in several steps. The first step is to compute from (1)...

$\displaystyle \frac{\partial^{2} u}{\partial^{2} x}= v^{'\ '} (x)\ w(y)\ ,\ \frac{\partial^{2} u}{\partial^{2} y}= v(x)\ w^{'\ '} (y)\$ (2)

... that permits to write the original PDE as a pair of ODE...

$\displaystyle \frac{v^{'\ '}(x)}{v(x)}= - \frac{w^{'\ '}(y)}{w(y)}= \lambda$ (3)

... where $\lambda$ is a constant. Then, as suggested by Sudharaka,You set $u(x,y)= u_{1}(x,y)+u_{2}(x,y)$ and solve separately the two PDE...

$\displaystyle \nabla^2 u_{1} = 0\ ,\ u_{1}(x,0)= f(x)\ ,\ u_{1}(L,y)= 0\ ,\ u_{1}(x,H)= 0\ ,\ u_{1}(0,y)= 0$

$\displaystyle \nabla^2 u_{2} = 0\ ,\ u_{2}(x,0)= 0\ ,\ u_{2}(L,y)= 0\ ,\ u_{2}(0,y)= 0\ ,\ u_{2}(0,y)= g(y)$ (4)

Other details will be given in a successive post...

Kind regards

$\chi$ $\sigma$

#### dwsmith

##### Well-known member
I solved for $u_1$. To solve for $u_2$, I just need to swap x and y and make the substitution $x^* = L - x$.
Is $u_1$ correct and the approach for $u_2$ correct as well?

If we integrate the first boundary condition, we will have $u(x,y) = yf(x) + h(x)$.
Adding in the fact that $y = 0$, tells us that $u(x,0) = h(x)$.
Therefore, we can solve the equation with the following boundary conditions:
$$u(x,0) = h(x)\quad u(L,y) = 0\quad u(x,H) = 0\quad u(0,y) = g(y).$$
The general solution for the generic boundary conditions of $u(x,0) = 0, u(L,y) = 0, u(x,H) = f(x),$ and $u(0,y) = 0$ is
$$\sum_{n = 1}^{\infty}A_n\sin\lambda_n x\sinh\lambda_n y,$$
where $\lambda_n = \frac{n\pi}{L}$ and
$$A_n = \frac{2}{L\sinh\lambda_n H}\int_0^Lf(x)\sin\lambda_n xdx.$$
For the boundary conditions $u(x,0) = h(x), u(L,y) = 0, u(x,H) = 0$, and $u(0,y) = 0$, we need to make the change of coordinates $x = x^*$ and $y^* = H - y$.
Therefore,
$$u_1(x,y) = \sum_{n = 1}^{\infty}A_n\sin\lambda_n x\sinh[\lambda_n (H - y)]$$
where $\lambda_n = \frac{n\pi}{L}$ and
$$A_n = \frac{2}{L\sinh\lambda_n H}\int_0^Lh(x)\sin\lambda_n xdx.$$

#### dwsmith

##### Well-known member
Here is the full solution I obtained (Is it correct?):
$$u(x,y) = \sum_{n=1}^{\infty}\left[A_n\sin\frac{n\pi x}{L}\sinh\left(\frac{n\pi}{L}(H-y)\right) + B_n\sin\frac{n\pi y}{H}\sinh\left(\frac{n\pi}{H}(L-x)\right)\right]$$
where
$$A_n = \frac{2}{L\sinh\frac{n\pi H}{L}}\int_0^Lh(x)\sin\frac{n\pi x}{L}dx$$
and
$$B_n = \frac{2}{H\sinh\frac{n\pi L}{H}}\int_0^Hg(y)\sin\frac{n\pi y}{H}dy$$

#### dwsmith

##### Well-known member
Here is the full solution I obtained (Is it correct?):
$$u(x,y) = \sum_{n=1}^{\infty}\left[A_n\sin\frac{n\pi x}{L}\sinh\left(\frac{n\pi}{L}(H-y)\right) + B_n\sin\frac{n\pi y}{H}\sinh\left(\frac{n\pi}{H}(L-x)\right)\right]$$
where
$$A_n = \frac{2}{L\sinh\frac{n\pi H}{L}}\int_0^Lh(x)\sin\frac{n\pi x}{L}dx$$
and
$$B_n = \frac{2}{H\sinh\frac{n\pi L}{H}}\int_0^Hg(y)\sin\frac{n\pi y}{H}dy$$
My solution is in terms of $h(x)$ not $f(x)$ though. How can I get back $f(x)$?

#### Sudharaka

##### Well-known member
MHB Math Helper
If we integrate the first boundary condition, we will have $u(x,y) = yf(x) + h(x)$.
This is incorrect. You have,

$u_{y}(x,0)=\left.\frac{\partial}{\partial y}u(x,y)\right|_{y=0}=f(x)$

You cannot integrate this to obtain, $$u(x,y)$$ because there is a substitution $$y=0$$. Of course you can write,

$\int u_{y}(x,0)\,\partial y=\int\left.\frac{\partial}{\partial y}u(x,y)\right|_{y=0}\,\partial y=yf(x)+h(x)$

but I don't think this will give you any useful information.

#### dwsmith

##### Well-known member
This is incorrect. You have,

$u_{y}(x,0)=\left.\frac{\partial}{\partial y}u(x,y)\right|_{y=0}=f(x)$

You cannot integrate this to obtain, $$u(x,y)$$ because there is a substitution $$y=0$$. Of course you can write,

$\int u_{y}(x,0)\,\partial y=\int\left.\frac{\partial}{\partial y}u(x,y)\right|_{y=0}\,\partial y=yf(x)+h(x)$

but I don't think this will give you any useful information.
Ok so what do I do then?

#### Sudharaka

##### Well-known member
MHB Math Helper
Ok so what do I do then?
I think you should read >>this<< to understand how to solve a Laplace's equation with three homogeneous boundary conditions. Examples 1 and 2 provides you a complete walk through, so I don't want to write them again here.

#### dwsmith

##### Well-known member
I think you should read >>this<< to understand how to solve a Laplace's equation with three homogeneous boundary conditions. Examples 1 and 2 provides you a complete walk through, so I don't want to write them again here.
The problem isn't solving the equation. The problem is the $u_y$ piece.

#### Sudharaka

##### Well-known member
MHB Math Helper
The problem isn't solving the equation. The problem is the $u_y$ piece.
Please read posts #2 and #5 carefully. There is no need to do anything with the first boundary condition and the problem is equivalent to solving the two equations,

$\displaystyle \nabla^2 u_{1} = 0\ ,\ u_{1}(x,0)= f(x)\ ,\ u_{1}(L,y)= 0\ ,\ u_{1}(x,H)= 0\ ,\ u_{1}(0,y)= 0$

and

$\displaystyle \nabla^2 u_{2} = 0\ ,\ u_{2}(x,0)= 0\ ,\ u_{2}(L,y)= 0\ ,\ u_{2}(0,y)= 0\ ,\ u_{2}(0,y)= g(y)$

The final solution will be,

$u(x,y)=u_{1}(x,y)+u_{2}(x,y)$

#### dwsmith

##### Well-known member
Please read posts #2 and #5 carefully. There is no need to do anything with the first boundary condition and the problem is equivalent to solving the two equations,

$\displaystyle \nabla^2 u_{1} = 0\ ,\ u_{1}(x,0)= f(x)\ ,\ u_{1}(L,y)= 0\ ,\ u_{1}(x,H)= 0\ ,\ u_{1}(0,y)= 0$

and

$\displaystyle \nabla^2 u_{2} = 0\ ,\ u_{2}(x,0)= 0\ ,\ u_{2}(L,y)= 0\ ,\ u_{2}(0,y)= 0\ ,\ u_{2}(0,y)= g(y)$

The final solution will be,

$u(x,y)=u_{1}(x,y)+u_{2}(x,y)$
So it is wont affect the solution to let $u(x,0) = f(x)$ and solve it as the condition $u_y(x,0)=f(x)$ isn't there?

#### Sudharaka

##### Well-known member
MHB Math Helper
So it is wont affect the solution to let $u(x,0) = f(x)$ and solve it as the condition $u_y(x,0)=f(x)$ isn't there?
Correct.

#### dwsmith

##### Well-known member
So I have as my final solution. Correct?

$$A_n = \frac{2}{L\sinh\frac{n\pi H}{L}}\int_0^Lf(x)\sin\frac{n\pi x}{L}dx.$$

$$B_n = \frac{2}{H\sinh\frac{n\pi L}{H}}\int_0^Hg(y)\sin\frac{n\pi y}{H}dy.$$

$$u(x,y) = u_1 + u_2 = \sum_{n = 1}^{\infty}\left[A_n\sin\frac{n\pi x}{L}\sinh\left[\frac{n\pi}{L} (H - y)\right] + B_n\sin\frac{n\pi y}{H}\sinh\left[\frac{n\pi}{H}(L - x)\right]\right]$$