# Thread: Solving a wave equation with inhomogeneous boundary conditions

1. ## Solving a wave equation with inhomogeneous boundary conditions

Question: Solve the wave equation (1) on the region 0<x<2 subject to the boundary conditions (2) and the initial condition (3) by separation of variables.

(1) $\displaystyle \frac{\partial^2 u}{\partial t^2}=c^2\frac{\partial^2 u}{\partial x^2}$

(2) $\displaystyle \frac{\partial u}{\partial x}(0,t)=1$ ; $\displaystyle \frac{\partial u }{\partial x}(2,t)=1$

(3) $\displaystyle \frac{\partial u}{\partial t}(x,0)=0$

I've defined $\displaystyle \theta(x,t)=u(x,t)-u_{st}(x) = u(x,t)-x-h(t)$ where u_st is the steady state solution (the solution to $\displaystyle \frac{\partial^2 u}{\partial x^2} = 0$ subject to (2)). I've used this to create a new PDE with homogeneous boundary conditions.

The PDE is:

$\displaystyle \frac{\partial^2 \theta}{\partial t^2} + h''(t)=c^2 \frac{\partial^2 \theta}{\partial x^2}$.

By subbing in $\displaystyle \theta=f(t)g(x)$ I get:

$\displaystyle f''(t)g(x)+h''(t)=c^2 f(t) g''(x)$

I'm not sure how to separate this into two ODEs. Can someone help?

2. Errrr... That trick you tried does not apply here. For the method of separation of variables, set u(x,t)=X(x)T(t) to construct two ODEs, then add up all the solutions. It must be in your notes.

3. Thanks but I already realised my mistake:

h is a constant, not a function of t.