Back to the class Quiz 7 solution
Find the general solution of $y''-y=t^2+1$.
Solution: First we solve the homogeneous problem $y''-y=0$. The characteristic equation is $r^2-1=0$ which has roots $r=\pm 1$. Therefore the homogeneous solution is
$$y_h(t)=c_1y_1(t)+c_2y_2(t)=c_1e^t+c_2e^{-t}.$$
Now the particular solution $y_p(t)$ is given by the variation of parameters formula $y_p(t)=u_1(t)e^t+u_2(t)e^{-t}$, where $u_1(t)=-\displaystyle\int \dfrac{e^{-t}(t^2+1)}{W\{y_1,y_2\}(t)} \mathrm{d}t$ and $u_2(t)=\displaystyle\int \dfrac{e^t(t^2+1)}{W\{y_1,y_2\}(t)} \mathrm{d}t$. First compute the Wronskian
$$W\{y_1,y_2\}(t)=\mathrm{det} \begin{bmatrix} e^t & e^{-t} \\ e^t & -e^{-t} \end{bmatrix}=-1-1=-2.$$
Then using integration by parts,
$$u_1(t)=-\displaystyle\int \dfrac{e^{-t}(t^2+1)}{-2} \mathrm{d}t=-\dfrac{e^{-t}}{2}\Big(t^2+2t+3\Big),$$
and
$$u_2(t)=\displaystyle\int \dfrac{e^t(t^2+1)}{-2} \mathrm{d}t = -\dfrac{e^t}{2}\Big(t^2-2t+3\Big).$$
Thus the particular solution is
$$\begin{array}{ll}
y_p(t)&=u_1(t)y_1(t)+u_2(t)y_2(t) \\
&=-\dfrac{e^{-t}}{2}\Big(t^2+2t+3\Big)e^t -\dfrac{e^t}{2}\Big(t^2-2t+3\Big)e^{-t}\\
&=-\dfrac{1}{2}\Big( t^2+2t+3+t^2-2t+3\Big) \\
&=-\dfrac{1}{2}\Big( 2t^2+6 \Big) = -t^2-3
\end{array}$$
Therefore, the general solution is
$$y(t)=y_h(t)+y_p(t)=c_1 e^t + c_2 e^{-t} -t^2-3.$$