Civil Engineering  ·  Level 6
Calculus And Differential Methods
Chapter 2: Solve Ordinary differential equations
📚 4 Topics
⚑ What you will be able to do

By the end of this chapter, you will be able to:

  • Solve first order differential equations using the method of undetermined coefficients with confidence.
  • Solve second order differential equations using the method of undetermined coefficients accurately.
  • Tackle first order differential equations and find solutions that meet specific boundary conditions.
  • Work through second order differential equations and apply given boundary conditions to find the correct solutions.

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.

2.1 First-Order Differential Equations

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.

2.1.1 Methods of Solving first-order ODEs

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.

2.1.1.1 Separation of variables

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.

Steps for Solving by Separation of Variables
  1. Check that the equation is separable: Confirm it can be written as dy/dx = g(x) h(y).
  2. Separate the variables: Rewrite it as dy ÷ h(y) = g(x) dx, with all y terms on one side and all x terms on the other.
  3. Integrate both sides: Find ∫ dy ÷ h(y) and ∫ g(x) dx.
  4. Add one constant of integration: Add a single constant C to one side only.
  5. Solve for y if possible: Rearrange the result to give y explicitly in terms of x.
  6. Apply the initial condition: Substitute the known values to find the constant.
  7. Write the particular solution: State the final solution and check it by substituting back into the original equation.
Worked Examples

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)

2.1.1.2 Integrating factor

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.

Steps for Solving by the Integrating Factor Method
  1. Write the equation in standard form: Rearrange it as dy/dx + P(x) y = Q(x), with the coefficient of dy/dx equal to 1.
  2. Identify P(x) and Q(x): Read off the function multiplying y and the right-hand side.
  3. Find the integrating factor: Calculate μ(x) = e^(∫P(x) dx), without adding a constant.
  4. Multiply through by μ(x): Multiply every term of the equation by the integrating factor.
  5. Write the left side as a derivative: Recognise it as d/dx [μ(x) y].
  6. Integrate both sides: Find μ(x) y = ∫ μ(x) Q(x) dx + C.
  7. Solve for y: Divide by μ(x) to obtain the general solution.
  8. Apply the initial condition: Find C and write the particular solution.
Worked Examples

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

2.1.1.3 Exact Differential Equations

An ODE M(x, y) + N(x, y) dy/dx = 0 is exact if ∂M/∂y = ∂N/∂x.

Worked Examples

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

Practice Questions

  1. Solve \( \frac{dy}{dx} = 5 (2 - y) \) with \( y(0) = 0 \). (5 marks)
  2. Find the solution to \( \frac{dy}{dx} + 4 y = x \), given \( y(0) = 1 \). (6 marks)
  3. Solve the exact equation \( (2xy + 1) + (x^2 + 3y^2) \frac{dy}{dx} = 0 \). (7 marks)
The rest of this chapter
🔒

Create a free account to open more of this chapter.

Free: practical guides, quick cards, workplace scenarios and more.

Create a free account
🔒2.2 Second-Order Differential Equations

Second-order ODEs involve the second derivative of the unknown function and are essential in modeling dynamic systems such as beam deflections, vibrations, and wave propagation in civil engineering structures. Solutions to these equations provide insight into…

🔒2.3 Boundary Conditions

In solving ordinary differential equations (ODEs) relevant to civil engineering, applying boundary conditions is essential to identify the specific solution that fits the physical context. Boundary conditions represent constraints such as initial values or val…

🔒2.4 Applications of ODEs

Ordinary differential equations model many physical phenomena in civil engineering, including motion, fluid flow, heat transfer, and structural dynamics. Understanding how to formulate and solve ODEs with appropriate initial or boundary conditions enables engi…

Chapter Summary

This 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.

Self-Assessment

🔒 PDFDownload this self-assessment, with answers

Written Assessment

  1. 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)

  2. 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)

🔒18 more in this section.

Chapter Examination Questions

🔒 PDFDownload these examination questions, with worked answers

SECTION A (40 Marks) - Answer ALL Questions

  1. A retaining wall in Nairobi experiences water seepage that varies with time \(t\) (in hours) according to the differential equation \(\frac{dy}{dt} = 3y\), where \(y\) is the seepage rate in litres/hour. Solve the equation using separation of variables if initially \(y = 2\) litres/hour. (4 marks)
  2. Solve the first-order linear differential equation \(\frac{dy}{dx} + 2y = 6\) using the integrating factor method, where \(y\) is the displacement of a vibrating beam at position \(x\). (4 marks)
🔒18 more in this section.
Flashcards 19 cards Study deck ▾
Question
1

↻ Tap card to reveal answer
🔒

17 more in this section.

Create a free account
Test Yourself 17 questions Start quiz ▾
0%
0 / 2
🔒

15 more in this section.

Create a free account
Am I competent?

At the start of this chapter we promised you would be able to:

  • Solve first order differential equations using the method of undetermined coefficients with confidence.
  • Solve second order differential equations using the method of undetermined coefficients accurately.
  • Tackle first order differential equations and find solutions that meet specific boundary conditions.
  • Work through second order differential equations and apply given boundary conditions to find the correct solutions.

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.