\documentclass[a4paper,12pt]{article}
\setlength\oddsidemargin{0pt} \setlength\evensidemargin{0pt}
\setlength\topmargin{0pt}
\begin{document}
\parindent=0pt
{\bf Exam Question

Topic: LaplaceODE}

Find the solution of the differential equation
$$\frac{d^2y}{dx^2}+\frac{dy}{dx}=f(x),$$ where

$$ f(x)=\left\{
\begin{array}{ll} 0 & \mbox{if\ \ $x<3$};\\ 1 & \mbox{if\ \ $x\ge3$},\end{array} \right. $$
and where $\displaystyle{\frac{dy}{dx}=0}$ when $x=0$ and
$y(0)=1.$ \vspace{0.5in}

{\bf Solution}

Using the Heaviside function we can write $f(x)=H(x-3).$

Transforming the differential equation gives
\begin{eqnarray*}
p^2\bar{y}-p+p\bar{y}-1&=&\frac{\mathrm{e}^{-3p}}{p}\\
p(p+1)\bar{y}&=&\frac{\mathrm{e}^{-3p}}{p}+(p+1)\\
\bar{y}&=&\frac{\mathrm{e}^{-3p}}{p^2(p+1)}+\frac{1}{p}\\
&=&\mathrm{e}^{-3p}\left[\frac{1}{p+1}-\frac{1}{p}+\frac{1}{p^2}\right]+\frac{1}{p}\\
\mathrm{So}\ \
y(x)&=&\left[\mathrm{e}^{-(x-3)}-1+(x-3)\right]H(x-3)+1
\end{eqnarray*}



\end{document}
