By the end of this chapter, you will be able to:
Mastering these skills will help you solve real-world technical problems where differential equations are essential in your trade.
Compiled by: John Ronoh
Ordinary differential equations (ODEs) are fundamental in modeling many physical phenomena encountered in civil engineering, such as structural vibrations, fluid flow, and heat transfer in materials. Solving these equations enables engineers to predict system behavior under various conditions and design structures that are safe, efficient, and durable. This chapter focuses on methods to solve first- and second-order ODEs, which frequently arise in civil engineering problems in Kenya and beyond.
First-order differential equations involve the first derivative of an unknown function and are widely used to model processes like groundwater flow, heat dissipation in building materials, and simple dynamic systems. Mastery of solving these equations is crucial for civil engineers analyzing transient responses and system rates of change.
First-order ODEs can be solved using several methods depending on their form: separable equations, linear equations, exact equations, and integrating factors. Each method requires identifying the equation type and applying the corresponding solving technique.
Separable equations can be written as dy/dx = g(x)h(y), allowing variables to be separated on opposite sides.
dy/dx = g(x) h(y)
Separation of variables is the method used when the right-hand side of a first-order ODE can be written as a product of a function of x only and a function of y only. All terms containing y (including dy) are moved to one side and all terms containing x (including dx) to the other, and then both sides are integrated separately, giving a general solution with one arbitrary constant. The constant is then found from an initial condition, such as a known temperature at time zero, giving the particular solution. Example: an engineer studying the cooling of a large concrete pour at a dam for a county irrigation scheme in Tana River used separation of variables to predict how quickly the concrete temperature would fall towards the air temperature.
Example 1:
Given the rate of water infiltration into soil is proportional to the difference between saturation level y and current moisture content, modeled by
dy/dx = 3(1 − y)
Find y(x) given y(0) = 0.2.
Separate variables:
dy ÷ (1 − y) = 3 dx
Integrate both sides:
∫ dy ÷ (1 − y) = ∫ 3 dx
−ln|1 − y| = 3x + C
Solve for y:
1 − y = A e^(−3x)
Apply initial condition y(0) = 0.2:
1 − 0.2 = A e⁰, so A = 0.8
Final solution:
y = 1 − 0.8 e^(−3x)
Example 2:
A cooling slab temperature T changes with time t according to
dT/dt = −0.5 (T − 20)
If initial temperature is T(0) = 80 °C, find T(t).
Separate variables:
dT ÷ (T − 20) = −0.5 dt
Integrate:
ln|T − 20| = −0.5 t + C
Solve for T:
T − 20 = A e^(−0.5t)
Apply initial condition:
80 − 20 = A, so A = 60
Final:
T = 20 + 60 e^(−0.5t)
Example 3:
Water flow velocity v in a pipe changes with distance x as
dv/dx = 2x ÷ v
Given v(0) = 1 m/s, find v(x).
Separate variables:
v dv = 2x dx
Integrate:
∫ v dv = ∫ 2x dx
v² ÷ 2 = x² + C
Apply initial condition:
1² ÷ 2 = 0 + C, so C = 0.5
Rearranged:
v² = 2x² + 1
Final:
v = √(2x² + 1)
Linear equations have the form:
dy/dx + P(x) y = Q(x)
They are solved using an integrating factor μ(x) = e^(∫P(x) dx).
The integrating factor method solves linear first-order ODEs, which cannot usually be separated because y appears added to other terms. Multiplying the whole equation by the integrating factor μ(x) turns the left-hand side into the derivative of a single product, d/dx [μ(x) y], so the equation can be integrated directly. The method is widely used for problems where a quantity changes at a rate that depends both on its current value and on an external input, such as a tank being filled while it drains, or a structure heating up while losing heat. Example: an engineer modelling the water level in a storage tank at a boarding school in Kitui, filled by a pump while being drawn down by demand, used an integrating factor to solve the resulting linear ODE.
Example 1:
The settlement y of soil under load varies with depth x as:
dy/dx + 2y = 4
Given y(0) = 1, find y(x).
Calculate integrating factor:
μ(x) = e^(∫2 dx) = e^(2x)
Multiply entire equation:
e^(2x) dy/dx + 2e^(2x) y = 4e^(2x)
Left side is derivative:
d/dx (y e^(2x)) = 4e^(2x)
Integrate both sides:
y e^(2x) = 2e^(2x) + C
Divide:
y = 2 + C e^(−2x)
Apply initial condition:
1 = 2 + C, so C = −1
Final solution:
y = 2 − e^(−2x)
Example 2:
Temperature T of a concrete beam satisfies:
dT/dt + 0.3T = 15
With T(0) = 25 °C, find T(t).
Integrating factor:
μ(t) = e^(0.3t)
Multiply:
d/dt (T e^(0.3t)) = 15 e^(0.3t)
Integrate:
T e^(0.3t) = 50 e^(0.3t) + C
Divide:
T = 50 + C e^(−0.3t)
Apply initial condition:
25 = 50 + C, so C = −25
Solution:
T = 50 − 25 e^(−0.3t)
Example 3:
Hydraulic head h along a pipe satisfies:
dh/dx − h ÷ x = x²
With h(1) = 2, find h(x).
Integrating factor:
μ(x) = e^(∫ −1/x dx) = e^(−ln x) = 1 ÷ x
Multiply:
(1 ÷ x) dh/dx − h ÷ x² = x
Rewrite:
d/dx (h ÷ x) = x
Integrate:
h ÷ x = x² ÷ 2 + C
Multiply by x:
h = x³ ÷ 2 + Cx
Apply initial condition:
2 = 1³ ÷ 2 + C × 1, so C = 3 ÷ 2
Final:
h = x³ ÷ 2 + (3 ÷ 2) x
An ODE M(x, y) + N(x, y) dy/dx = 0 is exact if ∂M/∂y = ∂N/∂x.
Example 1:
Solve
(2xy + 3) + (x² + 4y) dy/dx = 0
Check exactness:
∂M/∂y = ∂/∂y (2xy + 3) = 2x
∂N/∂x = ∂/∂x (x² + 4y) = 2x
Exact.
Find potential function Ψ(x, y):
∂Ψ/∂x = 2xy + 3
Integrate with respect to x:
Ψ = x²y + 3x + h(y)
Differentiate with respect to y:
∂Ψ/∂y = x² + h′(y) = N = x² + 4y
So,
h′(y) = 4y, giving h(y) = 2y² + C
Implicit solution:
x²y + 3x + 2y² = C
Example 2:
Solve
(y cos x + 2) + (sin x) dy/dx = 0
Check exactness:
∂M/∂y = ∂/∂y (y cos x + 2) = cos x
∂N/∂x = ∂/∂x (sin x) = cos x
Exact.
Find Ψ:
∂Ψ/∂x = y cos x + 2
Integrate with respect to x:
Ψ = y sin x + 2x + h(y)
Differentiate with respect to y:
∂Ψ/∂y = sin x + h′(y) = N = sin x
So,
h′(y) = 0, giving h(y) = C
Implicit solution:
y sin x + 2x = C
Example 3:
Solve
(3x²y + 5) + (x³ + 6y) dy/dx = 0
Check exactness:
∂M/∂y = 3x²
∂N/∂x = 3x²
Exact.
Find Ψ:
∂Ψ/∂x = 3x²y + 5
Integrate with respect to x:
Ψ = x³y + 5x + h(y)
Differentiate with respect to y:
∂Ψ/∂y = x³ + h′(y) = N = x³ + 6y
So,
h′(y) = 6y, giving h(y) = 3y² + C
Implicit solution:
x³y + 5x + 3y² = C
Create a free account to open more of this chapter.
Free: practical guides, quick cards, workplace scenarios and more.
Create a free accountThis chapter presented methods for solving ordinary differential equations, beginning with first-order equations where separation of variables and integrating factors were used to find solutions. It then progressed to second-order differential equations, distinguishing between homogeneous and non-homogeneous types and solving each accordingly. The importance of boundary conditions was emphasized, showing how initial or boundary values enable determination of unique solutions to differential equations. Finally, the chapter explored practical applications of ordinary differential equations in various fields such as physics and engineering, including modelling motion of particles and analysing electrical circuits. Through these topics, the chapter provided a comprehensive foundation for understanding and solving ordinary differential equations in both theoretical and applied contexts.
Solve the first-order differential equation using separation of variables:
\(\frac{dy}{dx} = 3y\), given \(y(0) = 2\). Find \(y\) when \(x = 1\). (2 marks)
Use the integrating factor method to solve:
\(\frac{dy}{dx} + 2y = 4\), with initial condition \(y(0) = 1\). Find \(y\) at \(x = 0.5\). (3 marks)
At the start of this chapter we promised you would be able to:
Tick each one you can genuinely do.
So, are you there yet?
You're competent when you can confidently do 50% or more of what this chapter promised.
Sign in to record how you're doing.