2.7: Exact Differential Equations
- Page ID
- 380
\( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)
\( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)
\( \newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\)
( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\)
\( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)
\( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\)
\( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)
\( \newcommand{\Span}{\mathrm{span}}\)
\( \newcommand{\id}{\mathrm{id}}\)
\( \newcommand{\Span}{\mathrm{span}}\)
\( \newcommand{\kernel}{\mathrm{null}\,}\)
\( \newcommand{\range}{\mathrm{range}\,}\)
\( \newcommand{\RealPart}{\mathrm{Re}}\)
\( \newcommand{\ImaginaryPart}{\mathrm{Im}}\)
\( \newcommand{\Argument}{\mathrm{Arg}}\)
\( \newcommand{\norm}[1]{\| #1 \|}\)
\( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\)
\( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\AA}{\unicode[.8,0]{x212B}}\)
\( \newcommand{\vectorA}[1]{\vec{#1}} % arrow\)
\( \newcommand{\vectorAt}[1]{\vec{\text{#1}}} % arrow\)
\( \newcommand{\vectorB}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)
\( \newcommand{\vectorC}[1]{\textbf{#1}} \)
\( \newcommand{\vectorD}[1]{\overrightarrow{#1}} \)
\( \newcommand{\vectorDt}[1]{\overrightarrow{\text{#1}}} \)
\( \newcommand{\vectE}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash{\mathbf {#1}}}} \)
\( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)
\( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)
\(\newcommand{\avec}{\mathbf a}\) \(\newcommand{\bvec}{\mathbf b}\) \(\newcommand{\cvec}{\mathbf c}\) \(\newcommand{\dvec}{\mathbf d}\) \(\newcommand{\dtil}{\widetilde{\mathbf d}}\) \(\newcommand{\evec}{\mathbf e}\) \(\newcommand{\fvec}{\mathbf f}\) \(\newcommand{\nvec}{\mathbf n}\) \(\newcommand{\pvec}{\mathbf p}\) \(\newcommand{\qvec}{\mathbf q}\) \(\newcommand{\svec}{\mathbf s}\) \(\newcommand{\tvec}{\mathbf t}\) \(\newcommand{\uvec}{\mathbf u}\) \(\newcommand{\vvec}{\mathbf v}\) \(\newcommand{\wvec}{\mathbf w}\) \(\newcommand{\xvec}{\mathbf x}\) \(\newcommand{\yvec}{\mathbf y}\) \(\newcommand{\zvec}{\mathbf z}\) \(\newcommand{\rvec}{\mathbf r}\) \(\newcommand{\mvec}{\mathbf m}\) \(\newcommand{\zerovec}{\mathbf 0}\) \(\newcommand{\onevec}{\mathbf 1}\) \(\newcommand{\real}{\mathbb R}\) \(\newcommand{\twovec}[2]{\left[\begin{array}{r}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\ctwovec}[2]{\left[\begin{array}{c}#1 \\ #2 \end{array}\right]}\) \(\newcommand{\threevec}[3]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\cthreevec}[3]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \end{array}\right]}\) \(\newcommand{\fourvec}[4]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\cfourvec}[4]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \end{array}\right]}\) \(\newcommand{\fivevec}[5]{\left[\begin{array}{r}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\cfivevec}[5]{\left[\begin{array}{c}#1 \\ #2 \\ #3 \\ #4 \\ #5 \\ \end{array}\right]}\) \(\newcommand{\mattwo}[4]{\left[\begin{array}{rr}#1 \amp #2 \\ #3 \amp #4 \\ \end{array}\right]}\) \(\newcommand{\laspan}[1]{\text{Span}\{#1\}}\) \(\newcommand{\bcal}{\cal B}\) \(\newcommand{\ccal}{\cal C}\) \(\newcommand{\scal}{\cal S}\) \(\newcommand{\wcal}{\cal W}\) \(\newcommand{\ecal}{\cal E}\) \(\newcommand{\coords}[2]{\left\{#1\right\}_{#2}}\) \(\newcommand{\gray}[1]{\color{gray}{#1}}\) \(\newcommand{\lgray}[1]{\color{lightgray}{#1}}\) \(\newcommand{\rank}{\operatorname{rank}}\) \(\newcommand{\row}{\text{Row}}\) \(\newcommand{\col}{\text{Col}}\) \(\renewcommand{\row}{\text{Row}}\) \(\newcommand{\nul}{\text{Nul}}\) \(\newcommand{\var}{\text{Var}}\) \(\newcommand{\corr}{\text{corr}}\) \(\newcommand{\len}[1]{\left|#1\right|}\) \(\newcommand{\bbar}{\overline{\bvec}}\) \(\newcommand{\bhat}{\widehat{\bvec}}\) \(\newcommand{\bperp}{\bvec^\perp}\) \(\newcommand{\xhat}{\widehat{\xvec}}\) \(\newcommand{\vhat}{\widehat{\vvec}}\) \(\newcommand{\uhat}{\widehat{\uvec}}\) \(\newcommand{\what}{\widehat{\wvec}}\) \(\newcommand{\Sighat}{\widehat{\Sigma}}\) \(\newcommand{\lt}{<}\) \(\newcommand{\gt}{>}\) \(\newcommand{\amp}{&}\) \(\definecolor{fillinmathshade}{gray}{0.9}\)Consider the equation
\[ f(x,y) = C. \nonumber \]
Taking the gradient we get
\[ f_x(x,y)\hat{\textbf{i}} + f_y(x,y)\hat{\textbf{j}} = 0.\nonumber \]
We can write this equation in differential form as
\[ f_x(x,y)\, dx+ f_y(x,y)\, dy = 0.\nonumber \]
Now divide by \( dx \) (we are not pretending to be rigorous here) to get
\[ f_x(x,y)+ f_y(x,y) \dfrac{dy}{dx} = 0.\nonumber \]
Which is a first order differential equation. The goal of this section is to go backward. That is if a differential equation if of the form above, we seek the original function \(f(x,y)\) (called a potential function). A differential equation with a potential function is called exact. If you have had vector calculus, this is the same as finding the potential functions and using the fundamental theorem of line integrals.
Solve
\[ 4xy + 1 + (2x^2 + \cos y)y' = 0. \nonumber \]
Solution
We seek a function \(f(x,y)\) with
\[ f_x(x,y) = 4xy + 1 \nonumber \]
and
\[ f_y(x,y) = 2x^2 + \cos y. \nonumber \]
Integrate the first equation with respect to \(x\) to get
\[ f(x,y) = 2x^2y + x + C(y) . \nonumber \]
Notice since \(y\) is treated as a constant, we write \(C(y)\). Now take the partial derivative with respect to \(y\) to get
\[ f_y(x,y) = 2x^2 + C'(y) .\nonumber \]
We have two formulae for \( f_y(x,y) \) so we can set them equal to each other.
\[ 2x^2 + \cos y = 2x^2 + C'(y) \nonumber \]
That is
\[ C'(y) = \cos\, y \nonumber \]
or
\[ C(y) = \sin \, y .\nonumber \]
Hence
\[ f(x,y) = 2x^2y + x + \sin \, y. \nonumber \]
The solution to the differential equation is
\[ 2x^2y + x + \sin \, y = C. \nonumber \]
Does this method always work? The answer is no. We can tell if the method works by remembering that for a function with continuous partial derivatives, the mixed partials are order independent. That is
\[ f_{xy} = f_{yx} .\nonumber \]
If we have the differential equation
\[ M(x,y) + N(x,y)y' = 0 \nonumber \]
then we say it is an exact differential equation if
\[ M_y(x,y) = N_x(x,y) . \nonumber \]
Let \(M\), \(N\), \(M_y\), and \(N_x\) be continuous with
\[ M_y = N_x.\nonumber \]
Then there is a function \(f(x,y)\) with
\( f_x = M \) and \( f_y = N \)
such that
\[ f(x,y) = C \nonumber \]
is a solution to the differential equation
\[ M(x,y) + N(x,y)y' = 0 .\nonumber \]
Solve the differential equation
\[ y + (2xy - e^{-2y})y' = 0 . \nonumber \]
Solution
We have
\[ M(x,y) = y\nonumber \]
and
\[N(x,y) = 2xy - e^{-2y}. \nonumber \]
Now calculate
\[ M_y = 1 \;\;\; \text{and} \;\;\; N_x = 2y. \nonumber \]
Since they are not equal, finding a potential function \(f\) is hopeless. However there is a glimmer of hope if we remember how we solved first order linear differential equations. We multiplied both sides by an integrating factor \(m\). We do that here to get
\[ mM + mN_y' = 0 .\nonumber \]
For this to be exact we must have
\[ (mM)_y = (mN)_x . \nonumber \]
Using the product rule gives
\[ m_yM + mM_y = m_xN + mN_x . \nonumber \]
We now have a new differential equation that is unfortunately more difficult to solve than the original differential equation. We simplify the equation by assuming that either m is a function of only \(x\) or only \(y\). If it is a function of only \(x\), then \( m_y = 0 \) and
\[ mM_y = m_xN + mN_x .\nonumber \]
Solving for \(m_x\), we get
\[ m_x = \dfrac{M_y-N_x}{N}. \nonumber \]
If this is a function of \(y\) only, then we will be able to find an integrating factor that involves \(y\) only. If it is a function of only \(y\), then \( m_x = 0\) and
\[ m_yM + mM_y = mN_x . \nonumber \]
Solving for \(m_y\), we get
\[ m_y = \dfrac{N_x-M_y}{M} m .\nonumber \]
If this is a function of \(y\) only, then we will be able to find an integrating factor that involves \(y\) only.
For our example
\[ m_y = \dfrac{N_x - M_y }{M} m = \dfrac{2y-1}{y} m = (2-\frac{1}{y})m .\nonumber \]
Separating gives
\[ \dfrac{dm}{m} = (2-\frac{1}{y}) \,dy. \nonumber \]
Integrating gives
\[ ln \, m = 2y - ln\, y. \nonumber \]
\[ m = e^{2y - ln\, y} = y ^{-1}e^{2y}. \nonumber \]
Multiplying both sides of the original differential equation by \(m\) gives
\[ y(y ^{-1}e^{2y}) + (y ^{-1}e^{2y})(2xy - e^{-2y})y' = 0 \nonumber \]
\[ \implies e^{2y} + (2xe^{2y} - \frac{1}{y})y' = 0 . \nonumber \]
Now we see that
\[ M_y = 2e^{2y} = N_x. \nonumber \]
Which tells us that the differential equation is exact. We therefore have
\[ f_x (x,y) = e^{2y}. \nonumber \]
Integrating with respect to \(x\) gives
\[ f(x,y) = xe^{2y} + C(y). \nonumber \]
Now taking the partial derivative with respect to \(y\) gives
\[ f_y(x,y) = 2xe^{2y} + C'(y) = 2xe^{2y} - \frac{1}{y} .\nonumber \]
So that
\[ C'(y) = \frac{1}{y}. \nonumber \]
Integrating gives
\[ C(y) = ln\, y. \nonumber \]
The final solution is
\[ xe^{2y} + ln\, y = 0. \nonumber \]
Contributors and Attributions
- Larry Green (Lake Tahoe Community College)
Integrated by Justin Marshall.