\documentclass[a4paper,12pt]{article}
\newcommand\ds{\displaystyle}
\begin{document}

\parindent=0pt

QUESTION


\begin{description}

\item[(a)]
Find the general solution of the differential equation

$$(2x+te^x+\cos t)\frac{dx}{dt}+e^x-x\sin t-2t=0.$$

\item[(b)]
Find the general solution of the second order differential
equation

$$\frac{d^2x}{dt^2}+4x=\sin(2t).$$

\end{description}

\bigskip

ANSWER

\begin{description}

\item[(a)]
$\ds(2x+te^x+\cos t)\frac{dx}{dt}+e^x-x\sin t-2t=0$\\ Is this
exact?\\ $\left.\begin{array}{c}\ds\frac{\partial p}{\partial
t}=\frac{\partial}{\partial t}(2x+te^x+\cos t)=e^x-\sin
t\\\ds\frac{\partial q}{\partial x}=\frac{\partial}{\partial
x}(e^x-x\sin t-2t)=e^x-\sin t\end{array}\right\}$equal therefore
exact.\\ Find the function $h$ to give the ODE in form
$\ds\frac{dh}{dt}=0;\\ \frac{\partial h}{\partial x}=2x+te^x+\cos
t,\hspace{1cm}h=x^2+te^x+x\cos t+f(t)\\ \frac{\partial h}{\partial
t}=e^x-x\sin t-2t,\hspace{1cm}h=te^x+x\cos t-t^2+g(x)$

Thus from inspection $$h=x^2+te^x+x\cos t-t^2+\textrm{const}.$$

The solution is $h=$const, or $x^2+te^x+x\cos
t-t^2=\textrm{const.}$

\item[(b)]
$\ds\frac{d^2x}{dt^2}+4x=\sin(2t)$.  The auxiliary equation is
$m^2+4-0,\ m=\pm2j$.\\ Hence the complementary function is
$x=A\cos(2t)+B\sin(2t)$.\\ The natural form for a particular
integral is not possible (because it appears in the complementary
function), so try

\begin{eqnarray*}
x&=&t(C\cos(2t)+D\sin(2t)),\\
\frac{dx}{dt}&=&C\cos(2t)+D\sin(2t)+t\{-2C\sin(2t)+2D\cos(2t)\}\\
&=&(D-2Ct)\sin(2t)+(C+2Dt)\cos(2t),\\
\frac{d^2x}{dt^2}&=&(D-2Ct)2\cos(2t)-2C\sin(2t)\\
&+&(C+2Dt)(-2\sin(2t))+2D\cos(2t)\\
&=&(4D-4Ct)\cos(2t)+(-4C-4Dt)\sin(2t)
\end{eqnarray*}

Substituting this into the ODE gives

$(4D-4Ct)\cos(2t)-(4C+4Dt)\sin(2t)+4t(C\cos(2t)+D\sin(2t))$

$\hspace{0.2in}=\sin(2t)$

${\rm i.e.\ }\ 4D\cos(2t)-4C\sin(2t)=\sin(2t)$.

Therefore $\ds D=0,\ C=-\frac{1}{4}$.

The general solution is $\ds
x=A\cos(2t)+B\sin(2t)-\frac{1}{4}t\cos(2t)$.

\end{description}




\end{document}
