First Order Differential Equations with worked examples

View versions (3)

Examples with Separable Variables Differential Equations

This article presents some working examples with separable differential equations.

Definition

Separable Differential Equations are differential equations which respect one of the following forms :

  • \displaystyle \frac{dy}{dx} = F(x,y) where F is a two variable function,also continuous.
  • f(y)\;dy=g(x)\;dx, where f and g are two real continuous functions.

Rational Functions

A rational function f :\mathbb{R}\to\mathbb{R} is a real function respecting f(x)=\frac{P(x)}{Q(x)} where P,Q are polynomials.

Example 1
Problem

Solve: \frac{d^2y}{dx^2} = 2 + \frac{1}{x}

Workings

As the equation is of first order, integrate the function twice, i.e. \frac{dy}{dx} = 2x + ln\,x + C and y = x^2 + x\,ln\,x + Cx + K

Solution

y = x^2 + x\,ln\,x + Cx + K

Trigonometric Functions

A trigonometric function is a real function f:\mathbb{R} \to\mathbb{R} where f(x) contains one or more of the trigonometric functions :

  • Sin(x),Cos(x),Tan(x),Cotan(x)
  • Arcsine(x),Arccos(x),Arctan(x),Arccotan(x)
Example 1
Problem

\frac{dy}{dx}=\frac{1}{cos^2 \tfrac{1}{2}x}

Workings

This is the same as y=\int \frac{1}{\cos^2 \tfrac{1}{2}x}dx

which we integrate in the normal way to yield y=2\tan \tfrac{1}{2} x + C

Solution

y=2\tan \tfrac{1}{2} x + C

Physics Examples

Example 1
Problem

If a and b are the radii of concentric spherical conductors at potentials of V_1 respectively, then V is the potential at a distance r from the centre. Find the value of V if: \frac{d}{dr}\left(r^2 \frac{dV}{dr} \right)=0} and V=V_1 at r=a and V=0 at r=b

Workings

\frac{d}{dr}\left(r^2\frac{dV}{dr} \right)=0

\therefore\;\;\;\;\;\;r^2\frac{dV}{dr} \right)=A

\frac{dV}{A}=\frac{dr}{r^2}

\therefore\;\;\;\;\;\;\frac{V}{A}=-\frac{1}{r}\;+\;B

Substituting in the given values for V and r \frac{V_1}{A}=-\frac{1}{a}+B and \frac{0}{A}=-\frac{1}{b}+B \therefore\;\;\;\;\;\;B=\frac{1}{b} \therefore\;\;\;\;\;\;\frac{V_1}{A}=-\frac{1}{a}+\frac{1}{b}=-\frac{b-a}{ab} Thus A=-\frac{abV_1}{b-a}

Solution

V=\left(\frac{1}{r}-\frac{1}{b} \right)\left(\frac{abV_1}{b-a} \right)

Linear Type of Differential Equation

Equations of the type \frac{dy}{dx} + Py = Q

Where P and Q are function of x ( but not of y) are said to be linear of the first order

Example 1
Problem

\frac{dy}{dx} + \frac{1}{x}\times y = x^2

Workings

If each side of te equation is multiplied by x the equation becomes:-

x\frac{dy}{dx} +  y = x^3 i.e \frac{d}{dx}(xy) = x^3 Hence integrating \;x\,y = \frac{1}{4}x^4 + c

This equation has been solved by using the obvious integrating factor x. It is possible to find a more general solution by using R as and integrating factor.

Consider the following equation : R\frac{dy}{dx} + R\,P\,y = R\,Q

By Inspection the left hand side of this equation must reduce to (Ry) \therefore\;\;\;\;\;\;R\frac{dy}{dx} + RP\,y = \frac{d}{dx}(Ry) = R\frac{dy}{dx} +
y\frac{dR}{dx} This gives RPy = y\,\frac{dR}{dx}

\therefore\;\;\;\;\;\;P\,dx = \frac{dR}{R} Thus \int P\,dx = \ln\,R

\therefore\;\;\;\;\;\;R = e^{\int P\,dx}

This gives the rule that to solve \frac{dy}{dx} + Py = Q multiply both sides by an integrating factor of:-

e^{\int P\,dx}

Solution

Hence the Method of solving this type of equation is :

  • Reduce the equation into the form \mathbf{\frac{dy}{dx} + Py = Q}
  • Multiply through by the Integrating Factor:- \mathbf{e^{\int P\,dx}}
  • The equation becomes :-\mathbf{\frac{d}{dx}(Ry) = Q}

Equations that can be reduced to the Linear Form

Example 1
Problem

Consider the equation:

x\;y\;-\frac{dy}{dx} = y^3\;e^{-\,x^2}

Workings

Divide through by y^3

x\;\frac{1}{y^2}\;-\,\frac{1}{y^3}\frac{dy}{dx} = e^{-\,x^2}

x\;\frac{1}{y^2}\;-\,\frac{1}{2}\frac{d}{dx}\left(\frac{1}{y^2} \right) = e^{-\,x^2}

Putting \frac{1}{y} = z

2\,xz + \frac{dz}{dx} = 2\,e^{-\,x^2}

