6.1 First Order Equations of the First Degree

A differential equation of first order and first degree can always be put into the form \[M\hspace {0.1cm} dx + N\hspace {0.1cm} dy = 0\hspace {0.3cm}\cdots \cdots \cdots \hspace {0.4cm} (1)\] \(M\) and \(N\) are functions of \(x\) and \(y\). When these functions satisfy certain conditions, the solution is relatively easy to find and can be written as \(f(x,y) = 0\).

6.1.1 Separable Equations

When \(M\) is a function of \(x\) alone and \(N\) is a function of \(y\), then the equation (1) has the form \[M(x)\hspace {0.1cm}dx + N(y)\hspace {0.1cm} = 0\] which is a standard form of a first order separable DE. Once the equation has been put in standard form, we can find its solution by direct integration of each term, giving us \[\int M\hspace {0.1cm}dx + \int N\hspace {0.1cm}dy = 0\]

Example 6.1.1.

Solve the differential equation \(\hspace {0.2cm} \displaystyle {\dfrac {dy}{dx} = (1 + y^2 ) e^x}\)

Solution.

\(\displaystyle {dy = (1 + y^2 ) e^x\hspace {0.1cm}dx}\)

\(\displaystyle {\dfrac {1}{1 + y^2}\hspace {0.1cm} dy = e^x\hspace {0.1cm} dx \implies e^x\hspace {0.1cm}dx -\dfrac {1}{1 + y^2}\hspace {0.1cm}dy = 0}\)

\[M(x) = e^x\hspace {0.5cm} , \hspace {0.5cm} N(y) = \frac {-1}{1 + y^2}\]

\[\implies \hspace {0.5cm} \int e^x\hspace {0.1cm} dx - \int \frac {1}{1 + y^2}dy = c\]

\[\implies \hspace {0.5cm} e^x - \tan ^{-1}(y) = c\]

\[\implies \hspace {0.5cm} \tan ^{-1}(y) = e^x - c\]

\[\implies \hspace {0.5cm} y = tan (e^x - c)\]

6.1.2 Homogeneous Equations

If a DE has variables that can not be separated it can be transformed by a change of variable into an equation whose variables can be separated. This is the case with any equation that be put into the form \[\frac {dy}{dx} = F\Big (\dfrac {y}{x}\Big )\hspace {0.3cm}\cdots \cdots \cdots \hspace {0.3cm} (3)\] such an equation is called homogeneous. To transform (3) we introduce the new variable \[ v = \frac {y}{x}\hspace {0.3cm}\cdots \cdots \cdots \hspace {0.4cm} (4)\]

\[\implies \hspace {0.5cm} y = vx \implies \frac {dy}{dx} = v + x\frac {dv}{dx}\] so that (3) becomes \(\displaystyle {v + x\frac {dv}{dx} = F(v)}\)

\[\implies \hspace {0.5cm} v - F(v) + x\frac {dv}{dx} = 0\]

\[dx\big [v - F(v)\big ] + xdv = 0\]

\[\frac {dx}{x}\big [v - F(v)\big ] + dv = 0\]

\[\frac {dx}{x} + \frac {dv}{v - F(v)} = 0 \hspace {0.3cm} \cdots \cdots \cdots \hspace {0.3cm} (5)\]

Example 6.1.2.

Show that the equation \((x^2 + y^2)dx + 2xydy = 0\) is homogeneous and solve it.

Solution.

We write in the form \(\displaystyle {\frac {dy}{dx} = F\big (y/x\big )}\)

\[2xy\frac {dy}{dx} = - (x^2 + y^2)\]

\[\implies \hspace {0.5cm} \frac {dy}{dx} = \frac {-(x^2 + y^2)}{2xy} = \frac {-x^2\Big (1 + y^2/x^2\Big )}{2xy}\]

\[\implies \hspace {0.4cm} \frac {dy}{dx} = \frac {-\Big [1 + \Big (\dfrac {y}{x}\Big )^2\Big ]}{2\Big (y/x\Big )} = F\Big (y/x\Big )\]

Hence the DE is homogeneous. Let \(v = y/x\) so that \(\displaystyle {F(v) = \dfrac {-1(1 + v^2)}{2v}}\) and we have \[\frac {dx}{x} + \frac {dv}{v + \dfrac {(1+2)}{2v}} = 0\]

or \(\displaystyle {\frac {dx}{x} + \frac {2vdv}{3v^2 + 1} = 0}\)

