\documentclass[a4paper,12pt]{article}
\newcommand{\ds}{\displaystyle}
\newcommand{\un}{\underline}
\parindent=0pt
\begin{document}

{\bf Question}

Solve the equations
\begin{description}
\item[(i)]
$\ds\frac{d^2y}{dx^2}-\ds\frac{dy}{dx}-2y=1+4x^2$

\item[(ii)]
$2\ds\frac{d^2y}{dx^2}+\ds\frac{dy}{dx}-y=\sin 2x$

\item[(iii)]
$\ds\frac{d^2y}{dx^2}-8\ds\frac{dy}{dx}+16y=3e^{2x}$
\end{description}

\medskip

{\bf Answer}
\begin{description}
\item[(i)]
$\ds\frac{d^2y}{dx^2}-\ds\frac{dy}{dx}-2y=1+4x^2$

First solve for the complementary function (CF).

$\ds\frac{d^2y}{dx^2}-\ds\frac{dy}{dx}-2y=0$

Try solution $y = Ae^{kx}$ etc.

$\Rightarrow$ auxiliary equation

$\ k^2-k-2=0$

$\Rightarrow (k-2)(k+1)=0$

$\Rightarrow k=2$ or $k=-1$

Hence CF is \un{$y=Ae^{2x}+Be^{-x}$}

Now work out the particular integral.

$f(x)=1+4x^2$ is second degree polynomial so try a PI

$$\begin{array} {ccl} y & = & L+Mx+Nx^2\\ \ds\frac{dy}{dx} & = & \
\ \ \ \ \ \ \ M+2Nx\\ \ds\frac{d^2y}{dx^2} & = & \ \ \ \ \ \ \ \ \
\ \ \ \ \ \ 2N \end{array}$$

Substitute into full equation:

$\ \ 2N-(M+2Nx)-2(L+Mx+Nx^2)=1+4x^2$

or $(2N-M-2L)+(-2N-2M)x-2Nx^2=1+4x^2$

$\begin{array} {lrcl} {\rm{compare\ numbers}} & 2N-M-2L & = & 1\ \
\ 1\\ {\rm{compare\ coeffs}}\ x^1 & -2N-2M & = & 0\ \ \ 2 \\
{\rm{compare\ coeffs}}\ x^2 & -2N & = & 4\ \ \ 3
\end{array}$

$(3) \Rightarrow N=-2$

Then

$(2) \Rightarrow M=-N \Rightarrow M=+2$

Thus

$(1) \Rightarrow
L=\left(\ds\frac{-1+2N-M}{2}\right)=\ds\frac{-1-4-2}{2}=-\ds\frac{7}{2}$

Thus the PI is

$$\un{y=-\ds\frac{7}{2}+2x-2x^2}$$ (PI)

The full general solution is the CF+PI

Thus

$$\un{y=Ae^{2x}+Be^{-x}-\ds\frac{7}{2}+2x-2x^2}$$

\item[(ii)]
$2\ds\frac{d^2y}{dx^2}+\ds\frac{dy}{dx}-y=\sin 2x$

First solve for the complementary function (CF)
$2\ds\frac{d^2y}{dx^2}+\ds\frac{dy}{dx}-y=0$

Try solution $y = Ae^{kx}$ etc.

$\Rightarrow$ auxiliary equation

$\ 2k^2+k-1=0$

$\Rightarrow (2k-1)(k+1)=0$

$\Rightarrow k=\ds\frac{1}{2}$ or $k=-1$

Hence CF is \un{$y=Ae^{\frac{x}{2}}+Be^{-x}$}

Now work out the particular integral:

$f(x)=\sin 2x$, so try a PI

$\begin{array} {ccl} y & = & L\sin 2x+M\cos 2x\\ \ds\frac{dy}{dx}
& = & 2L\cos 2x-2M\sin 2x\\ \ds\frac{d^2y}{dx^2} & = & -4L\sin
2x-4M\cos 2x \end{array}$

Substitute into full equation:

$2(-4L\sin 2x-4M\cos 2x)+2L\cos 2x_2M\sin 2x$

$-(L\sin 2x+M\cos 2x)=\sin 2x$

$\Rightarrow (-8L-2M-L)\sin 2x+(-8M+2L-M)\cos 2x=\sin 2x$

Compare coeffs of $\sin 2x$: $-8L-2M-L=1$

Compare coeffs of $\cos 2x$: $-8M+2L-M=0$

$\Rightarrow \left. \begin{array} {l} -9L-2M=1\\+2L-9M=0
\end{array} \right\} \begin{array} {cc} (1)\\(2) \end{array}$

Solve these equations by taking $2 \times (1)+9 \times (2)$

$\begin{array} {r} -18L-4M=2\\ \un{18L-81M=0}\\ -85M=2
\end{array}$

$\Rightarrow \un{M=-\ds\frac{2}{85}}$

Thus in $(2)\ \ 2L-9\left(-\ds\frac{2}{85}\right)=0 \Rightarrow
\un{L=-\ds\frac{9}{85}}$

Thus the PI is

$$\un{y=-\ds\frac{9}{85}\sin 2x-\ds\frac{2}{85}\cos 2x}$$

Thus the general solution is the CF + PI

$$\un{y=Ae^{\frac{x}{2}}+Be^{-x}-\ds\frac{9}{85}\sin
2x-\ds\frac{2}{85}\cos 2x}$$

\item[(iii)]
$\ds\frac{d^2y}{dx^2}-8\ds\frac{dy}{dx}+16y=3e^{2x}$ First solve
for the complementary function(CF)

$\ds\frac{d^2y}{dx^2}-8\ds\frac{dy}{dx}+16y=0$

Try solution $y = Ae^{kx}$ etc.

$\Rightarrow$ auxiliary equation is

$\ k^2-8k+16=0$

$\Rightarrow (k-4)^2=0$

$\Rightarrow k=4,4$ \un{twice}

Two equal roots, so the CF is

\un{$y=(A+Bx)e^{4x}$}

Now work out the particular integral

$f(x)=3e^{2x}$, so try a PI

\begin{eqnarray*} y & = & Le^{2x}\\ \ds\frac{dy}{dx}=2Le^{2x}\\
\ds\frac{d^2y}{dx^2}=4Le^{2x} \end{eqnarray*}

Substitute into the full equation

$\ 4Le^{2x}-8(2Le^{2x})+16Le^{2x}=3e^{2x}$

$\Rightarrow Le^{2x}(4-16+16)=3e^{2x}$

$\Rightarrow L=\ds\frac{3}{4}$

Thus \un{$y=\ds\frac{3}{4}e^{2x}$} is the PI

The general solution is the CF+PI

\un{$y=(A+Bx)e^{4x}+\ds\frac{3}{4}e^{2x}$}

\end{description}

\end{document}
