University of Zimbabwe: Linear Algebra and Probability For Engineering
University of Zimbabwe: Linear Algebra and Probability For Engineering
May 1, 2019
Chapter 1
A drunkard may not know which number is larger, 2/3 or 3/5, but he knows that 2 bottles of vodka for 3
people is better than 3 bottles of vodka for 5 people.
—Edward Frenkel
Many of the basic laws of the physical sciences, biological and social sciences are formulated in terms
of mathematical equations involving certain known and unknown quantities and their derivatives.
Such equations are called differential equations.
The term general solution will be used for a family of solutions of the differential equation
containing one or more arbitrary constants.
A differential equation involving only ordinary derivatives (derivatives of a function of one vari-
able) is called an ordinary differential equation.
Theorem 1.0.1. The order of a differential equation is defined as the order of the highest derivative
appearing in the equation.
Example 1.0.1. The following are differential equations with indicated orders.
dy
1. = ay (first order).
dx
2. x00 (t) − 3x0 (t) + x(t) = cos t (second order).
3
3. (y (4) ) 5 − 2y 00 = cos x (fourth order).
A function that satisfies the differential equation when substituted is called a solution of the
equation. Sometimes referred to as the integral of the equation and its graph is called an integral
curve or solution curve.
Solution by Integration
2
1.2 Exact Equations
If M dx + N dy is exact, then we can solve the differential equation (1.1) by finding the function g
above.
Example 1.2.1. Solve the equation
Solution: Letting M (x, y) = 1 − sin x tan y and N (x, y) = cos x sec2 y, we have
∂M ∂N
= − sin x sec2 y = ,
∂y ∂x
∂g ∂g
so the equation is exact. We now seek a function g of two variables, such that = M and = N,
∂x ∂y
then
Z Z
g(x, y) = M dx = (1 − sin x tan y)dx
= x + cos x tan y + h(y).
3
The constant of integration h(y) is an arbitrary function of y since we must introduce the most
general term that varnish under partial differentiation with respect to x. But
∂g
cos x sec2 y = N (x, y) = = cos x sec2 y + h0 (y).
∂y
This means h0 (y = 0) so h(y) = k, a constant. The general solution is
dy
1.3 Solution of the Equation + a(x)y = 0.
dx
and R
y = c1 e− a(x)dx
.
Example 1.3.1. Solve the homogeneous differential equation
y 0 + 3y = 0.
We want to use the integrating factor to obtain the solution of the non-homogeneous linear equation
dy
+ a(x)y = f (x).
dx
4
Example 1.3.2. Solve the equation y 0 = y + x2 .
= c − (x2 + 2x + 2)e−x
y = ce−x − (x2 + 2x + 2).
dy
Example 1.3.3. Solve x + 4y = x6 .
dx
5
When n = 0, 1 the Bernoulli equation becomes a linear equation.
Set z = y 1−n . Then z 0 = (1 − n)y −n y 0 . So if we multiply both sides of equation (1.3) by (1 − n)y −n ,
we obtain
(1 − n)y −n y 0 + (1 − n)a(x)y 1−n = (1 − n)f (x)
or
dz
+ (1 − n)a(x)z = (1 − n)f (x).
dx
This equation is now linear and can be solved as before.
Solution: Here n = 3 so let z = y −2 . Let z 0 = −2y −3 y 0 and multiply both sides of the equation by
−2y −3 to obtain
2
−2y −3 y 0 + y −2 = 5x2
x
or
2z
z0 + = 5x2 . (1.4)
x
dx 2
R
The integrating factor for this linear equation is e2 x = e2 ln x = eln x = x2 . Multiplying both sides
of equation (1.4) by x2 , we have x2 z 0 + 2xz = 5x4 or (x2 z)0 = 5x4 . Thus
Z
x z = 5 x4 dx + c = x5 + c.
2
Hence
1
y −2 = z = x3 + cx−2 or y = (x3 + cx−2 )− 2 .
This is an example of an initial value problem and the condition y(x0 ) = y0 is called an initial
condition and x0 is called the initial point.
dy
Example 1.5.1. (a) = 2y − 3x, y(0) = 2. (x = 0 is the initial point)
dx
(b) x00 (t) + 5x0 (t) + sin x(t) = 0, x(1) = 0, x0 (1) = 7. (t = 1 is the initial point)
6
1.6 Boundary Value Problems (BVPs)
A boundary value problem consists of a differential equation and a collection of values that must
be satisfied by the solution of the differential equation or its derivatives.
d2 y
Example 1.6.1. (a) + 5xy = cos x, y(0) = 0, y 0 (1) = 2.
dx2
dy
(b) + 5xy = 0, y(0)y(1) = 2.
dx
where a(x), b(x) and f (x) are functions of the independent variable x only.
If the function f (x) is identically zero, we say equation (1.5) is homogeneous, otherwise it is
non-homogeneous.
If the coefficient functions a(x) and b(x) are constants, a(x) = a and b(x) = b, the equation is said
to have constant coefficients. If either a(x) or b(x) is not constant, the equation is said to have
variable coefficients.
Definition 1.7.1. Let y1 and y2 be any two functions. By a linear combination of y1 and y2 we
mean a function y(x) that can be written in the form
7
Definition 1.7.2. Two functions are linearly independent whenever the relation
c1 y1 (x) + c2 y2 (x) = 0,
Example 1.7.3. Verify that the functions y1 = 1 and y2 = x are linearly independent.
c1 y1 + c2 y2 = c1 · 1 + c2 · x = 0.
If you have a collection of functions y1 (x), y2 (x), · · · , yn (x). A linear combination of these functions
is any function of the form
where c1 , c2 , · · · , cn are constants. We shall say that the collection of functions y1 (x), y2 (x), · · · , yn (x)
are linearly independent if the equation
when c1 = c2 = · · · = cn = 0.
y 00 + a(x)y 0 + b(x)y = 0
Theorem 1.7.2. Let y1 (x) and y2 (x) be any two solutions of the homogeneous equation
y 00 + a(x)y 0 + b(x)y = 0.
Then, any linear combination of them is also a solution of the differential equation.
where c1 and c2 are arbitrary constants and y1 (x) and y2 (x) are linearly independent solutions of
(1.5).
8
1.8 The Wronskian
Definition 1.8.1. Let y1 (x) and y2 (x) be any two solutions to the differential equation
y 00 + a(x)y 0 + b(x)y = 0.
The Wronskian is defined at all points a at whichy1 (x) and y2 (x) are differentiable.
Theorem 1.8.1. Two solutions y1 (x) and y2 (x) of (1.5) are linearly independent if and only if
W (y1 , y2 ) 6= 0.
Example 1.8.1. We see that y1 (x) = sin x and y2 (x) = cos x are solutions of y 00 + y = 0. Using
the Wronskian
sin x cos x
W (y1 , y2 ) = = − sin2 x − cos2 x = −1 6= 0.
cos x − sin x
The functions y1 (x) = sin x and y2 (x) = cos x are linearly independent.
Example 1.8.2. Verify that y1 (x) = e−5x and y2 (x) = e2x are linearly independent solutions of the
differential equation
y 00 + 3y 0 − 10y = 0.
Solution: −5x
e e2x
W (y1 , y2 ) =
= 2e−3x + 5e−3x = 7e−3x 6= 0.
−5e−5x 2e2x
So the solutions are linearly independent.
provided we know two linearly independent solutions y1 and y2 of equation (1.6). The general
solution is then given by
y = c1 y1 + c2 y2
where c1 and c2 are arbitrary constants.
9
We assume that y1 is a non-zero solution of (1.6) and seek another solution y2 such that y1 and y2
are linearly independent. Since, y1 and y2 are linearly independent, y2 6= ky1 , for any constant k.
y2
So = v(x) must be a non constant function of x and y2 = vy1 must satisfy (1.6). Thus
y1
(vy1 )00 + a(vy1 )0 + b(vy1 ) = 0.
But
(vy1 )0 = vy10 + v 0 y1
and
(vy1 )00 = (vy10 + v 0 y1 )0 = vy100 + v 0 y10 + v 00 y10 + v 00 y1 = vy100 + 2v 0 y10 + v 00 y1 .
Then
(vy100 + 2v 0 y10 + v 00 y1 ) + a(vy1 + v 0 y1 ) + bvy1 = 0
or
v(y100 + ay1 + by1 ) + v 0 (2y10 + ay1 ) + v 00 y1 = 0.
The first term vanishes, since y1 is a solution of (1.6), so we obtain
v 00 y1 + v 0 (2y10 + ay1 ) = 0.
Dividing by v 0 y1 ,
v 00 2y10
= − − a.
v0 y1
Let z = v 0 , then z 0 = v 00 and
z0 2y 0
= − 1 − a,
z y1
which is a separable first order equation. Thus we have reduced the order of our equation.
Integrating with respect to x to obtain
Z
ln z = −2 ln y1 − a(x)dx.
Exponentiating, we have
R 1 − R a(x)dx
z = eln z = e−2 ln y1 − a(x)dx
= e .
y12
But since z = v 0 ,
1 − R a(x)dx
v0 = e .
y12
To find v, we perform another integration and obtain
Z − R a(x)dx
e
y2 = y1 v = y1 (x) dx.
y12 (x)
Example 1.8.3. Note that y1 = x is a solution of
x2 y 00 − xy 0 + y = 0, x > 0. (1.7)
10
Solution: Setting y2 = y1 v = xv(x), it follows that
becomes
x2 (xv 00 + 2v 0 ) − x(xv 0 + v) + (xv) = 0 or x3 v 00 + x2 v 0 = 0.
Setting z = v 0 and separating variables, we have
dz dx
=− or ln |z| = − ln x,
z x
and from exponentiation,
1
v0 = z =.
x
Thus, v(x) = ln x, so y2 = y1 v = x ln x and the general solution of (1.7) is
y = c1 x + c2 x ln x, x > 0.
y 00 + ay 0 + by = 0. (1.8)
Let a solution of (1.8) be of the form y(x) = eλx for some number λ (real or complex), then y 0 = λeλx
and y 00 = λ2 eλx , so that (1.8) yields
We need to obtain two linearly independent solutions. Equation (1.9) has the two roots
√ √
−a + a2 − 4b −a − a2 − 4b
λ1 = and λ2 = .
2 2
Three possibilities arise, a2 − 4b > 0, a2 − 4b = 0 and a2 − 4b < 0.
11
Roots Real and Unequal
If a2 − 4b > 0, then λ1 and λ2 are distinct real numbers, given by y1 = eλ1 x and y2 = eλ2 x are
distinct solutions.
Theorem 1.9.1. If a2 − 4b > 0, then the roots of the characteristic equation are real and unequal
and the general solution to the equation (1.8) is given by
where c1 and c2 are arbitrary constants and λ1 and λ2 are the real roots of (1.9).
y 00 + 3y 0 − 10y = 0.
If we specify the initial conditions y(0) = 1 and y 0 (0) = 3, for example, differentiating and substi-
tuting x = 0, we obtain the simultaneous equations
c1 + c2 = 1
2c1 − 5c2 = 3
8 1
which have the unique solution c1 = and c2 = − . The unique solution to the initial value
7 7
problem is therefore
1
y(x) = (8e2x − e−5x ).
7
a ax
Suppose a2 − 4b = 0. We have the double root λ1 = λ2 = − . Thus y1 (x) = e− 2 is a solution. To
2
find the second solution y2 , we use reduction of order to get
Z −ax
e
y2 (x) = y1 (x) dx
y12
e−ax
Z Z −ax
− ax − ax e
= e 2 − ax
dx = e 2 dx
(e 2 )2 e−ax
Z
− ax ax
= e 2 dx = xe− 2 .
12
Theorem 1.9.2. If a2 − 4b = 0, then the roots of the characteristic equation are equal and the
general solution is given by
ax ax
y(x) = c1 e− 2 + c2 xe− 2
where c1 and c2 are arbitrary constants.
y 00 − 6y 0 + 9y = 0.
If we use the initial conditions y(0) = 1 and y 0 (0) = 7, we obtain the simultaneous equations
c1 = 1, 3c1 + c2 = 7 ⇒ c2 = 4.
λ1 = α + iβ, λ2 = α − iβ.
Theorem 1.9.3. If a2 − 4b < 0, then the characteristic equation has complex conjugate roots and
the general solution is given by
13
1.10 Non-Homogeneous Equations
y(x) = c1 y1 + c2 y2 + · · · + cn yn + yp
The method of undetermined coefficients is used to find particular solutions to a given non-
homogeneous linear second order differential equation, either having
(b) a constant multiplied by the sine and cosine function and their linear combination.
14
Example 1.10.1. Solve the following equation
y 00 − y = x2
Solution: Here f (x) = x2 is a polynomial of degree two, so yp is also a polynomial of degree two.
We try a general polynomial of degree two, say yp (x) = a + bx + cx2 , then yp0 (x) = b + 2cx and
yp00 (x) = 2c. Substituting, we obtain
2c − (a + bx + cx2 ) = x2 .
Equating coefficients
yp (x) = −2 − x2 .
y = c1 ex + c2 e−x − 2 − x2 .
Solution: The particular solution is of the form yp (x) = aex sin x + bex cos x, then
yp0 = (a − b)ex sin x + (a + b)ex cos x and yp00 = 2aex cos x − 2bex sin x. Substituting, we have
ex (2a cos x − 2b sin x) − 3ex [(a − b) sin x + (a + b) cos x] + 2ex (a sin x + b cos x) = ex sin x.
Dividing both sides by ex and equating the coefficients of sin x and cos x, we have
2a − 3(a + b) + 2b = 0
−2b − 3(a − b) + 2a = 1
1 1
which yields a = − and b = , so that
2 2
ex
yp = (cos x − sin x).
2
Finally, the general solution is
ex
y = c1 e2x + c2 ex + (cos x − sin x).
2
15
Example 1.10.3. Solve
y 00 + y = xe2x .
Solution: The particular solution is of the form yp (x) = e2x (a + bx), then yp0 (x) = e2x (2a + b + 2bx)
and yp00 (x) = e2x (4a + 4b + 4bx) and substituting yields
5a + 4b = 0, 5b = 1.
4 1
Thus a = − , b = and a particular solution is
25 5
e2x
yp (x) = (5x − 4).
25
Therefore the general solution is
e2x
y(x) = c1 sin x + c2 cos x + (5x − 4).
25
Example 1.10.4. Find the solution to the equation
y 00 − y = 2ex .
y(x) = c1 ex + c2 e−x .
Then yp = Axex , and yp0 = Aex (x + 1), yp00 = Aex (x + 2) and substituting, we have
y 00 + ay 0 + by = f (x).
16
Example 1.10.5. Find the solution to
y 00 + y = cos x
yp = A cos x + B sin x.
yp = Ax cos x + Bx sin x.
cos x = yp00 +yp = (−2A sin x−Ax cos x+2B cos x−Bx sin x)+(Ax cos x+Bx sin x) = −2A sin x+2B cos x.
1 1
Therefore −2A = 0, 2B = 1 ⇒ b = and yp = x sin x. The general solution is
2 2
1
y = c1 cos x + c2 sin x + x sin x.
2
We have
1 1
y 0 = −c1 sin x + c2 cos x + x cos x + sin x.
2 2
0
Then y(0) = c1 = 2 and y (0) = c2 = −3, which yields the unique solution
1
y(x) = 2 cos x − 3 sin x + x sin x.
2
Example 1.10.6. Find the general solution of
y 00 − 4y 0 + 4y = e2x .
Solution: The homogeneous equation y 00 − 4y 0 + 4y = 0 has the independent solutions e2x and
xe2x . Multiplying e2x by x twice, we look for a particular solution of the form yp = ax2 e2x . Then
yp0 = ae2x (2x2 + 2x) and yp00 = ae2x (4x2 + 8x + 2), so
1 1
or 2a = 1 and a = . Thus yp = x2 e2x and the general solution is
2 2
2x 2x 1 2 2x 2x 1 2
y(x) = c1 e + c2 xe + x e = e c1 + c2 x + x .
2 2
17