<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}
\newcommand{\ds}{\displaystyle}
\newcommand{\un}{\underline}
\parindent=0pt
\begin{document}

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

$\ds\frac{dy}{dx}=e^x \cos^2 y$, where $y=\ds\frac{\pi}{4}$ when
$x=0$.

\item[(b)]
Solve the differential equation

$x\ds\frac{dy}{dx}+y=\sec x$, where $y=1$ when $x=0$.

\end{description}
{\bf{Hint:}} All the integrals you need are in the table at the
end of the exam paper.
\medskip

{\bf Answer}
\begin{description}
\item[(a)]
$\sec y \ds\frac{dy}{dx}-e^x \cos y=0$

rewrite as

$\ds\frac{dy}{dx}=e^x\ds\frac{\cos y}{\sec y}=e^x \cos^2 y$

This is variables separable

$\Rightarrow \ds\int\ds\frac{dy}{\cos^2 y}=\ds\int e^x dx$

$\Rightarrow \ds\int\sec^2 y \,dy=e^x+c'$

$\Rightarrow \tan y=e^x+c$

Now $y=\ds\frac{\pi}{4}$ when $x=0$

Therefore $\tan\ds\frac{\pi}{4}=e^0+c$

$\Rightarrow 1=1+c$

$\Rightarrow c=0$

Therefore \un{$\tan y=e^x$}

or \un{$y=\arctan(e^x)$}

on some restricted range of $y$

\newpage
\item[(b)]
Rewrite as

$\ds\frac{dy}{dx}+\ds\frac{y}{x}=\ds\frac{\sec x}{x}$ cf
$\ds\frac{dy}{dx}+P(x)y=Q(x)$

It's linear first order $\Rightarrow$ integrating factor or exact

\begin{eqnarray*} I.F. &amp; = &amp; e^{\int\frac{1}{x}} dx\\ &amp; = &amp; e^{\ln
x}\\ &amp; = &amp; x \end{eqnarray*}

$\begin{array} {lrcl} \rm{Therefore} &amp;
x\ds\frac{dy}{dx}+x\ds\frac{y}{x} &amp; = &amp; x\ds\frac{\sec x}{x}\\
\rm{Therefore} &amp; \ds\frac{d}{dx}(xy) &amp; = &amp; \sec x\\ \Rightarrow &amp;
xy &amp; = &amp; \ds\int\sec x dx\\ &amp; &amp; = &amp; \ln|\sec x+\tan x|+c\\
\Rightarrow &amp; y &amp; = &amp; \ds\frac{1}{x}(\ln|\sec x+\tan x|+c)
\end{array}$

Now $y=1$ when $x=0$ so go back one line.

\begin{eqnarray*} 0 \times 1 &amp; = &amp; \ln |\sec 0 + \tan 0|+c\\
\Rightarrow 0 &amp; = &amp; \ln(1)+c\\ \Rightarrow c &amp; = &amp; 0
\end{eqnarray*}

Therefore \un{$y=\ds\frac{\ln|\sec x+\tan x|}{x}$}

\end{description}


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