First Order Differential Equations with worked examples

You're viewing an older version of this page (#3400). View the current version.

View versions (3)

Separable Variables

In this type of equation it is possible to separate the variables so that x come on one side and y on the other. Integrating each side separately gives the General Solution.

Example 1

1

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

Separate the Variables

\therefore\;\;\;\;\;\;\frac{1}{cos^2\,y}dy\;=\;(1\;-\;x)\,dx
(3)

Integrating

tan\,y\;=\;x\;-\;\frac{x^2}{2}\;+\;C\;\;\;\;\;\;\;\;where\;\;\;\;C \;is\; an\; arbitrary\; constant
(4)

Example 2

2

Solve\;\;\;\;\;\;\;y\,\frac{dy}{dx}\;=\;1\;+\;y^2\;\;\;\;\;\;given\;that\;y\;=\;0\;\;\;when\;\;\;x\;=\;0
(5)
\therefore\;\;\;\;\;\;\frac{y}{1\;+\;y^2}\;=\;dx
(6)

Integrating

\frac{1}{2}\;\ln (1\;+\;y^2)\;=\;x\;+\;C
(7)

But x = 0 when y = 0

\therefore \;\;\;\;\;\;\frac{1}{2}\,\ln\,1\;=\;0\;+\;C\;\;\;\;\;\;\therefore\;\;\;\;C\;=\;0
(8)

Thus the Particular Solution Required is :-

\frac{1}{2}\;\ln(1\;+\;y^2)\;=\;x
(9)
or\;\;\;\;\;\;1\;+\;y^2\;=\;e^{2x}
(10)

Linear Type of Differential Equation.

Equations\; of\; the\; type\;\;\;\;\;\;\frac{dy}{dx}\;+\;Py\;=\;Q
(11)

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

Example 3

3

\frac{dy}{dx}\;+\;\frac{1}{x}\times y\;=\;x^2
(12)

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

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

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
(16)

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}
(17)
This\;gives\;\;\;\;\;RPy\;=\;y\,\frac{dR}{dx}
(18)
\therefore\;\;\;\;\;\;P\,dx\;=\;\frac{dR}{R}
(19)
Thus\;\;\;\;\;\;\;\;\int P\,dx\;=\;\ln\,R
(20)
\therefore\;\;\;\;\;\;R\;=\;e^{\int P\,dx}
(21)

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

e^{\int P\,dx}
(22)

Hence the Method of solving this type of equation is :-

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

Example 4

4

\frac{dy}{dx}\;+\;2xy\;=\;10\,x\,e^{-x^2}
(26)

The Integrating Factor is \displaystyle e^{\int 2x\,dx

Thus the equation becomes :-

\frac{d\left(y\,e^{x^2 }\right)}{dx}\;=\;10\,x
(27)
\therefore\;\;\;\;\;\;y\,e^{x^2}\;=\;5\,x^2\;+\;Constant
(28)

Example 5

5

2x^2\;\frac{dy}{dx}\;-\;yx\;=\;3
(29)
\frac{dy}{dx}\;-\;\frac{y}{2x}\;=\;\frac{3}{2x^2}
(30)

Therefore the integrating factor is \displaystyle e^{\int-\;\frac{1}{2x}dx

=\;e^{-\;\frac{1}{2}lnx}}\;=\;e^{ln\,x^{-\frac{1}{2}}}\;=\;x^{-\frac{1}{2}
(31)

Thus the equation reduces down to :-

\frac{d}{dx}\left(y\;x^{-\,\frac{1}{2} }\right)\;=\;\frac{3}{2x^2}\times x^{-\frac{1}{2}}\;=\;\frac{3}{2}\;x^{-\frac{5}{3}}
(32)

Integrating:-

\therefore\;\;\;\;\;\;y\;x^{-\,\frac{1}{2}}\;=\;\frac{3}{2}\;x^{-\,\frac{3}{2}}\times \left(-\;\frac{2}{3} \right)\;+\;K
(33)
thus\;\;\;\;\;\;y\;=\;-\;\frac{1}{x}\;+\;K\sqrt{x}
(34)

Example 6

6

\frac{dy}{dx}\;+\;3y\;=\;e^{2x}
(35)

Here the Integrating Factor is \displaystyle e^{3\,x}

Multiplying through by this

e^{3\,x}\;\frac{dy}{dx}\;+\;3\;e^{3\,x}y\;=\;e^{5\,x}
(36)
i.e.\;\;\;\;\;\;\frac{d}{dx}\left(y\;e^{3\,x} \right)\;=\;e^{5\,x}
(37)

Integrating

y\;e^{3\,x}\;=\;\frac{1}{5}\,e^{5\,x}\;+\;C
(38)
\therefore\;\;\;\;\;\;y\;=\;\frac{1}{5}\;e^{2x}\;+\;C\;e^{-\;3x}
(39)

Equations that can be reduced to the Linear Form.

Consider the equation:-

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

Divide through by y^3

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

Putting \frac{1}{y}\;=\;z

2\,xz\;+\;\frac{dz}{dx}\;=\;2\,e^{-\,x^2}
(43)

This equation is linear in z as opposed to y and is similar to equation(26) in Example 4

Hence\;\;\;\;\;\;\;\;z\;=\;(2x\;+\;c)\,e^{-x^2}
(44)
\therefore\;\;\;\;\;\;\;\frac{1}{y^2}\;=\;(2x\;+\;C)\,e^{-x^2}
(45)
or\;\;\;\;\;\;\;y\;=\;\pm \frac{e^{\frac{1}{2}x^2}}{\sqrt{(2x\;+\;C)}}
(46)

This example is a particular case of The Bernoulli Equation

General Solution of the Bernoulli Equation

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

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}
(48)

The original equation can be re-written as:-

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

Equations where x and y are Interchanged

\mathbf{\frac{dy}{dx}\;=\;f\left(\frac{y}{x} \right)}
(51)
Blank

For example consider the following equation:-

y\;=\;\left(y^4\;+\;2x \right)\frac{dy}{dx}
(52)

Re-arranging

y\;\frac{dx}{dy}\;=\;\left(y^4\;+\;2x \right)
(53)

therefore

\frac{dx}{dy}\;-\;\frac{2x}{y}\;=\;y^3
(54)

The Integration Factor is now given by:-

e^{-\,\int \frac{2}{y}}\;=\;e^{-\,2\,ln\,y}\;=\;\frac{1}{y^2}
(55)

And the General Solution is :-

\frac{x}{y^2}\;=\;\frac{1}{2}\;y^2\;+\;K\;\;\;\;\;\;where\;(K\;\is\;an\;arbitrary\;constant)
(56)

Homogeneous Equations

Any equation which can be put into the form:-

\mathbf{\frac{dy}{dx}\;=\;f\left(\frac{y}{x} \right)}
(57)

is said to be Homogeneous. To test whether a function of x and y can be written in the from of the right hand side put y = vx. If the result is in the form f(v) i.e. all the x's cancel, the test is satisfied and the equation is homogen

Example 7

\b7

\frac{dy}{dx}\;=\;\frac{x^2\;+\;y^2}{2x^2}\;becomes\;\frac{dy}{dx}\;=\;\frac{1\;+\;v^2}{2}
(58)

The test is satisfied and the equation is homogeneous but:-

\frac{dy}{dx}\;=\;\frac{y^3}{x^2}\;\;\;becomes\;\;\;\;\frac{dy}{dx}\;=\;xv^3
(59)

and the test has been failed.

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)
(60)

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}
(61)

