Professional Documents
Culture Documents
Tema 5
Tema 5
1 Introduction
A differential equation is any equation that contains derivatives, either ordinary derivatives
(only one independent variable), ODE for short, or partial derivatives (several independent
variables), PDE for short. Differential equations play a very important and useful role in
mathematics, physics and engineering. A large number of mathematical and numerical
methods have been developed to solve differential equations.
Some examples of differential equations are:
∂z ∂z
a) xy0 + y2 x = 1 (ODE) b) x − y2 = x (PDE)
∂x ∂y
000 ∂2 z ∂2 z ∂2 z
c) x2 y − xy0 = e x (ODE) d) + − = y (PDE)
∂x2 ∂x∂y ∂y2
Definition. The order of a differential equation is the number of the highest derivative in
the equation.
d2 θ g
Simple Pendulum Motion: 2
+ θ = 0, where the angle θ = θ (t) and gravity g and
dt L
length of pendulum L are constants.
d2 Q dQ 1
Electric Circuit Equation: L 2
+R + Q = E, where the charge Q = Q(t), voltage
dt dt C
E = E(t) and the inductance L, resistance R and capacity C are constants.
∂2 u ∂u
Heat equation: k 2
= , where k is a constant (thermal diffusivity) and u = u( x, t) is
∂x ∂t
the temperature along an one-dimensional wire at distance x and time t.
1
1.1 Solutions of an ODE
Given an ordinary differential equation of order n written as
F ( x, y, y0 , . . . , y(n) ) = 0
But this equation has infinite solutions: the parametric functions family y = ( x2 + C )2 for
any constant C. Also this ODE has y = 0 like a trivial solution.
A solution that does not contain a constant is called particular solution. A parametric fam-
ily of functions which contains every particular solution is called general solution. Sometimes
the general solution does not contain all the solutions, then we say that the ODE has singular
solutions. In the above example 1.1, the functions y = ( x2 + C )2 are a general solution and
the trivial solution y = 0 is a singular solution.
yy0 + x = 1
has general solution the following curves (circles centered in (1, 0))
x2 + y2 − 2x = C, with C ≥ −1.
−2 −1 0 1 2 3 4
−1
−2
−3
2
2 The Cauchy problem
As we saw above, this is an expression of the form F ( x, y, y0 ) = 0. If it is possible to express
y0 as a function of x, y, we say that ODE is in normal form.
y0 = f ( x, y)
In general, solving an ODE is a very complicated problem. Also, sometimes we need the
(maybe unique) solution to verify a point ( x0 , y0 ).
The next theorem gives a sufficient condition for the existence and uniqueness of the
solution to a Cauchy problem.
Theorem 2.2. Let ( x0 , y0 ) a point where the scalar field f ( x, y) is continuous, and the partial
∂f
derivative ∂y exists and is continuous in a open ball around the point ( x0 , y0 ). Then there exists an
ε > 0 for which the Cauchy’s problem
(
y0 = f ( x, y)
y ( x0 ) = y0
y0 = x
y2
y (2) = 0
has not function solution. Observe that the curve x2 + y2 − 2x = 0 (see Example 1.2) is not
a function in the form y = g( x ) around the point (2, 0).
3
Figure 1: Point (0, 0) has infinity solutions. Example 2.5
has solution, but it is not unique. In fact, it has infinite solutions y = Cx2 (see Figure 1).
Sometimes a first order ODE is expressed in the a form equivalent to the normal form,
but in a different notation
dy Q( x, y)
P( x, y)dy = Q( x, y)dx ⇐⇒ = ⇐⇒ y0 = f ( x, y)
dx P( x, y)
3 Orthogonal trajectories
Two curves are said to be orthogonal if both curves are orthogonal tangent lines at the point
of intersection. Many problems in physics involve calculating families of curves such that
all the curves are orthogonal to every curve in another family.
Example 3.1. We are going to calculate the orthogonal family for parabolic curves
y = x2 + c.
This family verify the differential equation dy = 2xdx then, considering that the orthogonal
slopes are opposite and inverse, the orthogonal family verify
dy 1
dx = −2xdy =⇒ =−
dx 2x
therefore, the orthogonal family is
ln | x |
y = C− (see Figure 2).
2
Example 3.2. We are going to calculate the orthogonal family to the hyperbolas
x2 − y2 = 2cx.
The derivative is
x 2 − y2
2x dx − 2y dy = 2c dx =⇒ 2x dx − 2y dy = dx
x
and the orthogonal family is obtained from 2x2 dy + 2xy dx = ( x2 − y2 ) dy equivalent to
2xy dx + ( x2 + y2 ) dy = 0
and its solution will be given in Example 5.4.
Now, we give some knowing methods for integrating first order ODEs.
4
6
−4 −2 0 2 4
−2
Figure 2: Family of orthogonal curves (in blue) to the family y = x2 + c (in black).
G (y) = F ( x ) + C
sin x
Example 4.1. To solve y0 = we express
y3
y4
Z Z
y3 dy = sin x dx =⇒ y3 dy =sin x dx =⇒ = − cos x + C =⇒
4
√
y4 + 4 cos x = C =⇒ y = C − 4 cos x
4
Remark: Note the misuse of notation that changes the name of variables. The orthodox
form should be y4 = 4C − 4 cos x. But there is no problem with replacing 4C by C.
Example 4.3. Observe that the scalar field f ( x, y) = x2 − 2xy + 2y2 is second order homo-
geneous.
Definition 4.4. We say that a first order ODE in normal form y = f ( x, y) is homogeneous
if f ( x, y) is homogeneous of order 0, that is f (tx, ty) = f ( x, y), for every t.
This is equivalent to saying that the ODE in the form Q( x, y)dy = P( x, y)dx is homo-
geneous if P and Q are homogeneous of the same order.
Proposition 4.5. A homogeneous first order ODE can be converted in an equation of separated vari-
able doing the change of variable y = ux where u is a dependent of x variable.
1 1
du = dx
f (1, u) − u x
5
Figure 3: Orthogonal trajectories of circles x2 + y2 = cx are circles x2 + y2 = c̃y (Exam-
ple 4.7)
y0 = f (k ) =⇒ y = f (k ) x + C.
a b
b) k = a0 = b0 6= cc0 . Using the change of variable z = ax + by:
z0 − a
z+c dz
= f z 0
= g(z) =⇒ = dx
b k +c bg(z) + a
6
a b
c) a0 6= b0 . In this case the system
(
ax + by + c = 0
a0 x + by0 + c0 = 0
has only one solution x = x0 , y = y0 . Then, using the changes x = X + x0 , y =
Y + y0 , we obtain
0 aX + bY + ax0 + by0 aX + bY
Y = f = f ,
a 0 X + b 0 Y + a 0 x0 + b 0 y0 a0 X + b0 Y
which is a homogeneous equation.
Example 4.8.
x+y−1
1. Integrate the equation y0 = . It is an equation of case b), then we do z =
x+y
x + y and we get the new separated variable equation
z
dz = dx
2z − 1
ln(2z−1) z
and the solution is 4 + 2 = x + C, hence the general solution is
ln(2x + 2y − 1) + 2y = 2x + C.
x+y−1
2. Integrate y0 = and find the curve solution through the point (2, 1).
x−y−1
Observe that it is of the third case. First, doing the changes x = X + 1, y = Y we get
the homogeneous equation
X+Y
Y0 = .
X−Y
Secord, by the change Y = u X,
1+u 1 + u2 1−u 1
u0 X + u = ⇐⇒ u0 X = ⇐⇒ du = dX.
1−u 1−u 1 + u2 X
ln(u2 +1)
The solution is arctan(u) − = ln( X ) + C, therefore
2
y 2
y
ln
x −1 + 1
arctan − = ln( x − 1) + C.
x−1 2
Morever, if x = 2 and y = 1, replacing in the above curve,
ln(2) π √
arctan(1) − = ln 1 + C ⇐⇒ C = − ln 2
2 4
7
In this cases, equation the differential equation (1) can be rewritten dU = 0, hence the
parametric family of curves
U ( x, y) = C
then F is conservative. So
∂P( x, y) ∂Q( x, y)
= ,
∂y ∂x
x2
Z Z
U= P dx = (4x3 y2 + x − 1)dx = x4 y2 + − x + φ(y)
2
∂U
= Q =⇒ 2x4 y + φ0 (y) = 2x4 y − y + 2
∂y
y2
Z
0
φ (y) = −y + 2 =⇒ φ(y) = −y + 2 dy = 2y − +C
2
therefore the general curve solution is
x2 y2
x 4 y2 + − x + 2y − = C.
2 2
Example 5.4. The orthogonal family of hyperbolas
x2 − y2 = 2cx
2xy dx + ( x2 + y2 )dy = 0.
This ODE is exact, because Py = 2x and Q x = 2x. Now, we calculate the potential
Z
Ux = P =⇒ U = 2xy dx = x2 y + φ(y)
y3
Z
Uy = Q =⇒ x2 + φ0 (y) = x2 + y2 =⇒ φ(y) = y2 dy = .
3
Therefore the orthogonal family is
3x2 y + y3 = C.
8
5.1 Integrating factors
An integrating factor is a function µ( x, y) that is chosen to convert an inexact differential
equation into an exact one.
(inexact ODE) (exact ODE)
⇐⇒
P( x, y)dx + Q( x, y)dy = 0 µ( x, y) P( x, y)dx + µ( x, y) Q( x, y)dy = 0
Since the second equation is exact, we can check that
∂(µ( x, y) P( x, y) ∂(µ( x, y) Q( x, y)
= in other words,
∂y ∂x
∂µ ∂P ∂µ ∂Q
P +µ = Q +µ (3)
∂y ∂y ∂x ∂x
This means µ( x, y) is a solution of a partial differential equation (3), generally much more
difficult than the previous.
Sometimes equation (3) can be simplified imposing additional conditions on µ( x, y).
We will see some of these.
Integrating factor is a function which does not depend of y, i.e. µ = µ( x ). In this case,
equation (3) can be written µPy = Qµ0 + µQ x . This implies that
Py − Q x µ0
= = φ( x )
Q µ
is a function only dependent of x. Then, To find the integrating factor is easy, because
Z R
φ( x ) dx
ln(µ) = φ( x ) dx =⇒ µ = e .
U = x4 y3 + ln | x | − y = C.
Integrating factor is a function which does not depend of x, i.e. µ = µ(y). In this case,
equation (3) can be written Pµ0 + µPy = µQ x . This implies that
Q x − Py µ0
= = φ(y)
P µ
is a function only dependent of y. Then, To find the integrating factor is easy, because
Z R
φ(y) dy
ln(µ) = φ(y) dy =⇒ µ = e .
Example 5.6. Integrate the ODE y(1 + xy)dx − xdy = 0, using integrating factor µ =
µ ( y ).
9
Other integrating factors. Assuming µ = µ(z), being z = h( x, y), equation (3) can be
written
Pµz hy + µPy = Qµz h x + µQ x .
This implies that
Py − Q x µz
= = φ(z)
Qh x − Phy µ
is a function only dependent of z. Then, to find the integrating factor is easy, because
Z R
φ(z) dz
ln(µ) = φ(z) dz =⇒ µ = e = µ(h( x, y)).
Example 5.7. Integrate the ODE (4xy − 3x2 − y) dx + (2x − y − x2 )dy = 0 using an
integrating factor in the form µ = µ( x2 − y).
Using equation (3) an z = x2 − y, we can write
(4xy − 3x2 − y)(−1)µz + (4x − 1)µ = (2x − y − x2 )(2x )µz + (2 − 2x )µ
(6x − 3)µ = (2xy − y − 2x3 + x2 )µz
µz 6x − 3 3(2x − 1) 3 3
= 3 2
= 2
= 2
=− .
µ 2xy − y − 2x + x y(2x − 1) − x (2x − 1) y−x z
Hence it is easy to obtain one of the possible integrating factors
R 1 1
µ = e −3 z dz
= z −3 = .
( x2 − y )3
Multiplying the equation by µ,
4xy − 3x2 − y 2x − y − x2
dx + dy = 0
( x 2 − y )3 ( x 2 − y )3
and the general curve solution is
x−y
=C
( x 2 − y )2
Example 5.8. Integrate the ODE (3xy2 − 4y) + (3x − 4x2 y)y0 = 0, using an integrating
factor depending of x m yn (Exercise 10).
R R R d R P(x) dx R
y0 e P( x ) dx
+ yP( x )e P( x ) dx
= Q( x )e P(x) dx =⇒ ye = Q( x )e P(x) dx
Z dx
R R
P( x ) dx P( x ) dx
ye = Q( x )e dx
R
Q( x )e P(x) dx dx
R
y= R
e P(x) dx
10
y
Example 6.1. Integrate the equation y0 + = x.
x
1
R
We have µ = e x dx = eln x = x, then
d
Z
xy0 + y = x2 =⇒ ( xy) = x2 =⇒ xy = x2 dx
dx
x3
3 +C x2 C
y= = +
x 3 x
Using a particular solution: We use a general solution of the named associated homoge-
neous linear equation y0 + P( x )y = 0. This solution is found using variable separated
method. So,
R
yh = Ce− P( x ) dx
, being C a positive constant.
For finding a particular solution y p , we use the named Lagrange’s method also known as
variation of constants. It consist in changing
R the constant C of homogeneous solution
by a function C ( x ), i.e. y p = C ( x )e − P ( x ) dx .
y0p + P( x )y p = Q( x )
R R R
C 0 ( x )e− P( x ) dx
− P( x )C ( x )e− P(x) dx + P( x )C ( x )e− P( x ) dx
= Q( x )
R
C 0 ( x ) = Q( x )e P( x ) dx
.
Remark. For equations with constant coefficients is faster use the method of indeter-
minate coefficients which will be explain further in the next theme.
Example 6.2. Let’s integrate the general solution for Example 6.1 using a particular
y
solution, y0 + = x.
x
First, compute general solution for the associated homogeneous equation
yh y0 1
y0h + = 0 =⇒ h = − =⇒ ln yh = − ln x + K
x yh x
C
yh = e(− ln x+K) = Cx −1 =
x
C(x)
Now, we look for a particular solution using method of variation of constant, y p = .
x
C(x)
xC 0 ( x ) − C ( x ) C0 (x)
+ x = x =⇒ = x =⇒ C 0 ( x ) = x2
x2 x x
x3
C(x) =
3
Hence, the general solution is
x2 C
y = y p + yh = +
3 x
11
7 Bernoulli and Riccati equations
Two important equations reported in the literature can be solved by converting them to
linear equations.
12
Exercises
Exercise 1
A population P = P(t) fits a model expressed by a differential equation
dP
= kP − h
dt
with k, h real positive constants. Determine the possible initial values P0 = P(0) for which
the population will become extinguished at any time.
h
Solutions: P0 < .
k
Exercise 2
The amount of radioactive material x (t) varies exponentially with time according to the
following Cauchy problem
(
x 0 (t) = −kx (t)
x (0) = x0
where k is the decay constant, which depends on the type of material, and x0 is the initial
quantity.
The time it takes to reduce the amount of radioactive material to half is called half-life
T. Prove that T = 1k ln 2, which shows that the half-life does not depend on the amount of
material.
Exercise 3
The logistic equation is defined as
dP
= P · ( a − bP)
dt
with P = P(t) ≥ 0, called logistic function and a > 0, b > 0 real constants.
a
a) Find P(t) for the initial value P(0) = P0 6= b and P0 6= 0.
b) Is it possible that this function has critical points?
c) What it is the limit of the logistic function when t → ±∞? .
d) What are inflection points for P(t) and what are its interpretation?
e) Sketch graphics for different values of P0
Solutions:
aP0 a a
a) P(t) = bP0 +( a−bP0 )e−at
. b) Not. c) P = b and P = 0. d) P = 2b .
Exercise 4
Find the equation of the curve that passes through the origin of the coordinates, O, and such
that the area between it and the chord up to a point A of the curve, OA, is proportional to
the square of the abscissa of the point A.
Solution: y = −4kx ln x + Cx.
13
Exercise 5
a) Calculate the functions verifying that the tangent line at each point ( x, y) of its graphic
y
intersects the OY axis at point (0, 2 ).
b) Calculate the family of orthogonal curves to the solutions of the previous item.
Solutions:
√
a) y = c x. b) 2x2 + y2 = c.
Exercise 6
The midpoints of tangent segments to a curve between the contact point and the OX axis
describe the y2 = x parabola. Determine the curve, knowing that it passes through the
point (1, 2).
2x 1
Solution: y2
+ ln y = 2 + ln 2.
Exercise 7
Integrate the general solution of the differential equation ( x − 1)y0 = 2 − y − 3x using two
different methods.
2
C
Solution: y = x2x 3x
−1 − 2( x −1) + x −1 .
Exercise 8
Integrate the general solutions of the following differential equations:
a) (y0 )2 = x + y + 8. b) y + xy2 dx + x − x2 y dy = 0; using µ = µ( xy).
y
c) y0 − = x2 y8 . d) y0 + y cot x = 5ecos x . e) y0 = ( x cos y + sin 2y)−1 .
x
1
f) y0 = (y − 2x ) 3 + 2, y(1) = 2. Does it have unique solution?
Solutions:
p √
x
1 1
1 1
a) x + y + 8 − ln 1 + x + i + 8 = 2 + C. b) x2 y
+ x dx + xy2
+ y dy = 0.
7
5ecos x
c) y7 = −7x10x
10 +10C . d) y = C−sin x . e) sin y − ln(2 + x + 2 sin y) = C.
2
f) 3(y − 2x ) − 2x + 2 = 0. Not a function.
3
Exercise 9
Solve the following PVI finding the appropriate integrating factor:
( (
xdx + ( x2 y + 4y)dy = 0 ( x2 + y2 − 5)dx = (y + xy)dy
a) b)
y (4) = 0 y (0) = 1
Solutions:
2 −y2 +4x +8
a) ( x2 + 4)e(y ) = 20. b) 2( x +1)2
+ ln ( x + 1) = 72 .
Exercise 10
Integrate the ODE
(3xy2 − 4y) + (3x − 4x2 y)y0 = 0
using some integration factor µ( x, y) = x m yn .
Solution: x −4 y3 (1 − xy) = C.
14