1. PDE

Can someone help me solve this PDE:

ut = uxx - (B^2)u, 0 < x < L, t > 0
u(0,t) = U1, u(L,t) = U2, u(x,0) = f(x)

2. Originally Posted by PvtBillPilgrim
Can someone help me solve this PDE:

ut = uxx - (B^2)u, 0 < x < L, t > 0
u(0,t) = U1, u(L,t) = U2, u(x,0) = f(x)
I will assume that U1 and U2 are constants. First you need to move them to zero. So let $u = v + ax + b$ and let $U1 = 0 + a 0 + b,\;\;\; U2 = 0 + aL + b$ which gives $a\, \text{and}\, b$thus

$u = v + \frac{U2-U1}{L} x + U1$

The problem now changes

$v_t = v_{xx} - B^2\left( v + \frac{U2-U1}{L} x + U1 \right)$

subject to $v(0,t) = 0,\;v(L,t) = 0,\; v(x,0) = f(x) - \frac{U2-U1}{L} x - U1$

If there was no source term then a separation of variables would lead to

$u = \sum_{n=1}^{\infty} b_n e^{\omega^2 t} \sin \omega x,\;\;\; \omega = \frac{n \pi}{L}$

but because of the source term we try

$u = \sum_{n=1}^{\infty} T_n (t) \sin \omega x,\;\;\; \omega = \frac{n \pi}{L}$

sub. into the PDE and group terms accordiong to $\sin w x$. You should get an ODE for $T_n$ which you can solve. Remember, you'll need a sine series for the $B^2\left(\frac{U2-U1}{L} x + U1 \right)$

3. I'm having trouble solving the ODE for Tn. Does anyone know how to do it?