Many laws of nature describe how fast something changes, not what it is. A population grows at a rate proportional to its size. A cup of tea cools faster when it is much hotter than the room. Equations that contain a derivative like dy/dx are called differential equations. This lesson shows how to solve the most common first-order types and use them to model growth, decay and cooling.
In this lesson you will learn
- What a differential equation and its order are
- General and particular solutions
- How to solve equations by separating the variables
- Exponential growth and decay, and Newton’s law of cooling
- The integrating factor method for linear equations
You should know integration basics, integration by substitution and exponential and logarithmic functions.
Want to go deeper? Our step-by-step Calculus course builds differentiation and integration from basic limits to advanced techniques.
What Is a Differential Equation?
A differential equation links a function with its derivatives. Its order is the highest derivative it contains. This lesson deals with first-order equations, which contain only dy/dx.
dy/dx = 2x
Integrate: y = x² + C general solution: a whole family of curves
If the curve passes through (1, 5): 5 = 1 + C, so C = 4
y = x² + 4 particular solution
The general solution contains an arbitrary constant C. A given condition, such as a point on the curve or a starting value, fixes C and gives a particular solution.
Separating the Variables
If the equation can be written as dy/dx = f(x) g(y), move everything with y to one side and everything with x to the other, then integrate both sides.
Solve dy/dx = xy, with y = 2 when x = 0.
(1/y) dy = x dx
∫ (1/y) dy = ∫ x dx
ln y = x²/2 + c
y = e^(x²/2 + c) = A e^(x²/2) where A = e^c
y(0) = 2 gives A = 2:
y = 2e^(x²/2) so, for example, y(1) = 2e^0.5 ≈ 3.30
Only one constant is needed. Constants from both sides combine into one.
Exponential Growth and Decay
When a quantity changes at a rate proportional to its size, dN/dt = kN. Separating gives N = N₀e^(kt), where N₀ is the starting amount. If k > 0 it grows; if k < 0 it decays.
A culture has 500 bacteria and doubles every 3 hours.
How many after 7 hours?
N = 500e^(kt), and N(3) = 1000: e^(3k) = 2, k = (ln 2)/3
N = 500 × 2^(t/3)
N(7) = 500 × 2^(7/3) ≈ 2520 bacteria
Newton’s Law of Cooling
An object cools at a rate proportional to the difference between its temperature T and the room temperature Tₛ: dT/dt = −k(T − Tₛ). The solution is T − Tₛ = (T₀ − Tₛ)e^(−kt).
Tea at 80 °C is in a room at 20 °C. After 10 minutes it is 60 °C.
When will it reach 40 °C?
T − 20 = 60e^(−kt)
t = 10: 40 = 60e^(−10k) → e^(−10k) = 2/3
T = 40: 20 = 60e^(−kt) → e^(−kt) = 1/3
Taking logs: t = 10 × ln 3 / ln 1.5 ≈ 27.1 minutes
Notice the tea takes 10 minutes to lose its first 20 degrees, but about 17 more minutes to lose the next 20. It cools more slowly as it nears room temperature.
Linear Equations and the Integrating Factor
An equation of the form dy/dx + P(x)y = Q(x) is called linear. Multiply through by the integrating factor e^(∫P dx). The left side then becomes the derivative of a product, which you can integrate directly.
Solve dy/dx + y = x.
P = 1, integrating factor = e^x
e^x dy/dx + e^x y = x e^x
d/dx (y e^x) = x e^x
y e^x = ∫ x e^x dx = (x − 1)e^x + C (integration by parts)
y = x − 1 + Ce^(−x)
As x grows, the term Ce^(−x) dies away, so every solution gets close to the line y = x − 1.
Common Mistakes
- Forgetting + C. Without it you have only one solution, not the general one.
- Adding C after taking exponentials. ln y = x²/2 + c becomes y = Ae^(x²/2), not e^(x²/2) + c.
- Separating a sum. dy/dx = x + y cannot be separated; it is linear, so use an integrating factor.
- Using the room temperature as T₀. T₀ is the starting temperature of the object.
Practice Exercises
Exercise 1. Solve dy/dx = 3y with y = 4 when x = 0.
Show answer
(1/y) dy = 3 dx gives ln y = 3x + c, so y = Ae^(3x). Using y(0) = 4 gives y = 4e^(3x).
Exercise 2. A radioactive substance has a half-life of 5 years. What fraction remains after 12 years?
Show answer
N = N₀(½)^(t/5). After 12 years, N/N₀ = 0.5^2.4 ≈ 0.189, so about 19% remains.
Frequently Asked Questions
Why can I write dy and dx separately?
It is a shorthand. What really happens is that you integrate both sides of (1/y)(dy/dx) = f(x) with respect to x, and the chain rule turns the left side into ∫(1/y) dy. The shorthand gives the same result.
Do all differential equations have formula solutions?
No. Many real ones cannot be solved exactly. Scientists then use numerical methods, which build the solution step by step with a computer.
Summary
- A differential equation links a function with its derivatives.
- The general solution has a constant; a condition gives the particular solution.
- Separate variables when dy/dx = f(x)g(y).
- dN/dt = kN gives N = N₀e^(kt); linear equations use an integrating factor.
