1.2: First Order Differential Equations
- Page ID
- 91047
\( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \)
\( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)
\( \newcommand{\dsum}{\displaystyle\sum\limits} \)
\( \newcommand{\dint}{\displaystyle\int\limits} \)
\( \newcommand{\dlim}{\displaystyle\lim\limits} \)
\( \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}\)\(n\)-th order ordinary differential equation.
Before moving on, we first define an \(n\)-th order ordinary equation. It is an equation for an unknown function \(y(x)\) a relationship between the unknown function and its first \(n\) derivatives. One could write this generally as
\[F\left(y^{(n)}(x), y^{(n-1)}(x), \ldots, y^{\prime}(x), y(x), x\right)=0 \nonumber \]
Here \(y^{(n)} (x)\) represents the \(n\)th derivative of y(x).
Initial value problem.
An initial value problem consists of the differential equation plus the values of the first \(n-1\) derivatives at a particular value of the independent variable, say \(x_{0}\) :
\[y^{(n-1)}\left(x_{0}\right)=y_{n-1}, \quad y^{(n-2)}\left(x_{0}\right)=y_{n-2}, \quad \ldots, \quad y\left(x_{0}\right)=y_{0} \nonumber \]
Linear \(n\)th order differential equation.
A linear \(n\)th order differential equation takes the form
\[\left.a_{n}(x) y^{(n)}(x)+a_{n-1}(x) y^{(n-1)}(x)+\ldots+a_{1}(x) y^{\prime}(x)+a_{0}(x) y(x)\right)=f(x) \nonumber \]
Homogeneous and nonhomogeneous equations.
If \(f(x) \equiv 0\), then the equation is said to be homogeneous, otherwise it is called nonhomogeneous.
First order differential equation.
Typically, the first differential equations encountered are first order equations. A first order differential equation takes the form
\[F\left(y^{\prime}, y, x\right)=0 \nonumber \]
There are two common first order differential equations for which one can formally obtain a solution. The first is the separable case and the second is a first order equation. We indicate that we can formally obtain solutions, as one can display the needed integration that leads to a solution. However, the resulting integrals are not always reducible to elementary functions nor does one obtain explicit solutions when the integrals are doable.
Separable Equations
A first order equation is separable if it can be written the form
\[\dfrac{d y}{d x}=f(x) g(y) \label{5}\]
Special cases result when either \(f(x)=1\) or \(g(y)=1 \). In the first case the equation is said to be autonomous.
Separable equations. The general solution to Equation \ref{5} is obtained in terms of two integrals:
\[\int \dfrac{d y}{g(y)}=\int f(x) d x+C, \label{6}\]
where \(C\) is an integration constant. This yields a 1-parameter family of solutions to the differential equation corresponding to different values of C. If one can solve Equation \ref{6} for \(y(x)\), then one obtains an explicit solution. Otherwise, one has a family of implicit solutions. If an initial condition is given as well, then one might be able to find a member of the family that satisfies this condition, which is often called a particular solution.
\(y^{\prime}=2 x y, y(0)=2\).
Solution
Applying Equation \(\PageIndex{6}\), one has
\[\int \dfrac{d y}{y}=\int 2 x d x+C \nonumber \]
Intergrating yields
\[ln \lvert y \rvert = x^2 +C. \nonumber \]
Exponentiating, one obtains the general solution,
\[y(x)=\pm e^{x^{2}+C}=A e^{x^{2}} \nonumber \]
Here we have defined \(A=\pm e^{C}\). Since \(C\) is an arbitrary constant, \(A\) is an arbitrary constant. Several solutions in this 1 -parameter family are shown in Figure \(\PageIndex{1}\).
Next, one seeks a particular solution satisfying the initial condition. For \(y(0)=2\), one finds that \(A=2 \). So, the particular solution satisfy-ing the initial condition is \(y(x)=2 e^{x^{2}}\).
\(y y^{\prime}=-x \). Following the same procedure as in the last example, one obtains:
\[\int y d y=-\int x d x+C \Rightarrow y^{2}=-x^{2}+A, \quad \text { where } \quad A=2 C \nonumber \]
Then we obtain an implicit solution. Writing the solution as \(x^{2}+y^{2}=\).
Thus, we obtain an implicit solution. Writing the solution as \(x^{2}+y^{2}=\) \(A\), we see that this is a family of circles for \(A>0\) and the origin for \(A=0 \). Plots of some solutions in this family are shown in Figure \(\PageIndex{2}\).
Linear First Order Equations
The second type of first order equation encountered is the linear first order differential equation in the standard form
\[y^{\prime}(x)+p(x) y(x)=q(x) \nonumber \]
In this case one seeks an integrating factor, \(\mu(x)\), which is a function that one can multiply through the equation making the left side a perfect derivative. Thus, obtaining,
\[\dfrac{d}{d x}[\mu(x) y(x)]=\mu(x) q(x) \nonumber \]
The integrating factor that works is \(\mu(x)=\exp \left(\int^{x} p(\xi) d \xi\right) \). One can derive \(\mu(x)\) by expanding the derivative in Equation \(\PageIndex{8}\),
\[\mu(x) y^{\prime}(x)+\mu^{\prime}(x) y(x)=\mu(x) q(x) \nonumber \]
and comparing this equation to the one obtained from multiplying \(\PageIndex{7}\) by \(\mu(x):\)
\[\mu(x) y^{\prime}(x)+\mu(x) p(x) y(x)=\mu(x) q(x) \nonumber \]
Note that these last two equations would be the same if the second terms were the same. Thus, we will require that
\[\dfrac{d \mu(x)}{d x}=\mu(x) p(x) \nonumber \]
Integrating factor
This is a separable first order equation for \(\mu(x)\) whose solution is the integrating factor:
\[\mu(x)=\exp \left(\int^{x} p(\xi) d \xi\right) \nonumber \]
Equation \(\PageIndex{8}\) is now easily integrated to obtain the general solution to the linear first order differential equation:
\[y(x)=\dfrac{1}{\mu(x)}\left[\int^{x} \mu(\xi) q(\xi) d \xi+C\right] \nonumber \]
\(x y^{\prime}+y=x, \quad x>0, y(1)=0\).
One first notes that this is a linear first order differential equation. Solving for \(y^{\prime}\), one can see that the equation is not separable. Furthermore, it is not in the standard form \(\PageIndex{7}\). So, we first rewrite the equation as
\[\dfrac{d y}{d x}+\dfrac{1}{x} y=1 \nonumber \]
Noting that \(p(x)=\dfrac{1}{x}\), we determine the integrating factor
\[\mu(x)=\exp \left[\int^{x} \dfrac{d \xi}{\xi}\right]=e^{\ln x}=x\nonumber \]
Multiplying Equation \(\PageIndex{13}\) by \(\mu(x)=x\), we actually get back the original equation! In this case we have found that \(x y^{\prime}+y\) must have been the derivative of something to start. In fact, \((x y)^{\prime}=x y^{\prime}+x\). Therefore, the differential equation becomes
\[(x y)^{\prime}=x . \nonumber \]
Integrating, one obtains
\[x y=\dfrac{1}{2} x^{2}+C \nonumber \]
Or
\[y(x)=\dfrac{1}{2} x+\dfrac{C}{x} \nonumber \]
Inserting the initial condition into this solution, we have \(0=\dfrac{1}{2}+C\). Therefore, \(C=-\dfrac{1}{2}\). Thus, the solution of the initial value problem is
\[y(x)=\dfrac{1}{2}\left(x-\dfrac{1}{x}\right) \nonumber \]
We can verify that this is the solution. Since \(y^{\prime}=\dfrac{1}{2}+\dfrac{1}{2 x^{2}}\), we have
\[x y^{\prime}+y=\dfrac{1}{2} x+\dfrac{1}{2 x}+\dfrac{1}{2}\left(x-\dfrac{1}{x}\right)=x . \nonumber \]
Also, \(y(1)=\dfrac{1}{2}(1-1)=0\).
\((\sin x) y^{\prime}+(\cos x) y=x^{2}\).
Solution
Actually, this problem is easy if you realize that the left hand side is a perfect derivative. Namely,
\[\dfrac{d}{d x}((\sin x) y)=(\sin x) y^{\prime}+(\cos x) y \nonumber \]
But, we will go through the process of finding the integrating factor for practice.
First, we rewrite the original differential equation in standard form. We divide the equation by \(\sin x\) to obtain
\[y^{\prime}+(\cot x) y=x^{2} \csc x \nonumber \]
Then, we compute the integrating factor as
\[\(\mu(x)=\exp \left(\int^{x} \cot \xi d \xi\right)=e^{\ln (\sin x)}=\sin x\]
Using the integrating factor, the standard form equation becomes
\[\dfrac{d}{d x}((\sin x) y)=x^{2} \nonumber \]
Integrating, we have
\[y \sin x=\dfrac{1}{3} x^{3}+C \nonumber \]
So, the solution is
\[y(x)=\left(\dfrac{1}{3} x^{3}+C\right) \csc x \nonumber \]
There are other first order equations that one can solve for closed form solutions. However, many equations are not solvable, or one is simply interested in the behavior of solutions. In such cases one turns to direction fields or numerical methods. We will return to a discussion of the qualitative behavior of differential equations later and numerical solutions of ordinary differential equations later in the book.
Exact Differential Equations
Some first order differential equations can be solved easily if they are what are called exact differential equations. These equations are typically written using differentials. For example, the differential equation
\[N(x, y) \dfrac{d y}{d x}+M(x, y)=0 \nonumber \]
can be written in the form
\[M(x, y) d x+N(x, y) d y=0 \nonumber \]
This is seen by multiplying Equation \(\PageIndex{14}\) by \(d x\) and noting from calculus that for a function \(y=y(x)\), the relation between the differentials \(d x\) and \(d y\) is
\[d y=\dfrac{d y}{d x} d x \nonumber \]
Differential one-forms. The expression \(M(x, y) d x+N(x, y) d y\) is called a differential one-form. Such a one-form is called exact if there is a function \(u(x, y)\) such that
\[M(x, y) d x+N(x, y) d y=d u \nonumber \]
Exact one-form. However, from calculus we know that for any function \(u(x, y)\),
\[d u=\dfrac{\partial u}{\partial x} d x+\dfrac{\partial u}{\partial y} d y \nonumber \]
If \(d u=M(x, y) d x+N(x, y) d y\), then we have
\[ \begin{aligned} &\dfrac{\partial u}{\partial x}=M(x, y) \\[4pt] &\dfrac{\partial u}{\partial y}=N(x, y) \end{aligned}\label{1.25} \]
Since
\[\dfrac{\partial^{2} u}{\partial x \partial y}=\dfrac{\partial^{2} u}{\partial y \partial x} \nonumber \]
when these second derivatives are continuous, by Clairaut’s Theorem, then we have
\[\dfrac{\partial M}{\partial y}=\dfrac{\partial N}{\partial x} \nonumber \]
must hold if \(M(x, y) d x+N(x, y) d y\) is to be an exact one-form.
In summary, we have found that
Conditions for \(M(x, y) d x+N(x, y) d y=0\) to be exact
The differential equation \(M(x, y) d x+N(x, y) d y=0\) is exact in the domain \(D\) of the \(x y\)-plane for \(M, N, M_{y}\), and \(N_{x}\) continuous functions in \(D\) if and only if
\[\dfrac{\partial M}{\partial y}=\dfrac{\partial N}{\partial x} \nonumber \]
holds in the domain.
Furthermore, if \(d u=M(x, y) d x+N(x, y) d y=0\), then \(u(x, y)=C\), for \(C\) an arbitrary constant. Thus, an implicit solution can be found as
\[\int_{x_{0}}^{x} M(x, y) d x+\int_{y_{0}}^{y} N(x, y) d y=C \nonumber \]
We show this in the following example.
Show that \(\left(x^{3}+x y^{2}\right) d x+\left(x^{2} y+y^{3}\right) d y=0\) is an exact differential equation and obtain the corresponding implicit solution
We first note that
\[\dfrac{\partial M}{\partial y}=2 x y, \quad \dfrac{\partial N}{\partial x}=2 x y \nonumber \]
Since these partial derivatives are the same, the differential equation is exact. So, we need to find the function \(u(x, y)\) such that \(d u=\left(x^{3}+\right\). \(\left.x y^{2}\right) d x+\left(x^{2} y+y^{3}\right) d y \).
First, we note that \(x^{3}=d\left(\dfrac{x^{4}}{4}\right)\) and \(y^{3}=d\left(\dfrac{y^{4}}{4}\right)\). The remaining terms can be combined to find that
\[ \begin{aligned} x y^{2} d x+x^{2} y d y &=x y(y d x+x d y) \\[4pt] &=x y d(x y) \\[4pt] &=d\left(\dfrac{(x y)^{2}}{2}\right) \end{aligned} \label{1.26} \]
Combining these results, we have
\[u=\dfrac{x^{4}}{4}+\dfrac{x^{2} y^{2}}{2}+\dfrac{y^{4}}{4}=C \nonumber \]
What if the one-form is not exact?
So, what if \(M(x, y) d x+N(x, y) d y\) is not exact? We can multiply the oneform by an integrating factor, \(\mu(x)\), and try to make he resulting form exact. We let
\[d u=\mu M d x+\mu N d y \nonumber \]
For the new form to be exact, we have to require that
\[\dfrac{\partial}{\partial y}(\mu M)=\dfrac{\partial}{\partial x}(\mu N) \nonumber \]
Carrying out the differentiation, we have
\[N \dfrac{\partial \mu}{\partial x}-M \dfrac{\partial \mu}{\partial y}=\mu\left(\dfrac{\partial M}{\partial y}-\dfrac{\partial N}{\partial x}\right) \nonumber \]
Thus, the integrating factor satisfies a partial differential equation. If the integrating factor is a function of only \(x\) or \(y\), then this equation reduces to ordinary differential equations for \(\mu\).
As an example, if \(\mu=\mu(x)\), then the integrating factor satisfies
\[N \dfrac{d \mu}{d x}=\mu\left(\dfrac{\partial M}{\partial y}-\dfrac{\partial N}{\partial x}\right) \nonumber \]
Or
\[N \dfrac{d \ln \mu}{d x}=\dfrac{\partial M}{\partial y}-\dfrac{\partial N}{\partial x} \nonumber \]
If \(\dfrac{\mu}{N}\left(\dfrac{\partial M}{\partial y}-\dfrac{\partial N}{\partial x}\right)\) is only a function of \(x\),
then \(\mu=\mu(x)\).
If \(\dfrac{\mu}{M}\left(\dfrac{\partial N}{\partial x}-\dfrac{\partial M}{\partial y}\right)\) is only a function of \(y\),
then \(u=u(y)\).
Find the general solution to the differential equation \(\left(1+y^{2}\right) d x+x y d y=0 \).
Solution
First, we note that this is not exact. We have \(M(x, y)=1+y^{2}\) and \(N(x, y)=x y \). Then,
\[\dfrac{\partial M}{\partial y}=2 y, \quad \dfrac{\partial N}{\partial x}=y \nonumber \]
Therefore, the differential equation is not exact.
Next, we seek the integrating factor. We let
\[d u=\mu\left(1+y^{2}\right) d x+\mu x y d y \nonumber \]
For the new form to be exact, we have to require that
\[x y \dfrac{\partial \mu}{\partial x}-\left(1+y^{2}\right) \dfrac{\partial \mu}{\partial y}=\mu\left(\dfrac{\partial\left(1+y^{2}\right)}{\partial y}-\dfrac{\partial x y}{\partial x}\right)=\mu y \nonumber \]
\[\begin{aligned} & \text { If \(\mu=\mu(x)\), then
\[x \dfrac{d \mu}{d x}=\mu. \nonumber \]
This is easily solved as a separable first order equation. We find that \(\mu(x)=x\).
Multiplying the original equation by \(\mu=x\), we obtain
\[0=x\left(1+y^{2}\right) d x+x^{2} y d y=d\left(\dfrac{x^{2}}{2}+\dfrac{x^{2} y^{2}}{2}\right) \nonumber \]
Thus,
\[\dfrac{x^{2}}{2}+\dfrac{x^{2} y^{2}}{2}=C \nonumber \]
gives the solution.