\begin {align*} \int \frac {dx}{x} + \int \frac {2v}{3v^2 + 1}\hspace {0.1cm}dv & = C_0\\ \ln x + \dfrac {1}{3} \ln \big [3v^2 + 1\big ] & = C_0\\ 3\ln x + \ln (3v^2 + 1) & = C_1\\ \ln x^3 + \ln (3v^2 + 1) & = C_1\\ \ln \Big [x^3\big (3v^2+1\big )\Big ] & = C_1\\\\ \implies \hspace {0.4cm} x^3\big (3v^2 + 1 \big ) & = e^{C_1}\\ x^3\big (3v^2 + 1\big ) & = C_2\\ \end {align*}

but \( v = \dfrac {y}{x} \) so \(\hspace {0.3cm} \displaystyle {x^3\Bigg (\dfrac {3y^2}{x^2} + 1 \Bigg ) = C_2} \implies 3xy^2 + x^3 = C_2\) or \(\hspace {0.3cm} x(3y^2 +x^2) = C_2\).

6.1.3 Linear Equations

A linear differential equation of first order can always be put into the standard form \[\frac {dy}{dx} + P(x)y = Q(x)\hspace {0.3cm} \cdots \cdots \cdots \hspace {0.3cm} (6)\] One common method for solving equation (6) is to find a function \(h = h(x)\) such that if the equation is multiplied by \(h\), the left side becomes the derivatives of he product \(hy\). That is we multiply (6) by \(h\). \[h\frac {dy}{dx} + h Py = hQ\hspace {0.4cm} \cdots \cdots \cdots \hspace {0.4cm} (7)\] and impose upon \(h\) the condition that \[h\dfrac {dy}{dx} + hPy = \frac {d}{dx}[hy]\]

\[\implies \hspace {0.5cm} h\frac {dy}{dx} + hPy = \frac {dh}{dx}y + h\frac {dy}{dx}\]

\[\implies \hspace {0.5cm} h Py = y \frac {dh}{dx}\]

\(\displaystyle {\implies \hspace {0.5cm} \frac {dh}{dx} = h P}\). But \(P = P(x) \hspace {0.3cm}\implies \hspace {0.3cm} \displaystyle {\dfrac {dh}{h} = P(x)dx}\)

\(\ln h = \int P(x)dx + c\)

\(\displaystyle {\implies \hspace {0.5cm} h = Ke^{\int P(x)dx}}\)

Set \(K=1\), to get \(\displaystyle {h =e^{\int P(x)dx}}\). The function \(\displaystyle {h(x) = e^{\int P(x)dx}}\) is called the Integration factor of the equation (6), with its help equation (7) becomes

\begin {align*} \frac {d}{dx}\big [hy\big ] & = hQ\\ hy & = \int hQ\hspace {0.1cm}dx\\ y = \frac {1}{h}\int hQ\hspace {0.1cm} dx \end {align*}

Thus, the solution of \(\displaystyle {\frac {dy}{dx} + P(x)y = Q(x)}\) is \[y(x) = e^{-\int P(x)dx}\Bigg [\int e^{\int P(x)dx}Q(x)dx + C\Bigg ]\] where \(\displaystyle {e^{\int P(x)dx}}\) is the integrating Factor (IF).

Example 6.1.3.

1.
Solve the DE \(\displaystyle {\frac {dy}{dx} + y = e^x}\).
2.
Solve \(\hspace {0.4cm} \displaystyle {x\frac {dy}{dx} - 3y = x^2 \hspace {0.2cm} , \hspace {0.3cm} x>0}\)

Solution.

Part 1

Equation is already in standard form with \(P(x) = 1 \hspace {0.2cm} , \hspace {0.2cm} Q(x) = e^x\)

\[I.F = e^{\int P(x)dx} = e^{\int dx} = e^x\]

I.F satisfies \(\displaystyle {\frac {d}{dx}\big [e^xy\big ] = e^x Q(x)}\)

\[\implies \hspace {0.4cm} \frac {d}{dx}\big [e^xy\big ] = e^x\cdot e^x\]

\[\implies \hspace {0.5cm} \frac {d}{dx}\big [e^xy\big ] = e^{2x}\]

\[\implies \hspace {0.5cm} e^xy = \int e^{2x}\hspace {0.1cm}dx\]

\[\implies \hspace {0.5cm} e^xy = \dfrac {1}{2}e^{2x} + c\]

