Differential equations: practice problems with step-by-step solutions

Free Differential equations practice problems with diagrams, hints and full worked solutions. New values every time, at three levels: exponential growth and decay, Newton's law of cooling, first-order linear.

Free practice problemEasy
ty1

A mass–spring–damper is described by y″ + 4.8y′ + 4y = 0. Compare it with y″ + 2ζωny′ + ωn²y = 0 and find the damping ratio ζ.

y″ + 4.8y′ + 4y = 0
Next problem →

What you practise

  1. Easyexponential growth and decay
  2. MediumNewton's law of cooling
  3. Hardfirst-order linear

Key formulas

Exponential growth/decay
dy/dt = ky → y = y0ekt
Half-life
k = ln 2 / t½
Newton's law of cooling
T(t) = Ta + (T0 − Ta)e−kt
Integrating factor
y′ + p(x)y = q(x): μ = e∫p dx, (μy)′ = μq
Mixing tank
dm/dt = r·c − (r/V)·m

Learn Differential equations from scratch

Before this: Derivatives, Integrals

1What a differential equation is

A differential equation links a quantity to its own rate of change. It describes how something changes, not what it is.

Bacteria divide, so a bigger colony grows faster. The growth rate is proportional to the number of cells N:

dN/dt = k · N

Here dN/dt is the derivative of N with respect to time t, and k is the rate constant. With k = 0.4 h⁻¹ and N = 1000 cells, the colony grows by 400 cells per hour at that moment.

Solving the equation means finding the function N(t) itself. You also need a starting value, such as N(0) = 200. This is called an initial condition.

Self-check A population follows dN/dt = 0.2 · N. At this moment N = 500. How fast is it growing?
  1. 0.2 per hour
  2. 100 per hour
  3. 2500 per hour
  4. 500 per hour

Answer: 100 per hour. Put the numbers into the equation: dN/dt = 0.2 · 500 = 100. Dividing 500 by 0.2 gives 2500, which uses k the wrong way round.

2Exponential growth and decay

The equation dy/dt = k·y always has the same solution, an exponential function:

y(t) = y0 · ekt

Here y0 is the value at t = 0. A positive k means growth. For decay the equation is dy/dt = −k·y and the solution is y = y0e−kt.

Radioactive decay is often given by its half-life t½: the time after which half of the substance is left. The rate constant follows from it:

k = ln 2 / t½

To find a time, take the natural logarithm of both sides:

t = ln(y / y0) / k

For example, 200 cells growing with k = 0.4 h⁻¹ reach 1000 cells after t = ln(5)/0.4 ≈ 4.02 h.

Self-check A substance has a half-life of 10 days. You start with 80 mg. How much is left after 20 days?
  1. 0 mg
  2. 20 mg
  3. 40 mg
  4. 60 mg

Answer: 20 mg. 20 days is two half-lives: 80 → 40 → 20 mg. 0 mg comes from thinking that two halves make the whole; the amount halves each time.

3Cooling and linear equations

Newton’s law of cooling: a hot object cools faster when it is much hotter than the room. With the room temperature Ta:

dT/dt = −k · (T − Ta) ⇒ T(t) = Ta + (T0 − Ta) · e−kt

The difference T − Ta decays exponentially, so the temperature moves towards the room temperature and never goes below it.

To find k from one measurement, put the known values in and take ln: k = −ln[(T1 − Ta)/(T0 − Ta)] / t1.

A first-order linear equation has the form y′ + p(x)·y = q(x). Multiply it by the integrating factor μ:

μ = e∫p dx, (μ·y)′ = μ·q

Then integrate both sides and divide by μ. For p = 2/x, μ = e2 ln x = x².

Self-check Tea at 90 °C is left in a room at 20 °C. Which temperature does it approach after a very long time?
  1. 0 °C
  2. 20 °C
  3. 55 °C
  4. 90 °C

Answer: 20 °C. The term (T0 − Ta)e−kt goes to 0, so T approaches Ta = 20 °C. 0 °C would be the answer if you forgot the room temperature.

