**Additional note (May 4, 2013)**: Note that this problem has

*inhomogeneous* boundary conditions. Remember that when you perform eigenfunction expansions with the adjoint eigenfunctions, then these adjoint functions are found relative to homogeneous boundary conditions. See the page on adjoints

here.

How do we obtain the coefficients of the eigenfunction expansion? Let us first place the ODE into the form
\[
(y'' + 2y' + y) + y = \mathcal{L} y + y = 1.
\]

Now we profit from the orthogonality with the adjoint eigenfunctions found in part b. Taking the inner product with the adjoint eigenfunctions found earlier, $w_k$, gives
\[
\langle w_k, \mathcal{L} y \rangle + \langle w_k, y \rangle = \langle w_k, 1 \rangle.
\]

Using the boundary values of $y$, we get for first and last term
\begin{align*}
\langle w_k, \mathcal{L} y \rangle &= 3w_k(1) - 2w_k(0) - \lambda_k c_k \langle w_k, y_k \rangle \\
\langle w_k, 1 \rangle &= \frac{(-1)^k e - 1}{1 + (k\pi)^2}
\end{align*}

We now use the fact that
\[
\langle w_k, y_k \rangle = \int_0^1 \cos^2 (k \pi x) \, dx = \begin{cases}
1/2 & k \neq 0 \\
1 & k = 0
\end{cases} = \frac{d_k}{2}
\]

where $d_k$ is defined in the obvious way. Then using the boundary values of $w_k$, we get
\[
3e (-1)^k - 2 + \frac{d_k}{2} c_k (1 - (k \pi)^2) = \frac{(-1)^k e - 1}{1 + (k\pi)^2}.
\]

This allows us to solve for $c_k$
\[
c_k = - \frac{1}{d_k} \frac{2}{1 - (k \pi)^2} \left[ 3e (-1)^k - 2 - \frac{(-1)^k e - 1}{1 + (k \pi)^2} \right],
\]

where we set $d_k = 1$ for $k = 1, 2, \ldots$. For the special case that $k = 0$, we have $d_k = 2$ and
\[
c_0 = 2e + 1.
\]