\[\implies \hspace {0.5cm} y(x) = e^{-x}\Bigg [\dfrac {e^{2x}}{2} + c\Bigg ]\]

\[\therefore \hspace {0.5cm} y(x) = \frac {1}{2}e^2 + ce^{-x}\]

Part 2

\(\displaystyle {\frac {dy}{dx} - \frac {3}{x} y = x\hspace {0.3cm} , \hspace {0.3cm} x>0}\)

\[P(x) = \frac {-3}{x}\hspace {0.4cm} , \hspace {0.4cm} Q(x) = x\]

\[I.F = e^{\int \big (-3/x\big )dx} = e^{-3\ln x} = e^{\ln x^{-3}} =x^{-3}\]

\begin {align*} \therefore \hspace {0.5cm} \frac {d}{dx}\big [x^{-3}y\big ] & = x^{-3} (x)\\ \frac {d}{dx}\big [x^{-3}y\big ] & = x^{-2} \end {align*}

\begin {align*} x^{-3}y & = \int x^{-2} dx\\ \implies \hspace {0.5cm} x^{-3}y & = -x^{-1} + c\\\\ \therefore \hspace {0.5cm} y(x) & = -x^2 + cx^3\\ \end {align*}

6.1.4 Exact Equations

An equation that can be written in the form, \[M(x,y)\hspace {0.1cm}dx + N(x,y)\hspace {0.1cm}dy = 0\hspace {0.3cm} \cdots \cdots \cdots \hspace {0.4cm} (8)\] so that \((8)\) becomes \(df = 0\) and the solution \(f(x,y)\) satisfies \(f(x,y) = C\), \(C\) a constant and \(f\) satisfies \(\dfrac {\partial f}{\partial x} = M(x,y)\) and \(\dfrac {\partial f}{\partial y} = N(x,y)\).

The method in practice

Condition \((9)\) is what makes the method work, so it is always checked first. If it holds, integrate \(M\) with respect to \(x\), remembering that the constant of integration may depend on \(y\): \[f(x,y) = \int M(x,y)\,dx + g(y).\] Then differentiate the result with respect to \(y\), set it equal to \(N\), and solve for \(g'(y)\). The point of the exactness condition is precisely that \(g'(y)\) comes out free of \(x\); if an \(x\) survives, the equation was not exact and an error has been made.

Example 6.1.4. Solve \(\hspace {0.3cm}\big (2xy + 3\big )dx + \big (x^2 - 1\big )dy = 0\).

Solution. Here \(M = 2xy + 3\) and \(N = x^2 - 1\). Testing \((9)\), \[\frac {\partial M}{\partial y} = 2x,\qquad \frac {\partial N}{\partial x} = 2x,\] so the equation is exact. Integrating \(M\) with respect to \(x\), \[f(x,y) = \int \big (2xy + 3\big )dx = x^2y + 3x + g(y).\] Differentiating with respect to \(y\) and comparing with \(N\), \[\frac {\partial f}{\partial y} = x^2 + g'(y) = x^2 - 1 \hspace {0.5cm}\implies \hspace {0.5cm} g'(y) = -1 \hspace {0.5cm}\implies \hspace {0.5cm} g(y) = -y .\] The \(x^2\) cancels, as exactness guarantees it must. Hence \[\boxed {x^2y + 3x - y = C}\]

The answer can be checked without solving anything: the total differential of \(x^2y + 3x - y\) is \(\big (2xy+3\big )dx + \big (x^2-1\big )dy\), which is the equation we started from.

6.1.5 Integrating Factors

Most equations \(M\,dx + N\,dy = 0\) are not exact. Sometimes they can be made so by multiplying throughout by a suitable function \(\mu (x,y)\), called an integrating factor. Finding one in general is harder than solving the equation, but there are two cases in which it is easy.

If \(\hspace {0.2cm}\displaystyle {\frac {1}{N}\Bigg (\frac {\partial M}{\partial y} - \frac {\partial N}{\partial x}\Bigg )}\hspace {0.2cm}\) is a function of \(x\) alone, say \(p(x)\), then \[\boxed {\mu (x) = e^{\int p(x)\,dx}}\] is an integrating factor. Symmetrically, if \(\hspace {0.2cm}\displaystyle {\frac {1}{M}\Bigg (\frac {\partial N}{\partial x} - \frac {\partial M}{\partial y}\Bigg )}\hspace {0.2cm}\) is a function of \(y\) alone, say \(q(y)\), then \(\mu (y) = e^{\int q(y)\,dy}\) works.

