\documentclass[a4paper,12pt]{article}
\begin{document}


{\bf Question}

\bigskip
Determine whether the differential equation $$(x^2 + t^2)\left(
\frac{dx}{dt}\right) + 2tx = e^t$$

is exact, and, if so, find a general solution.

\vspace{.25in}

{\bf Answer}

\bigskip
Consider $$(x^2 + t^2)\left( \frac{dx}{dt}\right) + 2tx - e^t =
0$$

General case $\displaystyle p(x,t)\left( \frac{dx}{dt}\right) +
q(x,t) = 0$

Condition is $\displaystyle \frac{\partial p}{\partial
t}(x,t)=\frac{\partial q}{\partial x}(x,t)$\ \ for exact solution.


$\displaystyle p(x,t) = x^2 + t^2; \hspace{.1in} \frac{\partial
p}{\partial t } = 2t$

$\displaystyle q(x,t) = 2tx -e^t; \hspace{.1in} \frac{\partial
q}{\partial x} = 2t = \frac{\partial p}{\partial t}$   Equation is
exact.

Now \begin{eqnarray} p(x,t) & = &  x^2 + t^2 = \frac{\partial
h}{\partial x } \\ q(x,t) & = & 2tx - e^t = \frac{\partial
h}{\partial t} \end{eqnarray}

Full equation is $\displaystyle \frac{\partial h}{\partial t} +
\frac{\partial h}{\partial x}\frac{dx}{dt} + \frac{dh}{dt} = 0$

Solution will be $h( x,t) = \mathrm{constant}$

Solve(1) and (2) simultaneously to obtain $h(x,t)$:

Integrate (1): \setcounter{equation}{2}
\begin{equation} h(x,t) = \frac{1}{3}x^3 + xt^2 + f(t)
\end{equation}

Integrate (2): \setcounter{equation}{3}
\begin{equation} h(x,t) = xt^2 - e^t + g(x)
\end{equation}

Reconcile (3) and (4) $$ h(x,t) = \frac{1}{3}x^3 + xt^2 - e^t$$

[identify $g(x)  = \frac{1}{3}x^3$ and $f(t) = -e^t$]

Final solution $$\frac{1}{3}x^3 + xt^2 - e^t = \mathrm{constant}$$



\end{document}
