<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">\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 $$y''-y'-2y=f(x),$$
where

$$ f(x)=\left\{
\begin{array}{ll} 1 &amp; \mbox{if\ \ $0\le x\le 2$};\\ 0 &amp; \mbox{otherwise},\end{array} \right. $$
and where $y(0)=y'(0)=0.$ \vspace{0.5in}

{\bf Solution}

Using the Heaviside function we can write $f(x)=1-H(x-2).$

Transforming the differential equation gives
\begin{eqnarray*}
y''-y'-2y&amp;=&amp;1-H(x-2)\\
p^2\bar{y}=p\bar{y}-2\bar{y}&amp;=&amp;\frac{1}{p}\left(1-\mathrm{e}^{-2p}\right)
\end{eqnarray*}
Rearranging this equation gives
\begin{eqnarray*}
\bar{y}&amp;=&amp;\frac{1}{p(p-2)(p+1)}\left(1-\mathrm{e}^{-2p}\right)\\
&amp;=&amp;\left(-\frac{1}{2p}+\frac{1}{6(p-2)}+\frac{1}{3(p+1)}\right)\left(1-\mathrm{e}^{-2p}\right)
\end{eqnarray*}

$$\mathrm{So}\ \
y=-\frac{1}{2}+\frac{\mathrm{e}^{2x}}{6}+\frac{\mathrm{e}^{-x}}{3}
+\left(-\frac{1}{2}+\frac{\mathrm{e}^{2(x-2)}}{6}+\frac{\mathrm{e}^{-(x-2)}}{3}\right)H(x-2).$$


\end{document}
</pre></body></html>