Solution

Hence z = (2x + c)\,e^{-x^2} Therefore \frac{1}{y^2} = (2x + C)\,e^{-x^2} Or y = \pm \frac{e^{\frac{1}{2}x^2}}{\sqrt{(2x + C)}}

This example is a particular case of The Bernoulli Equation

General Solution of the Bernoulli Equation

This section is presenting the Bernoulli Equation.

\mathbf{\frac{dy}{dx} + Py = Q\;y^n} P and Q are functions of x

This can be reduced to a linear form by putting \displaystyle z = \frac{1}{y^{(n - 1)}} Therefore \frac{dz}{dx}\;= - \frac{(n - 1)}{y^n}\;\frac{dy}{dx}

The original equation can be re-written as:

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

\frac{1}{(n - 1)}\;\frac{dz}{dx} + Pz = Q

Homogeneous Equations

Any equation which can be put into the form:

\mathbf{\frac{dy}{dx} = f\left(\frac{y}{x} \right)} is said to be Homogeneous. To test whether a function of x and y can be written in the form of the right hand side, substitute for y=vx . If the result is in the form f(v), i.e. all the x's cancel, then the test is satisfied and the equation is homogeneous.

Example 1
Problem

Is the follow function homogeneous: \frac{dy}{dx} = \frac{x^2 + y^2}{2x^2}

Workings

Substitute for y=vx, \frac{dy}{dx} = \frac{x^2 + (vx)^2}{2x^2} or \frac{dy}{dx} = \frac{x^2 + v^2 x^2}{2x^2} or \frac{dy}{dx} = \frac{1 + v^2}{2}

As all the x have cancelled out, the test is satisfied.

Solution

Function is homogeous

The Method of Solution for Homogeneous Equations

Substitute y = vx in both sides of the equation

\frac{dy}{dx}\;\;becomes\;\;\;\left(v + x\;\frac{dv}{dx} \right)

Note. If y is a function of x then so is v

Thus the equatican be re-written as:

v + x\;\frac{dv}{dx} = \frac{1 + v^2}{2}

Re-writing and Separating the variables:

\frac{2\;dv}{(v - 1)^2} = \frac{dx}{x}

Integrating \frac{- 2}{(v - 1)} = ln\,x + C

But \frac{- 2}{(v - 1)} =  \frac{2x}{x - y}\;\;\;\;\;\left(since \;\;v = \frac{y}{x} \right) \therefore\;\;\;\;\;\;2x = (x - y)\;(ln\,x + C)

Example 1
Problem

(x + y)dy + (x - y)dx = 0

Workings

Rearranging \frac{dy}{dx} = \frac{y - x}{y + x}

Putting y = vx

v + x\;\frac{dv}{dx} = \frac{v - 1}{v + 1} i.e. \frac{dv}{dx} = \frac{v - 1}{v + 1} - v\;= - \frac{v^2 + 1}{v + 1}

\frac{- v}{v^2 + 1}dv - \frac{dv}{v^2 + 1} = \frac{dx}{x}

Integrating

- \frac{1}{2}\;ln(v^2 + 1) - tan^{-1}v = ln\,x + C Therefore 2\,ln\,x + ln\,(v^2 + 1) + 2\;tan^{-1}v + 2C = 0 Therefore ln\,x^2(v^2 + 1) + 2\;tan^{-1}v + 2C = 0

Solution

Substituting for v Therefore ln\,(y^2 + x^2) + 2\;tan^{-1}\frac{y}{x} + 2C = 0

The Exceptional Case of Homogeneous Equations

If the straight lines are parallel there is no finite point of intersection and the method of solving such equations is illustrated by the following example.

\frac{dy}{dx} = \frac{3y - 4x - 2}{3y - 4x - 3}

Put Z = 3y - 4x and thus \displaystyle \frac{dZ}{dx} = 3\frac{dy}{dx} - 4

The equation can now be written as: \frac{1}{3}\left(\frac{dZ}{dx} + 4 \right) = \frac{Z - 2}{Z - 3} \therefore\;\;\;\;\;\frac{dZ}{dx} = \frac{3Z - 6}{Z - 3} - 4 = \frac{- Z + 6}{Z - 3} \therefore\;\;\;\;\;\;dx = -\left(\frac{Z - 3}{Z - 6} \right)dZ = \frac{-Z - 6 + 3}{Z - 6}\;dZ = \left(-1\;-\frac{3}{Z - 6} \right)dZ

Integrating X = -Z\;-3\,ln\,(Z - 6) + K

Replacing Z the solution to the differential equation is : 3\,ln(3y - 4x - 6) = (3x - 3y) + K

Exact Equations

The expression y\,dx + x\,dy is an exact differential.

Thus the equation y\,dx + x\,dy = 0 giving that d(yx) = 0 i.e. (yx)=C is called an exact Equation.

Example 1
Problem

Solve \tan y\;dx + \tan x\;dy = 0

Workings

This equation is not exact as it stands but if it is multiplied through by \cos x \cos y it becomes: \sin y \cos x\;dx + \sin x \cos y\;dy = 0

Solution

The solution \displaystyle sin\,y\;sin\,x = Constant