Note: the boundary and initial conditions that are inconsistent at left end (but this is how the problem is, from the
textbook, so please do not blame me).

Solution

This problem has nonhomogeneous B.C. and non-homogenous in the PDE itself (source present). First step is to use
reference function to remove the nonhomogeneous B.C. then use the method of eigenfunction expansion on the resulting
problem.

Let

At , hence and at , hence or , hence

Therefore

Where solution for the given PDE but with homogeneous B.C., therefore

We now solve (1). This is homogeneous in the PDE itself. To solve, we first solve the nonhomogeneous PDE in order
to find the eigenfunctions. Hence we need to solve

This has solution

(2)

With

Plug-in (2) back into (1) gives

But , hence the above becomes

Therefore, since Fourier series expansion is unique, we can compare coefficients and obtain