\documentclass[a4paper,12pt]{article}
\newcommand{\ds}{\displaystyle}
\newcommand{\un}{\underline}
\parindent=0pt
\begin{document}

{\bf Question}

Find the general solution of the following differential equations

\begin{description}
\item[(i)]
$\cos y-x\sin y\ds\frac{dy}{dx}=0$

\item[(ii)]
$xy+x\ds\frac{dy}{dx}=e^x$
\end{description}
\medskip

{\bf Answer}
\begin{description}
\item[(i)]
$\cos y-x\sin y\ds\frac{dy}{dx}=0$

Not variables separable. Not homogeneous (sin's and cos's)

Consider

$$\ds\frac{d}{dx})x\cos y)=\cos y-x\sin y\ds\frac{dy}{dx}$$

i.e., the LHS is an exact derivative. Thus we can rewrite the
equation as

$\ds\frac{d}{dx}(x\cos y)=0$

$\Rightarrow \un{x\cos y=c}$ where $c$ is constant

\item[(ii)]
$xy+x\ds\frac{dy}{dx}=e^x$

Not variables separable. Not homogeneous ($e^x$'s)

Consider

$$\ds\frac{d}{dx}(xy)=y+x\ds\frac{dy}{dx}$$

i.e., the LHS is an exact derivative. Thus we can rewrite the
equation as

$\begin{array} {crcl} & \ds\frac{d}{dx}(xy) & = & e^x\\
\Rightarrow & xy & = & \ds\int e^x dx=e^x+c \end{array}$

$\Rightarrow \un{xy=e^c+c}$
\end{description}
\end{document}
