First, lets try to find a particular solution to the inhomogeneous equation. The rhs of the equation strongly suggests we try something of the form:
U(x,y) = αe^2y sin(x).
I will use the notation Ux to indicate ∂U/∂x, etc.
Uxx = -αe^2y sin(x)
Uyy = 4αe^2y sin(x)
The differential equation tells us
Uxx + Uyy = e^2y sin(x)
-α e^2y sin(x) + 4α e^2y sin(x) = e^2y sin(x)
Solve for α to get
3α = 1
α = 1/3
So our particular solution is
U(x,y) = (1/3) e^2y sin(x)
Next, check to see if this matches the boundary conditions. If it does, then we are all done.
U(0,y) = (1/3)e^2y sin(0) = 0 .............. so the u(0,y) boundary condition is satisfied.
Similarly, the u(π,y) boundary condition is satisfied.
BUT
u(x,0) = (1/3)sin(x) ≠ 0 so the boundary conditions at y = 0 is not satisfied.
The same is true for the y=L boundary condition except for the very special case where
(1/3)e^2L = 1
Since the particular solution does satisfy the y boundary conditions we need to find the general solution to the homogeneous equation. However, because the particular solution does fit the x boundary conditions we don't actually need the general solution for the x partial derivatives.
Now the general solution to
∇^2u(x,y) = 0 is found by separation of variables. Assume u(x,y) = X(x)Y(y). Then
∇^2u = X_xx Y + X Y_yy =0
divide by XY to get
X_xx/X + Y_yy/Y = 0
this can only be true for all x and y if
X_xx/X = -k^2 = - Y_yy/Y
I have chosen to set the constant to k^2 because then the general solutions are sin(kx),cos(kx) and e^ky, e^-ky
Now we know that the boundary conditions at x=0 restrict us to the sin(kx) solution. The BC at x=π means that
sin(kπ) = 0. This is satisfied as long as k is an integer.
So we now have general solutions of the form:
sin(kx)[Ae^-ky + Be^ky]
The BC at y = 0 tells us A+B = 0
So our general solution now looks like
Asin(kx)[e^ky - e^-ky]
I can rewrite this as
Asin(kx) sinh(ky) ....... I've redefined the constant A but that's OK because it still hadn't been determined.
Answers & Comments
Verified answer
Particular solution:
Assume that u(x,y) = A e^(2y) sin x.
Substituting this into the PDE yields
-A e^(2y) sin x + 4A e^(2y) sin x = e^(2y) sin x
==> A = 1/3.
--------------------
Now, let u(x,y) = v(x,y) + (1/3) e^(2y) sin x.
So, the BVP reduces to v_xx + v_yy = 0
with v(0, y) = 0, v(π,y) = 0, v(x,0) = (-1/3) sin x, v(x, L) = [1 - (1/3)e^(2L)] sin x.
We solve this by adding the solutions to v_xx + v_yy = 0 to the individual BVP's
(i) v₁(0, y) = 0, v₁(π,y) = 0, v₁(x,0) = (-1/3) sin x, v₁(x, L) = 0.
(ii) v₂(0, y) = 0, v₂(π,y) = 0, v₂(x,0) = 0, v₂(x, L) = [1 - (1/3)e^(2L)] sin x.
---
Summarizing the separation of variables procedure...
Letting v(x,y) = X(x) Y(y) yields X'' Y + XY'' = 0 ==> X''/X = -Y''/Y = -k^2 (for nonzero solutions).
So, we have
X'' + k^2 X = 0 with X(0) = X(π) = 0
Y'' - k^2 Y = 0
Solving the first ODE yields X_n = sin(nx) with n = 1, 2, 3, ... (and k = n).
--------
For (i), solving Y'' - n^2 Y = 0 with Y(L) = 0 yields Y_n = A cosh(n(y-L)) + B sinh(n(y-L))
(the -L's rearrange the arbitrary constants to make it easier to apply the B.C.)
Since Y(L) = 0, we have A = 0.
==> Y_n = B_n sinh(n(y-L)).
Hence,
v₁(x,y) = Σ(n = 1 to ∞) v_n(x, y), since the PDE is linear and homogeneous
.........= Σ(n = 1 to ∞) B_n sinh(n(y-L)) sin(nx).
Since v₁(x,0) = (-1/3) sin x, we find that
(-1/3) sin x = Σ(n = 1 to ∞) -B_n sinh(nL) sin(nx).
==> -1/3 = -B₁ sinh L ==> B₁ = 1/(3 sinh L) and all other B_n's =0.
Thus, v₁(x,y) = (1/(3 sinh L)) sinh(y-L) sin x.
-------
For (ii), solving Y'' - n^2 Y = 0 with Y(L) = 0 yields Y_n = A cosh(ny) + B sinh(ny)
Since Y(L) = 0, we have A = 0.
==> Y_n = B_n sinh(ny).
Hence,
v₂(x,y) = Σ(n = 1 to ∞) v_n(x, y), since the PDE is linear and homogeneous
.........= Σ(n = 1 to ∞) B_n sinh(ny) sin(nx).
Since v₂(x, L) = [1 - (1/3)e^(2L)] sin x, we find that
[1 - (1/3)e^(2L)] sin x = Σ(n = 1 to ∞) B_n sinh(nL) sin(nx).
==> [1 - (1/3)e^(2L)] = B₁ sinh L ==> B₁ = (1 - (1/3)e^(2L))/sinh L and all other B_n = 0.
Thus, v₂(x,y) = ((1 - (1/3)e^(2L))/sinh L) sinh y sin x.
----------------
So, v(x, y) = v₁(x,y) + v₂(x,y)
.................= [(1/(3 sinh L)) sinh(y-L) + ((1 - (1/3)e^(2L))/sinh L) sinh y] sin x
Finally,
u(x, y) = [(1/(3 sinh L)) sinh(y-L) + ((1 - (1/3)e^(2L))/sinh L) sinh y] sin x + (1/3) e^(2y) sin x.
----------------
I hope this helps!
First, lets try to find a particular solution to the inhomogeneous equation. The rhs of the equation strongly suggests we try something of the form:
U(x,y) = αe^2y sin(x).
I will use the notation Ux to indicate ∂U/∂x, etc.
Uxx = -αe^2y sin(x)
Uyy = 4αe^2y sin(x)
The differential equation tells us
Uxx + Uyy = e^2y sin(x)
-α e^2y sin(x) + 4α e^2y sin(x) = e^2y sin(x)
Solve for α to get
3α = 1
α = 1/3
So our particular solution is
U(x,y) = (1/3) e^2y sin(x)
Next, check to see if this matches the boundary conditions. If it does, then we are all done.
U(0,y) = (1/3)e^2y sin(0) = 0 .............. so the u(0,y) boundary condition is satisfied.
Similarly, the u(π,y) boundary condition is satisfied.
BUT
u(x,0) = (1/3)sin(x) ≠ 0 so the boundary conditions at y = 0 is not satisfied.
The same is true for the y=L boundary condition except for the very special case where
(1/3)e^2L = 1
Since the particular solution does satisfy the y boundary conditions we need to find the general solution to the homogeneous equation. However, because the particular solution does fit the x boundary conditions we don't actually need the general solution for the x partial derivatives.
Now the general solution to
∇^2u(x,y) = 0 is found by separation of variables. Assume u(x,y) = X(x)Y(y). Then
∇^2u = X_xx Y + X Y_yy =0
divide by XY to get
X_xx/X + Y_yy/Y = 0
this can only be true for all x and y if
X_xx/X = -k^2 = - Y_yy/Y
I have chosen to set the constant to k^2 because then the general solutions are sin(kx),cos(kx) and e^ky, e^-ky
Now we know that the boundary conditions at x=0 restrict us to the sin(kx) solution. The BC at x=π means that
sin(kπ) = 0. This is satisfied as long as k is an integer.
So we now have general solutions of the form:
sin(kx)[Ae^-ky + Be^ky]
The BC at y = 0 tells us A+B = 0
So our general solution now looks like
Asin(kx)[e^ky - e^-ky]
I can rewrite this as
Asin(kx) sinh(ky) ....... I've redefined the constant A but that's OK because it still hadn't been determined.
Finally the BC at y = L is
Asin(kx) sinh(kL) = sin(x).
This tells us that k=1 and
A sinh(2L) = 1
A = 1/sinh(2L)