\documentclass[12pt]{article}
\newcommand{\ds}{\displaystyle}
\newcommand{\pl}{\partial}
\newcommand{\dy}{\frac{dy}{dx}}
\parindent=0pt
\begin{document}

{\bf Question}

Show that the following can be made exact using an integrating
factor that only depends on $x$ and hence find the solution in
each case.

\begin{enumerate}

\item $\ds (x^2+2y)dx-x\,dy=0\qquad (*)$

\item $\ds (xe^x+x\ln y +y)dx+\left(\frac{x^2}{y} +
x\ln x + x \sin y \right)dy=0$

\end{enumerate}


\vspace{0.25in}

{\bf Answer}

\begin{itemize}
\item[a)]
$\ds p=x^2+2y,\,\,\,\, q=-x,\,\,\,\, \Rightarrow \frac{\pl p}{\pl
y}=2,\,\,\,\, \frac{\pl q}{\pl x}=-1 \Rightarrow$ not exact.

Now, either guess a possible multiple to make the equation exact
or multiply by $\ds H(x) \Rightarrow p=(x^2+2y)H,\,\,\,\, q=-xH.$

$\ds \Rightarrow \frac{\pl p}{\pl y}=2H,\,\,\,\, \frac{\pl q}{\pl
x}=-H-x\frac{dH}{dx}$ so for it to be exact we need

$\ds 2H=-H-x\frac{dH}{dx} \Rightarrow 3H=-x\frac{dH}{dx}
\Rightarrow \int\frac{1}{x}dx=\int\frac{1}{3H}dH$

$\ds\ln x+A=\frac{1}{3}\ln H \Rightarrow H=(x+A)^{-3}$, we only
need one $\ds H$ so let $\ds A=0 \Rightarrow H=x^{-3}.$

Now the equation is
$\ds\left(\frac{1}{x}+\frac{2y}{x^3}\right)dx-\frac{1}{x^2}dy=0$

$\ds p=\frac{1}{x}+\frac{2y}{x^3},\,\,\,\,
q=-\frac{1}{x^2},\,\,\,\, \frac{\pl F}{\pl
x}=\frac{1}{x}+\frac{2y}{x^3},\,\,\,\, \frac{\pl F}{\pl
y}=-\frac{1}{x^2}$

$\ds \Rightarrow F=-\frac{y}{x^2}+g(x) \Rightarrow \frac{\pl
F}{\pl x}=\frac{2y}{x^3}+\frac{dy}{dx} \Rightarrow
\frac{dy}{dx}=\frac{1}{x} \Rightarrow y=\ln x+c$

so the solution is $\ds -\frac{y}{x^2}+\ln x=A$ or $\ds
y=x^2(c+\ln x)$

\newpage

\item[b)]
Can do in the same way as 5a) or notice that with

$\ds q=\frac{x^2}{y}+x\ln x+x\sin y$ when you evaluate
$\ds\frac{\pl q}{\pl x}$ you get a term with $\ds\sin y$ and there
is no such term in $\ds p(x,y)$ or $\ds\frac{\pl p}{\pl y}.$ Hence
multiply equation by $\ds\frac{1}{x}$ to get

$\ds\left(e^x+\ln y+\frac{y}{x}\right)dx+\left(\frac{x}{y}+\ln
x+\sin y\right)dy=0$  which is exact.

The solution is $\ds e^x+x\ln y+y\ln x-\cos y=A$

\end{itemize}


\end{document}
