\documentclass[12pt]{article}
\newcommand{\ds}{\displaystyle}
\newcommand{\pl}{\partial}
\newcommand{\dy}{\frac{dy}{dx}}
\parindent=0pt
\begin{document}

{\bf Question}

Find the general solution of the following non-homogeneous
equations:

\begin{enumerate}

\item $y''-5y'+6y=2e^x$

\item $y'' -2y' -3y=3e^{2x}\qquad(*)$

\item $y''+2y'+5y=3\sin 2x $

\item $y''+2y'+y=3e^{-x}$

\item $y'' +\lambda^2y=\cos\omega x ,\qquad(*)$\\
Here $\omega$ and $\lambda$ are positive constants.\\
\hspace*{2cm} i) Solve for the case $\quad \omega^2 \neq \lambda^2
$\\ \hspace*{2cm} ii) Solve for the case $\quad \omega = \lambda $

\end{enumerate}



\vspace{0.25in}

{\bf Answer}

\begin{enumerate}
\item
Auxiliary equation is:  $m^2-5m+6=0$ \qquad giving $m=2,3$ \\
Hence the complementary function is: $y_{cf}=Ae^{2x}+Be^{3x}$\\
Try the particular integral: $y_p=ae^{x}$\\ Equation becomes:
$ae^x-5ae^x+6ae^x=2e^x$\\ so that  $2ae^x=2e^x$\\ and hence\qquad
$a=1$\\ The general solution is: $y=Ae^{2x}+Be^{3x}+e^x$

\item
Auxiliary equation is:  $m^2-2m-3=0$ \qquad giving $m=3,-1$ \\
Hence the complementary function is: $y_{cf}=Ae^{3x}+Be^{-x}$\\
Try the particular integral: $y_p=ae^{2x}$\\ Equation becomes:
$(4a-4a-3a)e^{2x}=3e^{2x}$ so that $a=-1$\\ The general solution
is: $y=Ae^{3x}+Be^{-x}-e^{2x}$

\item
Auxiliary equation is:  $m^2+2m+5=0$ \qquad giving $m=-1+2i,-1-2i$
\\ Hence the complementary function is:
$y_{cf}=e^{-x}(D\sin(2x)+E\cos(2x))$\\ Try the particular
integral: $y_p=a\sin(2x)+b\cos(2x)$\\

\newpage
Equation becomes:\\
 $-4a\sin(2x)-4b\cos(2x)+2(2a\cos(2x)-2b\sin(2x))+5(a\sin(2x)+b\cos(2x))=3\sin(2x)$ \\
so that
\begin{eqnarray*}
(-4a-4b+5a)\sin(2x)&=&3\sin(2x)\\ (-4b+4a+5b)\cos(2x)&=&0
\end{eqnarray*}
which implies\quad $a-4b=3\qquad 4a+b=0$\\ So that $a=3/17$ and
$b=-12/17$\\ The general solution is: $$
y=e^{-x}(D\sin(2x)+E\cos(2x))+\frac{3}{17}\sin(2x)-
\frac{12}{17}\cos(2x) $$


\item
Auxiliary equation is:  $m^2+2m+1=0$ \qquad giving $m=-1,-1$ \\
Hence the complementary function is: $\ds y_{cf}=e^{-x}(A+Bx)$\\
Try the particular integral: $\ds y_p=ax^2e^{-x}$\\ (note you can
try $y_p=bxe^{-x}$ but will find this does not work. This is
because the complementary function contains both $e^{-x}$ and
$xe^{-x}$)\\ Equation becomes:\\ $\ds
\left(2ae^{-x}-4axe^{-x}+ax^2e^{-x}\right)
+2\left(2axe^{-x}-ax^2e^{-x}\right)+\left(ax^2e^{-x}\right)=3e^{-x}$\\
and simplifying gives: $2ae^{-x}=3e^{-x}$ so that $a=3/2$\\ The
general solution is: $\ds y=e^{-x}(A+Bx)+\frac{3}{2}x^2e^{-x}$


\item (i)
Auxiliary equation is:  $m^2+\lambda^2=0$ \qquad giving $m=\pm
\lambda i$ \\ Hence the complementary function is:
$y_{cf}=A\cos(\lambda x)+B\sin(\lambda x)$\\ Try the particular
integral: $y_p=a\cos(\omega x)+b\sin(\omega x)$\\ Equation
becomes:\\  $-\omega^2(a\cos(\omega x)+b\sin(\omega x))+
\lambda^2(a\cos(\omega x)+b\sin(\omega x))=\cos(\omega x)$\\ so
that
\begin{eqnarray*}
(-\omega^2 b+\lambda^2 b)\sin(\omega x)&=&0\\ (-\omega^2
a+\lambda^2 a)\cos(\omega x)&=&\cos(\omega x)
\end{eqnarray*}
which implies that $b=0$ and $\ds
a=\frac{-1}{-\omega^2+\lambda^2}$\\ (note that this requires that
$\omega \not=\lambda$ or $a$ will not exist)\\ The general
solution is: $$ y= A\cos(\lambda x)+B\sin(\lambda x)+
\frac{1}{\omega^2-\lambda^2}\cos(\omega x)$$

\noindent (ii) This is exactly as for the previous part of the
question but we must find a different particular integral.\\ The
complementary function is: $y_{cf}=A\cos(\lambda x)+B\sin(\lambda
x)$\\ Note that the right hand side of the equation contains
functions in the complementary function hence try the particular
integral:\\ $y_p=ax\cos(\lambda x)+bx\sin(\lambda x)$\\ Equation
becomes:\\ $a(-\lambda^2x\cos(\lambda x)-2\lambda\sin(\lambda x))
+b(-\lambda^2x\sin(\lambda x)+2\lambda\cos(\lambda x)))+
\lambda^2(ax\cos(\lambda x)+bx\sin(\lambda x))=\cos(\lambda x) $\\
so that $$ -2a\lambda \sin(\lambda x) + 2b\lambda \cos(\lambda x)
=\cos(\lambda x) $$ which implies that $a=0$ and $\ds
b=\frac{1}{2\lambda}$\\ The general solution is: $$ y=
A\cos(\lambda x)+B\sin(\lambda x)+ \frac{1}{2\lambda}x\sin(\omega
x)$$

\end{enumerate}


\end{document}
