\documentclass[a4paper,12pt]{article}
\newcommand{\ds}{\displaystyle}
\newcommand{\un}{\underline}
\newcommand{\undb}{\underbrace}
\parindent=0pt
\begin{document}

{\bf Question}

\medskip

{\bf Answer}

\begin{description}
\item[(i)]
$\ds\frac{d^2y}{dx^2}-3\ds\frac{dy}{dx}+2y=0$

Try auxiliary equation:

$m^2-3m+2=0$

$\Rightarrow m=\ds\frac{3\pm
\sqrt{9-4\cdot1\cdot2}}{2}=\ds\frac{3\pm1}{2}=2 \rm{or}\ 1$

Therefore $y=Ae^{2x}+Be^x$ is a general solution. $A,\ B$ are
constants to be found from boundary conditions.

\item[(ii)]
$\ds\frac{d^2y}{dx^2}-3\ds\frac{dy}{dx}+2y=2x^2-2x+2$

$y=y_{comp.func.}+y_{partic.integral}$

($y_{CF}$ satisfies (i) so $y_{CF}=Ae^{2x}+Be^x$

$y_{PI}$ is of the form $ax^2+bx+c$: same degree of polynomial as
RHS (as per lecture notes).

$a,b,c$ to be found by substitution.

$\begin{array}{rcl} y_{PI} & = & ax^2+bx+c\\ y'_{PI} & = & 2ax+b\\
y''_{PI} & = & 2a \end{array}$

In (ii)

$\ \ 2a-3(2ax+b)+2(ax^2+bx+c)=2x^2-2x+2$

$\Rightarrow 2ax^2+(2b-6a)x+2a-3b+2c = 2x^2-2x+2$

$\begin{array} {rlcl} \rm{Compare}\ x^2: & 2a=2 & \Rightarrow &
a=1\\ \rm{Compare}\ x^1: & 2b-6a=-2 & \Rightarrow & 2b-6=-2\
\Rightarrow b=2\\ \rm{Compare}\ x^0: & 2a-3b+2c=2 & \Rightarrow &
2-6+2c=2 \Rightarrow c=3 \end{array}$

Therefore $y_{PI}=x^2+2x+3$

Therefore $y_{general}=Ae^{2x}+Be^x+x^2+2x+3$

Use boundary conditions to find $A$ and $B$.

$y=2$ when $x=0$:

$$2=Ae^{2 \times 0}+Be^0+3=A+B+3$$

$y'=1$ when $x=0$:

$$1=2Ae^{2 \times 0}+Be^0+2\times 0 +2=2A+B+2$$

\newpage

Therefore

$\ A+B=-1\ \ \ -$

$\un{2A+B=-1}$

$-A\ \ \ \ \ =\ \ 0$

$\Rightarrow A=0,\ B=-1$

Therefore $y=x^2+2x+3-e^x$.
\end{description}

\end{document}
