Forced wave equation If a system satisfies the equation $$\nu^2 {\partial^2 \psi\over \partial x^2}={\partial^2 \psi\over \partial t^2}+a{\partial \psi\over \partial t}-b\sin\left({\pi x \over L}\right)\cos\left({\pi \nu t\over L}\right)$$
subjected to conditions: $\psi(0,t)=\psi(L,t)={\partial \psi(x,0)\over \partial t}=0$ and $\psi(x,0)=c\sin\left({\pi x\over L}\right)$,

how might I solve this? I can solve the equation $$\nu^2 {\partial^2 \psi\over \partial x^2}={\partial^2 \psi\over \partial t^2}+a{\partial \psi\over \partial t}$$ by separation of variables. But I don't know how to deal with the $$b\sin\left({\pi x \over L}\right)\cos\left({\pi \nu t\over L}\right)$$ term. Also, what is the "forced component" of $\psi(x,t)$?

Thanks.
There are many methods that work. I prefer to do eigenfunction expansion in $x$ first, but I think you can do Laplace transform in $t$ first too.

To use eigenfunction expansion, make sure you are expanding the variable that is finite. Also, make sure your non-homogeneous boundary conditions have been taken care of before applying the eigenfunction expansion. Fortunately, this problem has homogeneous boundary conditions, so we don't need to deal with that.

First, find all eigenfunctions of the differential operators in the direction with finite domain, which is $x$ in this case. The differential operator in $x$ is

$$M = \frac{\partial^2}{\partial x^2}.$$

To find eigenfunctions, solve the ODE

$$M f(x) = \lambda f(x), f(0) = 0, f(L) = 0.$$

(Note that we NEED homogeneous boundary conditions here.) The conditions $f(0) = f(L) = 0$ will force $\lambda$ to be negative. It is customary to rewrite this as

$$M f(x) = -\lambda^2 f(x), f(0) = 0, f(L) = 0.$$

It turns out $\left(\frac{n\pi}L, \sin\left(\frac{n\pi x}L\right)\right)$ will be your $(\lambda, f)$ pairs for $n = 1, 2, 3, \ldots$. I'll name them $\lambda_n = \frac{n\pi}L$ and $f_n(x) = \sin\left(\frac{n\pi x}L\right)$. Now we know

$$M f_n = -\lambda_n^2 f_n, \qquad n = 1, 2, 3, \ldots.$$

By Sturm-Liouville theory (or just the theory of Fourier series in this case), we can approximate any (nice enough) function $g(x)$ that satisfies $g(0) = g(L) = 0$ by a series of $f_n$. Hence, we assume that all functions in $x$ are expanded as series in $f_n$: Let the solution be expressed as

$$\psi(x, t) = \sum_{n = 1}^\infty \psi_n(t)f_n(x).$$

Also, the non-homogeneous forcing term should be expanded in terms of $f_n$:

$$g(x, t) = -b\sin\left(\frac{\pi x}L\right)\cos\left(\frac{\pi\nu t}L\right) = \sum_{n=1}^\infty g_n(t)f_n(x)$$
$$\text{where } g_n(t) = \frac{2}{L}\int_0^L g(x, t) f_n(x) dx.$$

Fortunately, you are given $g(x, t)$ that matches the frequency of $f_1$, so you can get $g_1(t) = -b\cos\left(\frac{\pi\nu t}L\right)$ and $g_n(t) = 0$ for $n \ne 1$ by just comparing coefficients.

Anyway, now you just plug the expansion back into the PDE

$$\nu^2 M \psi = \frac{\partial^2 \psi}{\partial t^2} + a\frac{\partial \psi}{\partial t} + g(x, t)$$

to get

$$-\nu^2\sum_{n=1}^\infty\lambda_n^2\psi_n(t)f_n(x) = \sum_{n=1}^\infty\psi_n''(t)f_n(x) + a\sum_{n=1}^\infty\psi_n'(t)f_n(x) + \sum_{n=1}^\infty g_n(t)f_n(x).$$

By orthogonality of $f_n$, we can just compare coefficients:

$$-\nu^2\lambda_n^2\psi_n(t) = \psi_n''(t) + a\psi_n'(t) + g_n(t), \qquad n = 1, 2, 3, \ldots$$

This is just an ODE for each $n$. Rearranging gives

$$\psi_n''(t) + a\psi_n'(t) + \nu^2\lambda_n^2\psi_n(t) = -g_n(t).$$

The initial conditions of the PDE must be expanded in terms of $f_n$ to give initial conditions of these ODEs:

$$\psi(x, 0) = \sum_{n=1}^\infty\psi_n(0)f_n(x) = c \sin\left(\frac{\pi x}L\right)$$
$$\therefore \psi_n(0) = \begin{cases}
c &amp; ; n = 1 \\
0 &amp; ; n \ne 1
\end{cases}$$

$$\frac{\partial\psi}{\partial t}(x, 0) = \sum_{n=1}^\infty\psi_n'(0)f_n(x) = 0$$
$$\therefore \psi_n'(0) = 0.$$

Since $\psi_n(0) = \psi_n'(0) = 0$ and $g_n(t) = 0$ when $n &gt; 1$, the uniqueness theorem tells us that $\psi_n(t) = 0$. The only non-trivial case is $n = 1$:

$$\psi_1''(t) + a\psi_1'(t) + \left(\frac{\nu\pi}L\right)^2\psi_1(t) = b\cos\left(\frac{\nu\pi t}L\right), \psi_1(0) = c, \psi_1'(0) = 0.$$

I'll let you solve for $\psi_1$. The final solution will be $\psi(x, t) = \psi_1(t)f_1(x) = \psi_1(t)\sin\left(\frac{\pi x}L\right)$.

Note that the final form of $\psi_1(t)$ depends heavily on $a$. In particular, you need to split into cases: $a &gt; \frac{2\pi\nu}L$, $a = \frac{2\pi\nu}L$, and $a &lt; \frac{2\pi\nu}L$. I believe in most physical problems, you'd have $a &lt; \frac{2\pi\nu}L$. (I assume $a \ge 0$ always.)
It is convenient to assume that $\nu = 1 ,L=\pi$.And $\psi (x,t)= c \phi (t) sin(x)$. So, the equation becomes $\ddot{\phi} + a \dot{\phi} + \phi = b cos(t)$, with initial value $\dot{\phi}(t=0)=0$; $\phi (t=0) = 1$, and this equation maybe easy to solve now.