\documentclass[a4paper,12pt]{article}
\newcommand{\ds}{\displaystyle}
\newcommand{\un}{\underline}
\parindent=0pt
\begin{document}

{\bf Question}
\begin{description}
\item[(a)]
Solve the differential equation

$\ds\frac{dy}{dx}+2xy=e^{-x^2}\sec^2 x$, where $y=1$ when $x=0$

\item[(b)]
By solving

$\ds\frac{dy}{dx}=\ds\frac{3x+2y}{2x+3y}$

show that its general solution can be written in the form

$(x-y)^5(x+y)=A$

where $A$ is an arbitrary constant.
\end{description}

\medskip

{\bf Answer}
\begin{description}
\item[(i)]
$\ds\frac{dy}{dx}+2xy=e^{-x^2}\sec^2 x$

First order linear equation, requiring an integrating factor:

$\ds\frac{dy}{dx}+Py=Q \Rightarrow$ integrating factor $e^{\int P
\,dx}$

Here $P=2x,\ Q=e^{-x^2}\sec^2 x$

This integrating factor=$e^{\int 2x \,dx}=e^{x^2}$

Therefore \begin{eqnarray*} e^{x^2}\ds\frac{dy}{dx}+2xe^{x^2}y & =
& e^{x^2-x^2}\sec^2x\\ e^{x^2}\ds\frac{dy}{dx}+2xe^{x^2}y & = &
\sec^2 x\\ \ds\frac{d}{dx}\left(e^{x^2}y\right) & = & \sec^2 x\\
\Rightarrow ye^{x^2} & = & \ds\int^x \sec^2 u \,du\\ & = & \tan x
+C\\ \Rightarrow y & = & \un{e^{-x^2}\tan x+Ce^{-x^2}}
\end{eqnarray*}

\newpage
General solution.

If $y=1$ when $x=0$

$\Rightarrow y=e^0 \cdot 0 +Ce^0 =C$

$\Rightarrow C=1$

$$\un{y=(1+\tan x)e^{-x^2}}$$

Specific solution.

\item[(ii)]
$\ds\frac{dy}{dx}=\ds\frac{3x+2y}{2x+3y}\ \ \ (1)$

Rearrange to get

$(2x+3y)\ds\frac{dy}{dx}-(3x+2y)=0$

Homogeneous of degree \un{1}.

Set $y=vx$ where $v=v(x)$, to be found.

$\Rightarrow =v+x\ds\frac{dv}{dx}$

Substitute in $(1)$

\begin{eqnarray*} \Rightarrow v +x\ds\frac{dv}{dx} & = &
\ds\frac{3x+2vx}{2x+3vx}\\ \Rightarrow v\ds\frac{dv}{dx} & = &
\ds\frac{3+2v}{2+3v}\\ x\ds\frac{dv}{dx} & = &
\ds\frac{3+2v}{2+3v}-v\\ x\ds\frac{dv}{dx} & = &
\ds\frac{3+2v-2v-3v^2}{2+3v}\\ x\ds\frac{dv}{dx} & = &
\ds\frac{3(1-v^2)}{2+3v} \end{eqnarray*}

\newpage
Variables separable:

$$\ds\int\ds\frac{(2+3v)}{(1-v^2)} \,dv=3\ds\int\ds\frac{dx}{x}$$

$\ds\int\ds\frac{2+3v}{1-v^2} \,dv =3\ln x+C$

$\ds\frac{2+3v}{1-v^2}=\ds\frac{(2+3v)}{(1-v)(1+v)} \equiv
\ds\frac{A}{(1-v)}+\ds\frac{B}{(1+v)}$

Therefore $2+3v=(1+v)A+(1-v)B$

$\Rightarrow 2=A+B,\ 3=A-B$

$\Rightarrow 5=2A \Rightarrow A=\ds\frac{5}{2}$

Hence $B=-\ds\frac{1}P{2}$

Therefore \begin{eqnarray*} \ds\int\ds\frac{2+3v}{1-v^2} \,dv & =
&
\ds\frac{5}{2}\ds\int\ds\frac{\,dv}{1-v}-\ds\frac{1}{2}\ds\int\ds\frac{dv}{1+v}\\
& = & -\ds\frac{5}{2}\ln(1-v)-\ds\frac{1}{2}\ln(1+v)
\end{eqnarray*}

Therefore

\begin{eqnarray*} -\ds\frac{5}{2}\ln(1-v)-\ds\frac{1}{2}\ln(1+v)
& = & 3\ln x+C\\ & = &
-\ds\frac{5}{2}\ln(1-v)-\ds\frac{1}{2}{\ln(1+v)} \end{eqnarray*}

Therefore \begin{eqnarray*}
-\ds\frac{5}{2}\ln(1-v)-\ds\frac{1}{2}\ln(1+v) & = & 3\ln x+c\\
5\ln(1-v)+\ln(1+v) & = & -6\ln x+c'\\ (1-v)^5(1+v) & = &
\ds\frac{A}{x^6}\\ \rm{reset}\ y=vx\\
\left(1-\ds\frac{y}{x}\right)^5\left(1+\ds\frac{y}{x}\right) & = &
\ds\frac{A}{x^6}\\ \Rightarrow (x-5)^5(x+y) & = & A
\end{eqnarray*}
\end{description}

\end{document}
