\documentclass[a4paper,12pt]{article}
\newcommand{\ds}{\displaystyle}
\newcommand{\un}{\underline}
\parindent=0pt
\begin{document}

{\bf Question}
\begin{description}
\item[(i)]
Find the general solution of the equation

$$\ds\frac{d^2y}{dx^2}+4\ds\frac{dy}{dx}+5y=0.$$

\item[(ii)]
Use the result of part (i) to find the solution of

$$\ds\frac{d^2y}{dx^2}+4\ds\frac{dy}{dx}+5y=2e^{-3x},$$

\ \ \ \ \ \ \ \ \ \ where $y=1$ and $\ds\frac{dy}{dx}=-3$ when
$x=0$.

\end{description}
\medskip

{\bf Answer}
\begin{description}
\item[(i)]
Use trial function $y=Ae^{kx}$

$\Rightarrow \ds\frac{dy}{dx}=Ake^{kx},\
\ds\frac{d^2y}{dx^2}=Ak^2e^{kx}$

Therefore auxiliary equation is

$$k^2+4k+5=0$$

\begin{eqnarray*} \Rightarrow k & = & \ds\frac{-4 \pm
\sqrt{16-20}}{2}\\ & = & -2 \pm \ds\frac{2i}{2}\\ & = & -2 \pm i
\end{eqnarray*}

Therefore general solution is of the form

$$y=Ae^{-2x+ix}+Be^{-2x-ix}$$

\un{or}

$$\un{y=e^{-2x}(C\cos x+D\sin x)}$$ $C,\ D$ constants

\item[(ii)]
This is the same equation as (i) but with forcing term $2e^{-3x}$
on $RHS$

Therefore $$y=y_{CF}+y_{PI}$$

where $y_{CF}$ satisfies

$$\ds\frac{d^2y}{dx^2}+4\ds\frac{dy}{dx}+5y=0$$

Thus from (i)

$$y_{CF}=e^{-2x}(C\cos x+D \sin x)$$

For $y_{PI}$ try

$$y_{PI}=Ae^{-3x}$$

and substitute in full equation

$y'_{PI}=-3Ae^{-3x},\ y''_{PI}=+9Ae^{-3x}$

Therefore

\begin{eqnarray*} 9Ae^{-3x}-4\times 3Ae^{-3x}+5Ae^{-3x} & = &
2e^{-3x}\\ \Rightarrow 2Ae^{-3x} & = & 2e^{-3x}\\ \Rightarrow A &
= & 1 \end{eqnarray*}

Therefore $$\un{y_{PI}=e^{-3x}}$$

Thus the general solution is

$$\un{y=e^{-2x}(C\cos x+D \sin x)+e^{-3x}}$$

Specific solution from boundary conditions:

$y=1,\ x=0$

$\Rightarrow 1=1(C+0)+1$

$\Rightarrow C=0$

Therefore $y=De^{-2x}\sin x+e^{-3x}$

So

$\ds\frac{dy}{dx}=D(-2e^{-2x}\sin x+e^{-2x}\cos x)-3e^{-3x}$

$\ds\frac{dy}{dx}=-3$ when $x=0$

$\Rightarrow -3 = D(0+1)-3$

$\Rightarrow D=0$

Therefore \un{$y=e^{-3x}$} is the specific solution.

\end{description}
\end{document}
