$U_{xx}-sU=-1$, $U(0,s)=U(1,s)=0$
Where $U(x,s)$ is the Laplace transform of $u(x,t)$
I 'm wondering how to show that:
The solution is, therefore $U(x,s)=\frac{1}{s(e^{\sqrt{s}}-e^{-\sqrt{s}})}[e^{\sqrt{s}}-e^{-\sqrt{s}}+(e^{\sqrt{s}}-1)e^{\sqrt{s}x}-(e^{\sqrt{s}}-1)e^{-\sqrt{s}x}]$ (97)
Page 27, PDE equations, Analytical solution techniques, J. Kevorkian.
I tried following the methods in the preceding pages, but don't see how they got it.
We'll treat the $s$ as a constant, so this is a constant coefficient linear ODE with independent variable $x$ and unknown function $U(x,s)$. This type of equation can be solved by complimentary and particular solutions. The complimentary solution should solve the associated homogeneous equation $$ V_{xx}-sV=0, $$ which is now a constant coefficient linear homogeneous ODE, solvable by trying a guessed form of a solution $V=e^{\lambda x}$, often called an ansatz: $$ V_{xx}-sV= (\lambda^2 - s)e^{\lambda x} = 0. $$ This equation is satisfied when $\lambda=\pm\sqrt{s}$, leading to two solutions, any linear combination of which will satisfy the homogeneous equation. So, we have $$ V(x,s) = c_1e^{-x\sqrt{s}} + c_2e^{x\sqrt{s}} = a(s)e^{-x\sqrt{s}} + b(s)e^{x\sqrt{s}} $$ Note that the two "constants" need only be constants in the variable $x$, so a general $s$ dependency is allowed, leading to the most general form of the complimentary solution.
Now, we need to find the particular solution, which solves $$ W_{xx}-sW=-1 $$ The standard rule of finding particular solutions says you should try a general form of the right-hand side (called the method of undetermined coefficients); in this case, the right-hand side is a constant in $x$, so an unknown constant is what should be tried as a solution, $W(x,s) = c(s)$, which is an unknown constant in $x$ but is allowed to vary in $s$. We plug that into the equation above $$ \frac{\partial^2 c(s)}{\partial x^2} - s c(s) = -1 $$ $$ -sc(s) = -1 \;\Rightarrow\; c(s) = \frac{1}{s} $$ So now we have the particular solution, $W(x,s) = \frac{1}{s}$. The full solution is the complimentary plus the particular solution, $U = V + W$, $$ U(x,s) = a(s)e^{-x\sqrt{s}} + b(s)e^{x\sqrt{s}} + \frac{1}{s} $$
Now, we have to fix those two free parameters $a(s)$ and $b(s)$ by using the given boundary values, $U(0,s)=U(1,s)=0$. So we plug the form above into these two conditions: $$ U(0,s) = a(s) + b(s) + \frac{1}{s} = 0 $$ $$ U(1,s) = a(s)e^{-\sqrt{s}} + b(s)e^{\sqrt{s}} + \frac{1}{s} = 0 $$
These are two equations in two unknowns, so solve the first one for $b(s)$ $$ b(s) = -a(s) - \frac{1}{s} $$ and plug into the second one $$ a(s)e^{-\sqrt{s}} + \left(-a(s) - \frac{1}{s}\right)e^{\sqrt{s}} + \frac{1}{s} = 0 $$ $$ a(s)e^{-\sqrt{s}} - a(s)e^{\sqrt{s}} - \frac{1}{s}e^{\sqrt{s}} + \frac{1}{s} = 0 $$ $$ a(s)\left(e^{-\sqrt{s}} - e^{\sqrt{s}}\right) - \frac{1}{s}\left(e^{\sqrt{s}} - 1\right) = 0, $$ which can be solved for $a(s)$ as $$ a(s) = \frac{e^{\sqrt{s}} - 1}{s \left(e^{-\sqrt{s}} - e^{\sqrt{s}}\right)} $$ Now we plug that back into the equation for $b(s)$ to get $$ b(s) = -a(s) - \frac{1}{s} = -\frac{e^{\sqrt{s}} - 1}{s \left(e^{-\sqrt{s}} - e^{\sqrt{s}}\right)} - \frac{1}{s} $$ and simplify this $$ b(s) = -\frac{e^{\sqrt{s}} - 1}{s \left(e^{-\sqrt{s}} - e^{\sqrt{s}}\right)} - \frac{e^{-\sqrt{s}} - e^{\sqrt{s}}}{s\left(e^{-\sqrt{s}} - e^{\sqrt{s}}\right)} $$ $$ b(s) = \frac{-e^{\sqrt{s}} + 1 - e^{-\sqrt{s}} + e^{\sqrt{s}}}{s \left(e^{-\sqrt{s}} - e^{\sqrt{s}}\right)} $$ $$ b(s) = \frac{1 - e^{-\sqrt{s}}}{s \left(e^{-\sqrt{s}} - e^{\sqrt{s}}\right)} $$
Now that $a$ and $b$ have been fixed by the boundary condition, we have the solution $$ U(x,s) = \frac{e^{\sqrt{s}} - 1}{s \left(e^{-\sqrt{s}} - e^{\sqrt{s}}\right)} e^{-x\sqrt{s}} + \frac{1 - e^{-\sqrt{s}}}{s \left(e^{-\sqrt{s}} - e^{\sqrt{s}}\right)} e^{x\sqrt{s}} + \frac{1}{s} $$ Further simplification is required to get that in the same form as your reference $$ U(x,s) = \frac{e^{\sqrt{s}} - 1}{s \left(e^{-\sqrt{s}} - e^{\sqrt{s}}\right)} e^{-x\sqrt{s}} + \frac{1 - e^{-\sqrt{s}}}{s \left(e^{-\sqrt{s}} - e^{\sqrt{s}}\right)} e^{x\sqrt{s}} + \frac{e^{-\sqrt{s}} - e^{\sqrt{s}}}{s\left(e^{-\sqrt{s}} - e^{\sqrt{s}}\right)} $$ $$ U(x,s) = \frac{1}{s \left(e^{-\sqrt{s}} - e^{\sqrt{s}}\right)} \left[ \left(e^{\sqrt{s}} - 1\right) e^{-x\sqrt{s}} + \left(1 - e^{-\sqrt{s}}\right) e^{x\sqrt{s}} + e^{-\sqrt{s}} - e^{\sqrt{s}} \right] $$
This is getting awfully close to what you wrote, but I suspect you have at least one sign error when you copied the solution from the book, and it's possible that I dropped a minus sign somewhere. Nevertheless, the method I provided is how to solve the problem and I encourage you to carefully follow the method and check all the signs to arrive at the final answer.