4The method step by step

  1. Recognise the type: dy/dt = ky (growth or decay), Newton’s cooling, or y′ + p(x)y = q(x).
  2. Write down the standard solution for that type.
  3. Use the given data to find the constants: y0 from the start, k from a half-life or a second measurement.
  4. Answer the question: put in a time to find a value, or use ln to find a time.
  5. Check the units of k (h⁻¹, min⁻¹) against the units of t.

For a linear equation: find μ, integrate (μy)′ = μq, add the constant C, then use the initial condition to find C.

5A worked example

Follow every step. Try to predict the next one before you open it.

Worked example

A radioactive tracer has a half-life of 8 days. A sample contains 60 mg at the start. The decay follows dm/dt = −k·m. How much m remains after 12 days?

1

Recognise the type

This is exponential decay, so the solution is:

m(t) = m0 · e−kt, m0 = 60 mg
2

Find k from the half-life

k = ln 2 / 8 = 0.6931 / 8 = 0.08664 day⁻¹
3

Put in the time

k · t = 0.08664 · 12 = 1.0397
m = 60 · e−1.0397 = 60 · 0.3536 = 21.21 mg
4

Check the answer

12 days is 1.5 half-lives. After 8 days 30 mg is left and after 16 days 15 mg, so 21.2 mg lies between them, as expected.

60 · 0.51.5 = 21.21 mg
tm608301615247.51221.2
Answer

m ≈ 21.2 mg remains after 12 days.

6Common mistakes

  • In Newton’s law of cooling, forgetting to subtract and add back the room temperature Ta.
  • Using a positive exponent for decay, so the amount grows instead of shrinks.
  • Using log10 instead of the natural logarithm ln.
  • Mixing time units, such as k in min⁻¹ with t in hours.
  • With an integrating factor, multiplying only the left-hand side by μ.
Self-check A part at 80 °C cools in a room at 20 °C. At some time t, e−kt = 0.5. What is its temperature then?
  1. 30 °C
  2. 40 °C
  3. 50 °C
  4. 60 °C

Answer: 50 °C. T = 20 + (80 − 20) · 0.5 = 20 + 30 = 50 °C. Halving 80 directly gives 40 °C, which forgets the room temperature.

7How exam questions look

  • Easy: exponential growth and decay. Find the amount after a time, or the time to reach an amount, often from a half-life.
  • Medium: Newton’s law of cooling. Use one measurement to find k, then find a temperature or a time.
  • Hard: a first-order linear equation such as y′ + 2y/x = 3 with y(1) = 1. Use the integrating factor and find y at another x.

A quick check: decay and cooling answers must lie between the start value and the final value (0, or the room temperature).

Learn it step by step in the appLearn it step by step in the app

Worked examples

Example 1Easy
rr² + br + c?

For the equation y″ + 4y′ + 3y = 0, find the root r of the characteristic equation that is closest to zero. It sets how slowly the solution dies out.

y″ + 4y′ + 3y = 0

Find r

Show hints
  1. Substitute y = ert.
  2. r² + 4r + 3 = 0.
  3. Factor it or use the quadratic formula.
Show the answer and the step-by-step solution

Second-order linear equations: for y″ + b·y′ + c·y = 0 try y = ert: this gives the characteristic equation r² + b·r + c = 0. Two real roots r₁ ≠ r₂ give y = A·er₁t + B·er₂t (overdamped); a double root r gives y = (A + Bt)·ert (critically damped); complex roots −α ± jω give y = e−αt(A cos ωt + B sin ωt) (underdamped, oscillating). The initial values y(0) and y′(0) fix A and B. Written as y″ + 2ζωny′ + ωn²y = 0, ωn is the natural frequency and ζ the damping ratio: ζ < 1 oscillates. With a constant input, y″ + by′ + cy = c·K, the solution is the steady value K plus the free response.

Characteristic equation

r² + 4r + 3 = (r + 1)(r + 3) = 0

Roots

r = −1, r = −3
closest to zero: r = −1

Answer

r = −1

The general solution is y = A·e−1t + B·e−3t.

Example 2Medium
t (min)T (°C)5Ta​73 °C50 °C

A cup of coffee at 81 °C is left in a room at 21 °C. After 5 min its temperature is 73 °C. It follows Newton's law of cooling, dT/dt = −k·(T − Tₐ). How long after the start, t, does it take to reach 50 °C?

