For any $u_0,u_1\in L^2(0,\pi)$ and $f\in L^2((0,\pi)\times(0,+\infty))$ find using separation of variables and Fourier series a formal explicit expression of the solution of the problem
$u_{tt}-u_{xx}=f(x,t)$ for $(x,t)\in(0,\pi)\times(0,+\infty),$
$u(x,0)=u_0(x),u_t(x,0)=u_1(x)$ for any $x\in(0,\pi)$
$u(0,t)=u(\pi,t)=0,$ for any $t\in(0,+\infty)$
I do easily when it deals with first derivative, this problem bothering me but this is very important for me for qualifying so please could you solve it for me...
Write down eigenvalues and eigenfunctions solving the Sturm-Liouville problem $\{LX=\lambda X, \;X\in D_L\}$ for a self-adjoint ordinary differential operator $$ \begin{align*} L=\frac{d\,}{dx^2}\colon D_L=\{v\in H^2(0,\pi)\colon v(0)=v(\pi)=0\}\subset L^2(0,\pi)\to L^2(0,\pi)\}\\ X_n=\sin{(nx)},\;\;\lambda_n=-n^2,\;\;n\geqslant 1. \end{align*} $$
Expanding the desired solution $u\,$ w.r.t. the orthogonal basis $\{X_n\}$ in $L^2(0,\pi)$ construct solution in the form of Fourier series $$ u(x,t)=\sum_{n=1}^{\infty}T_n(t)\sin{(nx)},\quad T_n(t)=\frac{(u,X_n)}{\|X_n\|^2}= \frac{2}{\pi}\int\limits_0^{\pi}u(x,t)\sin{(nx)}\,dx,\;\;n\geqslant 1, $$ with notation $(\cdot,\cdot)$ standing for the inner product in $L^2(0,\pi)$. Fourier coefficients $T_n=T_n(t)$ are to be found by solving Cauchy problems $$ \begin{align*} T_n''-\lambda_n T_n=f_n(t)=\frac{(f,X_n)}{\|X_n\|^2}= \frac{2}{\pi}\int\limits_0^{\pi}f(x,t)\sin{(nx)}\,dx,\\ T_n(0)=\alpha_n\overset{\rm def}{=}\frac{(u_0,X_n)}{\|X_n\|^2}= \frac{2}{\pi}\int\limits_0^{\pi}u_0(x)\sin{(nx)}\,dx,\\ T'_n(0)=\beta_n\overset{\rm def}{=}\frac{(u_1,X_n)}{\|X_n\|^2}= \frac{2}{\pi}\int\limits_0^{\pi}u_1(x)\sin{(nx)}\,dx.\end{align*} $$ To obtain ODE $\,T''_n+n^2T_n=f_n$, it suffices to multiply PDE $\,u_{tt}-u_{xx}=f$ by an eigenfunction $X_n\,$ w.r.t. the inner product $(\cdot,\cdot)$, and employ the fact that operator $L$ is self-adjoint, i.e., $\,(Lu,X_n)=(u,LX_n)=\lambda_n(u,X_n)=-n^2(u,X_n)$.
Solving the Cauchy problems for Fourier coefficients $T_n$ we find $$ T_n(t)=\alpha_n \cos{(nt)}+\frac{\beta_n}{n}\sin{(nt)}+ \frac{1}{n}\int\limits_0^t f_n(s)\sin{[n(t-s)]}\,ds,\;\;n\geqslant 1, $$ where the first two terms represent a solution of homogeneous equation with Cauchy data $\alpha_n,\beta_n\,$, while the last term represents a solution of equation corresponding to the RHS $\,f_n=f_n(t)\,$ with homogeneous Cauchy data.