Solution (source code)

= Solution

Here $\lambda=7/2$ and $\alpha_n=n$. Let
$$
I_n=\int_0^\pi e^{-x}\sin(nx)\,dx,\qquad
J_n=\int_0^\pi e^{-x}\cos(nx)\,dx.
$$
Two applications of <integration by parts> give
$$
I_n=nJ_n,\qquad
J_n=1-(-1)^ne^{-\pi}-nI_n.
$$
Solving these equations,
$$
I_n=\frac{n[1-(-1)^ne^{-\pi}]}{1+n^2},\qquad
f_n=\frac{2n[1-(-1)^ne^{-\pi}]}{\pi(1+n^2)}.
$$
Consequently the required amplitudes are
$$
\boxed{A_n=
\begin{cases}
\displaystyle\frac{2n[1-(-1)^ne^{-\pi}]}{\pi(1+n^2)\sqrt{49/4-n^2}},&1\leq n\leq3,\\[6pt]
\displaystyle\frac{2n[1-(-1)^ne^{-\pi}]}{\pi(1+n^2)\sqrt{n^2-49/4}},&n\geq4.
\end{cases}}
$$
The stated initial <velocity> is nonzero at the fixed endpoints, whereas a classical solution differentiable there would require zero endpoint <velocity>. Thus it is understood on the open interval, or as an <L2 space> initial datum in the usual finite-energy solution. Its <Fourier sine series> takes value zero at the endpoints; this changes no initial <energy> or interior initial data.