T0 = 81 °CTa = 21 °CT(5) = 73 °CT = 50 °C

Find t (min)

Show hints
  1. First find k from the measurement at t = 5 min.
  2. k = ln(60/52)/5 = 0.02862 min⁻¹.
  3. t = ln((T₀ − Tₐ)/(T − Tₐ))/k.
Show the answer and the step-by-step solution

First-order differential equations: dy/dt = k·y has the solution y = y₀·ekt (growth for k > 0, decay for k < 0); a half-life T gives k = ln 2/T. Newton's law of cooling, dT/dt = −k·(T − Tₐ), gives T(t) = Tₐ + (T₀ − Tₐ)·e−kt. A linear equation y′ + p(x)·y = q(x) is solved with the integrating factor μ = e∫p dx: (μy)′ = μq, so μy = ∫μq dx + C.

Cooling constant

k = ln(60/52)/5 = 0.02862 min⁻¹

Time to reach the target

t = ln(60/29)/0.02862 = 25.4 min

Answer

t = 25.4 min
Example 3Hard
ty1y(1) = ?

Solve y′ + y = 4e−2t with y(0) = 4. Find y(1).

y′ + y = 4e−2ty(0) = 4

Find y(1)

Show hints
  1. The integrating factor is μ = et.
  2. (ety)′ = 4e−t → ety = 4/(−1)·e−t + C.
  3. y = −4·e−2t + C·e−t. Use y(0) to find C.
Show the answer and the step-by-step solution

First-order differential equations: dy/dt = k·y has the solution y = y₀·ekt (growth for k > 0, decay for k < 0); a half-life T gives k = ln 2/T. Newton's law of cooling, dT/dt = −k·(T − Tₐ), gives T(t) = Tₐ + (T₀ − Tₐ)·e−kt. A linear equation y′ + p(x)·y = q(x) is solved with the integrating factor μ = e∫p dx: (μy)′ = μq, so μy = ∫μq dx + C.

Integrating factor

μ = et
(ety)′ = 4e−t

General solution

y = 4/(−1)·e−2t + C·e−t = −4·e−2t + C·e−t

Initial condition

4 = −4 + C → C = 8

Evaluate

y(1) = −4·0.1353 + 8·0.3679 = 2.402

Answer

y(1) = 2.402

Questions and answers

What is Differential equations?

A differential equation links a quantity to its own rate of change. It describes how something changes, not what it is.

Bacteria divide, so a bigger colony grows faster. The growth rate is proportional to the number of cells N:

How do I solve Differential equations problems step by step?

Second-order linear equations: for y″ + b·y′ + c·y = 0 try y = ert: this gives the characteristic equation r² + b·r + c = 0. Two real roots r₁ ≠ r₂ give y = A·er₁t + B·er₂t (overdamped); a double root r gives y = (A + Bt)·ert (critically damped); complex roots −α ± jω give y = e−αt(A cos ωt + B sin ωt) (underdamped, oscillating). The initial values y(0) and y′(0) fix A and B. Written as y″ + 2ζωny′ + ωn²y = 0, ωn is the natural frequency and ζ the damping ratio: ζ < 1 oscillates. With a constant input, y″ + by′ + cy = c·K, the solution is the steady value K plus the free response.

What are common mistakes in Differential equations?
  • That is the other root, further from zero; its term dies out faster.
  • r² + br + c = 0 with positive b and c has negative roots.
  • −b/2 is the midpoint of the roots, not a root.
What do the Differential equations exercises cover?
  • Easy: exponential growth and decay
  • Medium: Newton's law of cooling
  • Hard: first-order linear

Every problem has new values, so you learn the method instead of an answer. Stuck? Open a small hint first, and the full explanation only when you need it.

How practising works

  • Every problem has new values, so you learn the method instead of an answer.
  • Stuck? Open a small hint first, and the full explanation only when you need it.
  • Your progress, mistakes and saved problems are kept, so you can review before the exam.

Topics before and after this one

Learn first

Continue with

Calculators

Courses with this topic

More topics in Mathematics & statistics

Printable worksheet