Note. The linear equation of the previous subsection is the special case of this. For \(\dfrac {dy}{dx} + P(x)y = Q(x)\), written as \(\big (Py - Q\big )dx + dy = 0\), the first test gives \(p(x) = P(x)\) and hence the familiar integrating factor \(e^{\int P\,dx}\).

Example 6.1.5. Solve \(\hspace {0.3cm}\big (3xy + y^2\big )dx + \big (x^2 + xy\big )dy = 0\).

Solution. With \(M = 3xy + y^2\) and \(N = x^2 + xy\), \[\frac {\partial M}{\partial y} = 3x + 2y,\qquad \frac {\partial N}{\partial x} = 2x + y,\] which are not equal, so the equation is not exact. Applying the first test, \[\frac {1}{N}\Bigg (\frac {\partial M}{\partial y} - \frac {\partial N}{\partial x}\Bigg ) = \frac {x + y}{x^2 + xy} = \frac {x+y}{x(x+y)} = \frac {1}{x},\] a function of \(x\) alone. Hence \[\mu (x) = e^{\int \frac {1}{x}dx} = e^{\ln x} = x .\] Multiplying the equation by \(x\), \[\big (3x^2y + xy^2\big )dx + \big (x^3 + x^2y\big )dy = 0 ,\] which is exact, since both partial derivatives are now \(3x^2 + 2xy\). Then \[f(x,y) = \int \big (3x^2y + xy^2\big )dx = x^3y + \frac {x^2y^2}{2} + g(y),\] \[\frac {\partial f}{\partial y} = x^3 + x^2y + g'(y) = x^3 + x^2y \implies g'(y) = 0 .\] Therefore \[\boxed {x^3y + \frac {x^2y^2}{2} = C}\]

6.1.6 Bernoulli Equations

An equation of the form \[\frac {dy}{dx} + P(x)y = Q(x)y^n \hspace {0.3cm}\cdots \cdots \cdots \hspace {0.4cm} (11)\] is called a Bernoulli equation. For \(n = 0\) it is linear and for \(n = 1\) it is separable, so the interesting case is \(n \neq 0, 1\), where it is neither.

It is made linear by a substitution. Divide \((11)\) throughout by \(y^n\): \[y^{-n}\frac {dy}{dx} + P(x)y^{1-n} = Q(x).\] The substitution \[\boxed {v = y^{1-n}}\] gives \(\dfrac {dv}{dx} = (1-n)y^{-n}\dfrac {dy}{dx}\), so multiplying through by \((1-n)\) turns the equation into \[\frac {dv}{dx} + (1-n)P(x)\,v = (1-n)Q(x),\] which is linear in \(v\) and is solved by the integrating factor of the previous subsection. Afterwards, substitute back.

Example 6.1.6. Solve \(\hspace {0.3cm}\dfrac {dy}{dx} + \dfrac {y}{x} = xy^2\).

Solution. This is Bernoulli with \(P = \dfrac {1}{x}\), \(Q = x\) and \(n = 2\). Put \(v = y^{1-n} = y^{-1}\), so that \(\dfrac {dv}{dx} = -y^{-2}\dfrac {dy}{dx}\).

Dividing the equation by \(y^2\), \[y^{-2}\frac {dy}{dx} + \frac {1}{x}y^{-1} = x ,\] and substituting, \[-\frac {dv}{dx} + \frac {v}{x} = x \hspace {0.5cm}\implies \hspace {0.5cm} \frac {dv}{dx} - \frac {v}{x} = -x ,\] which is linear. Its integrating factor is \[e^{\int -\frac {1}{x}dx} = e^{-\ln x} = \frac {1}{x},\] so \[\frac {d}{dx}\Big (\frac {v}{x}\Big ) = -1 \hspace {0.5cm}\implies \hspace {0.5cm} \frac {v}{x} = -x + C \hspace {0.5cm}\implies \hspace {0.5cm} v = Cx - x^2 .\] Since \(v = y^{-1}\), \[\boxed {y = \frac {1}{Cx - x^2}}\]

Note that \(y = 0\) is also a solution of the original equation, and it is not recovered by any choice of \(C\). Dividing by \(y^n\) at the start is what loses it.

Questions on this section

Stuck on something here? Ask below and it stays attached to this topic.