Re-writing and Separating the variables:-

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

Integrating

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

But

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

Example 8

8

(x\;+\;y)dy\;+\;(x\;-\;y)dx\;=\;0
(66)
\therefore\;\;\;\;\;\;\frac{dy}{dx}\;=\;\frac{y\;-\;x}{y\;+\;x}
(67)

Putting y = vx

v\;+\;x\;\frac{dv}{dx}\;=\;\frac{v\;-\;1}{v\;+\;1}
(68)
i.e.\;\;\;\;\;\;x\;\frac{dv}{dx}\;=\;\frac{v\;-\;1}{v\;+\;1}\;-\;v\;=\;-\;\frac{v^2\;+\;1}{v\;+\;1}
(69)
\therefore\;\;\;\;\;\;\;\frac{-\;v}{v^2\;+\;1}dv\;-\;\frac{dv}{v^2\;+\;1}\;=\;\frac{dx}{x}
(70)

Integrating

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

Substituting for v

\therefore\;\;\;\;\;\;ln\,(y^2\;+\;x^2)\;+\;2\;tan^{-1}\frac{y}{x}\;+\;2C\;=\;0
(74)

Equations which can be Reduced to a Homogeneous Form.

Equations of the type

\frac{dy}{dx}\;=\;\frac{2x\;+\;3y\;+\;4}{4x\;+\;5y\;-\;10}
(75)

are not homogeneous owing to the constant terms "4" and "- 10". However we can shift the origin to the point of intersection of the straight lines 2x\;+\;3y\;+\;4\;=\;0\,\,\,and\;\;\;4x\;+\;5y\;-\;10\;=\;0 whilst keeping the axis in the original direction. The Constant term in the differential equation will now disappear.

Example 9

9

\frac{dy}{dx}\;=\;\frac{2x\;+\;9y\;-\;20}{6x\;+\;2y\;-\;10}
(76)
The \;lines\;\;\;2x\;+\;9y\;-\;20\;=\;0\;\;\;\;and\;\;\;\;6x\;+\;2y\;-\;10\;=\;0
(77)

meet at the point (1, 2)

Thus we make the substitution x = X + 1 and y = Y + 2

The equation can now be re-written as :-

\frac{dY}{dX}\;=\;\frac{2(X\;+\;1)\;+\;9(Y\;+\;2)\;-\;20}{6(X\;+\;1)\;+\;2(Y\;+\;2)\;-\;10}
(78)
=\;\frac{2X\;+\;9Y}{6X\;+\;2Y}
(79)

Now put Y = vX and the equation can be solved using the normal way

\left(The\;solution\;is\;  (2x\;-\;y^2)\;=\;C(x\;+\;2y\;-\;5) \right)
(80)

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}
(81)

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}
(82)
\therefore\;\;\;\;\;\frac{dZ}{dx}\;=\;\frac{3Z\;-\;6}{Z\;-\;3}\;-\;4\;=\;\frac{-\;Z\;+\;6}{Z\;-\;3}
(83)
\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
(84)

Integrating

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

Replacing Z the solution to the differential equation is :-

3\,ln(3y\;-\;4x\;-\;6)\;=\;(3x\;-\;3y)\;+\;K
(86)

Exact Equations

The expression

y\,dx\;+\;x\,dy\;is\; an\; exact\; differential.
(87)

Thus the equation \displaystyle \;y\,dx\;+\;x\,dy\;=\;0

Giving \displaystyle d(yx)\;=\;0

\displaystyle i.e.\;\;\;\;\;(yx)\;=\;C

Is called an exact Equation.

Example 10

10

tan\,y\;dx\;+\;tan\,x\;dy\;=\;0
(88)

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
(89)

Which is exact. The solution i\displaystyle sin\,y\;sin\,x\;=\;Constant

Blank