# Examples On First Order Differential Equations

**Example -13**

Solve the DE \(\begin{align}\frac{{dy}}{{dx}} + y\tan x = \cos x.\end{align}\)

**Solution:** Comparing this DE with the standard form of the linear DE \(\begin{align}\frac{{dy}}{{dx}} + Py = Q,\end{align}\) we see that

\[P(x) = \tan x, \quad Q(x) = \cos x\]

Thus, the I.F. is

\[\begin{align}I.F. = {e^{\int {\tan xdx} }} = {e^{\ln (\sec x)}} = \sec x\end{align}\]

Multiplying by \(\sec x\) on both sides of the given DE, we obtain

\[\sec x\frac{{dy}}{{dx}} + y\tan x\sec x = 1\]

The left hand side is an exact differential:

\[\begin{align}&\qquad \;\frac{d}{{dx}}(y\sec x) = 1\\&\Rightarrow \quad d\left( {y\sec x} \right) = dx\end{align}\]

Integrating both sides, we obtain the solution to our DE as

\[y\sec x = x + C\]

**Example - 14**

Solve the DE\(\begin{align}\frac{{dx}}{{dy}} + \frac{x}{y} = {y^2}.\end{align}\)

**Solution:** The I.F. is

\[\begin{align}I.F. & = {e^{\int {P(y)dy} }} & ({\rm{y\,is\,the\,'independent'\,variable\,in\,this\,DE}})\\ & = {e^{\int {\frac{1}{y}dy} }}\\ & = {e^{\ln y}}\\ & = y\end{align}\]

Multiplying by the I.F. on both sides, we have

\[\begin{align} & \qquad \;\;y\frac{{dx}}{{dy}} + x = {y^3}\\&\Rightarrow \quad \frac{d}{{dy}}(xy) = {y^3}\\&\Rightarrow \quad d(xy) = {y^3}dy\end{align}\]

Integrating both sides gives

\[xy = \frac{{{y^4}}}{4} + C\]

**Example – 15**

Solve the DE \(\begin{align}\frac{{dy}}{{dx}} = {x^3}{y^3} - xy.\end{align}\)

**Solution: **We have,

\[\frac{{dy}}{{dx}} + xy = {x^3}{y^3}\]

Note that since the RHS contains the term \({y^3},\) this DE is not in the standard linear DE form. However, a little artifice can enable us to reduce this to the standard form.

Divide both sides of the equation by \({y^3}.\)

\[\frac{1}{{{y^3}}}\frac{{dy}}{{dx}} + \frac{x}{{{y^2}}} = {x^3}\,\,\,\,\,\,\,\,\,\,\,\,\, \ldots (1)\]

Substitute \(\begin{align}\frac{1}{{{y^2}}} = v\end{align}\)

\[\begin{align}& \Rightarrow \quad \frac{{ - 2}}{{{y^3}}}\frac{{dy}}{{dx}} = \frac{{dv}}{{dx}}\\&\Rightarrow \quad \frac{1}{{{y^3}}}\frac{{dy}}{{dx}} = \frac{{ - 1}}{2}\frac{{dv}}{{dx}} \qquad \qquad \ldots (2)\end{align}\]

Using (2) in (1), we have

\[\begin{align}&\qquad \;\frac{{ - 1}}{2}\frac{{dv}}{{dx}} + xv = {x^3}\\&\Rightarrow \quad \frac{{dv}}{{dx}} + ( - 2x)v = - 2{x^3} \qquad \qquad \cdots (3)\end{align}\]

This is now in the standard first-order linear DE form. The I.F. is

\[I.F. = {e^{\int { - 2xdx} }} = {e^{ - {x^2}}}\]

Thus, the solution to (3) is

\[\begin{align}& \qquad \;\;v \times I.F. = \int {Q(x) \times (I.F)dx} \\&\Rightarrow \quad v{e^{ - {x^2}}} = - 2\int {{x^3}{e^{ - {x^2}}}dx}\end{align}\]

Performing the integration on the RHS by the substitution \(t = - {x^2}\) and then using integration by parts, we obtain

\[\begin{align}&\qquad \;\; v{e^{ - {x^2}}} = {e^{ - {x^2}}}({x^2} + 1) + C\\&\Rightarrow \quad \frac{1}{{{y^2}}}{e^{ - {x^2}}} = {e^{ - {x^2}}}({x^2} + 1) + C\end{align}\]

This is the required general solution to the DE.

This example also tells us how to solve a DE of the general form

\[\frac{{dy}}{{dx}} + P(x)y = Q(x){y^n} \qquad \qquad \ldots (4)\]

We divide by \({y^n}\) on both sides:

\[\frac{1}{{{y^n}}}\frac{{dy}}{{dx}} + P(x){y^{ - n + 1}} = Q(x)\]

and then substitute \({y^{ - n + 1}} = v\) and proceed as described in the solution above.

DEs that take the form in (4) are known as Bernoulli’s DEs.