MATH-100 · Lesson 8 of 12 · 37 min
Antiderivatives and differential equations
So far you have started with a function and found its derivative. Engineering problems often run the other way. An accelerometer measures acceleration, and you want velocity and position. A flow meter measures the rate at which water enters a tank, and you want the volume. A physical law tells you how fast a temperature or a voltage changes, and you want the temperature or voltage itself. Undoing differentiation is called antidifferentiation, and equations that relate a function to its derivatives are called differential equations. This lesson introduces both: how to find antiderivatives, how initial conditions pin down a particular answer, how to solve the simplest and most important differential equations of growth, decay, cooling and circuit response, how to picture solutions with slope fields, and how to compute them numerically with Euler's method when no formula is available. The definite integral of Lesson 9 builds directly on these ideas.
Antiderivatives
A function \(F\) is an antiderivative of \(f\) on an interval if \(F'(x) = f(x)\) for every \(x\) in the interval. For example, \(F(x) = x^3\) is an antiderivative of \(f(x) = 3x^2\). So are \(x^3 + 5\) and \(x^3 - \pi\), because constants differentiate to zero. Lesson 6 showed that two functions with the same derivative on an interval differ only by a constant, so every antiderivative of \(f\) has the form \(F(x) + C\). This family is written with the indefinite integral sign:
where \(C\) is an arbitrary constant, the constant of integration. Each differentiation rule, read backward, gives an antiderivative rule:
| Function \(f(x)\) | Antiderivative \(F(x)\) |
|---|---|
| \(x^n\) (\(n \ne -1\)) | \(\dfrac{x^{n+1}}{n+1}\) |
| \(\dfrac{1}{x}\) | \(\ln|x|\) |
| \(e^{kx}\) | \(\dfrac{1}{k}e^{kx}\) |
| \(\sin kx\) | \(-\dfrac{1}{k}\cos kx\) |
| \(\cos kx\) | \(\dfrac{1}{k}\sin kx\) |
| \(\sec^2 x\) | \(\tan x\) |
| \(\dfrac{1}{1 + x^2}\) | \(\arctan x\) |
| \(\dfrac{1}{\sqrt{1 - x^2}}\) | \(\arcsin x\) |
Antiderivatives of sums and constant multiples follow term by term. Always check an antiderivative by differentiating it: you should get back the original function.
Worked problem
Antiderivatives term by term
Find \(\displaystyle\int \left(6x^2 - \frac{4}{x} + 3e^{2x} - \cos 5x\right) dx\).
Show solution
- \(6x^2 \to 2x^3\); \(-4/x \to -4\ln|x|\); \(3e^{2x} \to \tfrac{3}{2}e^{2x}\); \(-\cos 5x \to -\tfrac{1}{5}\sin 5x\).
- Check by differentiating: \(6x^2 - 4/x + 3e^{2x} - \cos 5x\).
Answer: 2x³ − 4 ln|x| + (3/2)e^(2x) − (1/5) sin 5x + C.
Not every function has an antiderivative that can be written with elementary functions. The antiderivative of \(e^{-x^2}\), which is central to probability, exists but cannot be expressed as a finite combination of powers, exponentials, logarithms and trigonometric functions. Such antiderivatives are computed numerically or defined as new special functions.
Initial value problems
An antiderivative contains an unknown constant. One known value of the function, an initial condition, fixes it. A problem of the form "find \(y\) such that \(y' = f(x)\) and \(y(x_0) = y_0\)" is an initial value problem.
Worked problem
Fixing the constant
Find \(y\) if \(y' = 4x^3 - 2\) and \(y(1) = 5\).
Show solution
- Antiderivative: \(y = x^4 - 2x + C\).
- Initial condition: \(5 = 1 - 2 + C\), so \(C = 6\).
Answer: y = x⁴ − 2x + 6.
Motion from acceleration
The most familiar initial value problem is motion with known acceleration. Since \(v'(t) = a(t)\) and \(s'(t) = v(t)\), velocity is an antiderivative of acceleration, and position is an antiderivative of velocity. Two initial conditions, the starting velocity \(v_0\) and position \(s_0\), fix the two constants. For constant acceleration \(a\):
These are the kinematic equations of introductory physics (PHYS-130), derived here in two lines of calculus.
Worked problem
Stopping distance
A car traveling at 100 km/h (27.8 m/s) brakes with a constant deceleration of 7 m/s² after a reaction time of 1.5 s. How far does it travel before stopping?
Show solution
- During the reaction time: \(27.8 \times 1.5 = 41.7\) m.
- Braking: \(v(t) = 27.8 - 7t = 0\) at \(t = 3.97\) s.
- Braking distance: \(s = 27.8 \times 3.97 - \tfrac{1}{2} \times 7 \times 3.97^2 = 110.4 - 55.2 = 55.2\) m.
- Total: \(41.7 + 55.2 = 96.9\) m.
Answer: About 97 m, of which 42 m is covered before the brakes are applied. Because braking distance grows with the square of speed, at 120 km/h the braking part rises to about 79 m.
Worked problem
Non-constant acceleration
An elevator's acceleration during start-up is \(a(t) = 1.2 \sin(\pi t / 2)\) m/s² for \(0 \le t \le 2\) s, starting from rest. Find its velocity at \(t = 2\) s.
Show solution
- Antiderivative: \(v(t) = -\dfrac{2.4}{\pi}\cos(\pi t / 2) + C\).
- At \(t = 0\), \(v = 0\): \(0 = -2.4/\pi + C\), so \(C = 2.4/\pi\).
- At \(t = 2\): \(v = \dfrac{2.4}{\pi}(1 - \cos \pi) = \dfrac{4.8}{\pi} = 1.53\) m/s.
Answer: About 1.53 m/s. A smooth acceleration profile like this limits jerk (Lesson 5), giving a more comfortable ride than a sudden step in acceleration.
Differential equations
A differential equation relates an unknown function to one or more of its derivatives. The equations above, \(y' = f(x)\), are the simplest kind, in which the derivative is given directly. More interesting equations involve the unknown function itself: Newton's second law for a spring, \(m x'' = -kx\); the cooling law \(T' = -k(T - T_a)\); the circuit law \(RC \, V' + V = V_s\). A solution is a function that satisfies the equation identically. The order of the equation is the highest derivative it contains.
Checking a proposed solution needs only differentiation. For example, \(x(t) = \cos(\omega t)\) with \(\omega = \sqrt{k/m}\) satisfies \(m x'' = -kx\), because \(x'' = -\omega^2 \cos \omega t = -(k/m) x\). The general theory of solving differential equations is the subject of a later course (MATH-201); here we solve the most important first-order cases.
Exponential growth and decay
The simplest differential equation involving the function itself says that a quantity changes at a rate proportional to its size:
To solve it, divide by \(y\) (assuming \(y \ne 0\)) to get \(\dfrac{y'}{y} = k\). The left side is the derivative of \(\ln|y|\), so \(\ln|y| = kt + C\), and exponentiating gives \(y = y_0 e^{kt}\), where \(y_0 = y(0)\). This is the exponential model of Lesson 2, now derived from the rate law that underlies it: radioactive decay, continuously compounded interest, unconstrained population growth, the discharge of a capacitor through a resistor and first-order chemical reactions all obey it.
Approach to an equilibrium
Many systems relax toward an equilibrium value at a rate proportional to their distance from it. Newton's law of cooling states that an object's temperature changes at a rate proportional to the difference between it and the surroundings:
Substituting \(u = T - T_a\) gives \(u' = -ku\), so \(u = u_0 e^{-kt}\) and:
The same equation describes a capacitor charging through a resistor from a source \(V_s\): \(RC\,\dfrac{dV}{dt} = V_s - V\), with solution \(V(t) = V_s(1 - e^{-t/RC})\) when the capacitor starts uncharged. It also describes a thermometer settling to a new reading, a tank level approaching equilibrium through an outlet, and the speed of a lightly loaded motor approaching its final value. In each case, the response reaches about 63 percent of its final change after one time constant and about 99 percent after five.
Worked problem
Finding a cooling constant
A cup of coffee at 90 °C is placed in a 20 °C room and cools to 70 °C in 10 minutes. When will it reach 50 °C?
Show solution
- Model: \(T = 20 + 70 e^{-kt}\).
- At 10 min: \(70 = 20 + 70e^{-10k}\), so \(e^{-10k} = 50/70\) and \(k = \ln(1.4)/10 = 0.0336\) per minute.
- For 50 °C: \(30 = 70 e^{-kt}\), so \(t = \ln(70/30)/0.0336 = 25.2\) min.
Answer: About 25 minutes after it was poured. The same two-measurement method is used to find the time constants of thermal sensors and of buildings cooling during a power outage.
Worked problem
Charging a capacitor
A 220 µF capacitor charges through a 10 kΩ resistor from a 12 V supply. How long until it reaches 10 V?
Show solution
- Time constant: \(RC = 10{,}000 \times 220 \times 10^{-6} = 2.2\) s.
- Solve \(12(1 - e^{-t/2.2}) = 10\): \(e^{-t/2.2} = 1/6\), so \(t = 2.2 \ln 6 = 3.94\) s.
Answer: About 3.9 s, or 1.8 time constants. Timer circuits use exactly this calculation to set delays.
Slope fields
A first-order differential equation \(y' = f(t, y)\) gives the slope of the solution at every point of the plane. Drawing short line segments with these slopes at a grid of points produces a slope field (or direction field), which shows the shape of all solutions at once. Each solution curve follows the segments, like a leaf floating on a stream. Slope fields reveal qualitative behavior without solving the equation: equilibrium solutions (constant solutions, where \(y' = 0\)), whether solutions approach or move away from them, and how fast.
In the cooling equation, \(T = T_a\) is an equilibrium, and every solution approaches it: a stable equilibrium. In the growth equation \(y' = ky\) with \(k > 0\), the equilibrium \(y = 0\) is unstable: any solution that starts slightly away from it moves farther away. A more realistic population model, the logistic equation \(y' = ry(1 - y/K)\), has an unstable equilibrium at 0 and a stable one at the carrying capacity \(K\), and its slope field shows S-shaped solution curves rising from small populations to \(K\).
Euler's method
Most differential equations that arise in practice cannot be solved with a formula. They are solved numerically, and the simplest numerical method, due to Leonhard Euler, follows the slope field in small steps. Starting from the initial point \((t_0, y_0)\), take a step of size \(h\) along the tangent line, whose slope is \(f(t_0, y_0)\), and repeat:
Each step is a linear approximation (Lesson 3), and each introduces a small error. Over a fixed interval, the total error of Euler's method is roughly proportional to \(h\): halving the step size roughly halves the error. More accurate methods, such as the Runge-Kutta methods used in engineering software, sample the slope at several points within each step, but they rest on the same idea.
Worked problem
Euler's method for cooling
Use Euler's method with \(h = 5\) minutes to estimate the temperature at \(t = 15\) min for \(T' = -0.1(T - 20)\), \(T(0) = 90\). Compare with the exact solution.
Show solution
- Step 1: slope \(-0.1 \times 70 = -7\); \(T_1 = 90 - 35 = 55\).
- Step 2: slope \(-0.1 \times 35 = -3.5\); \(T_2 = 55 - 17.5 = 37.5\).
- Step 3: slope \(-0.1 \times 17.5 = -1.75\); \(T_3 = 37.5 - 8.75 = 28.75\).
- Exact: \(T(15) = 20 + 70 e^{-1.5} = 20 + 15.6 = 35.6\).
Answer: Euler gives 28.8 °C against the exact 35.6 °C, an error of almost 7 °C with this large step. With h = 1 minute the estimate becomes 34.4 °C, and with h = 0.1 minute 35.5 °C, showing the error shrinking roughly in proportion to h.
Engineers rarely write their own differential equation solvers, but understanding Euler's method explains the behavior of the solvers in simulation software: why step size matters, why results can drift, and why some equations, called stiff equations, require special methods to avoid instability. Lesson 11 returns to numerical methods.
Common mistakes
MistakeForgetting the constant of integration.
InsteadEvery indefinite integral includes + C, fixed later by an initial condition if one is given.
MistakeUsing xⁿ⁺¹/(n + 1) for n = −1.
InsteadThe antiderivative of 1/x is ln|x|.
MistakeWriting the antiderivative of e^(kx) as e^(kx).
InsteadDivide by k: (1/k)e^(kx).
MistakeApplying the cooling solution without shifting by the ambient temperature.
InsteadSolve for T − Tₐ, which decays exponentially.
MistakeTrusting Euler's method with a large step.
InsteadReduce h and check that the answer converges.
Summary and key terms
- An antiderivative F of f satisfies F′ = f; all antiderivatives are F + C.
- Reading differentiation rules backward gives a table of basic antiderivatives.
- Initial conditions fix the constants; acceleration integrates to velocity and position.
- Differential equations relate a function to its derivatives; solutions are checked by substitution.
- dy/dt = ky gives y = y₀eᵏᵗ; approach to equilibrium gives T = Tₐ + (T₀ − Tₐ)e^(−kt).
- Slope fields show the shape of all solutions and the stability of equilibria.
- Euler's method steps along tangent lines; its error is roughly proportional to the step size.
- Antiderivative
- A function whose derivative is a given function.
- Indefinite integral
- The family of all antiderivatives, written ∫f(x) dx.
- Constant of integration
- The arbitrary constant C in an antiderivative.
- Initial value problem
- A differential equation together with a known value of the solution.
- Differential equation
- An equation relating a function to its derivatives.
- Order
- The highest derivative in a differential equation.
- Newton's law of cooling
- Temperature changes at a rate proportional to its difference from the surroundings.
- Slope field
- A plot of short segments showing the slope given by a differential equation.
- Equilibrium solution
- A constant solution of a differential equation.
- Euler's method
- A numerical method that advances a solution along tangent lines.
Practice problems
Work each problem on paper first, then reveal the answer to check.
Find \(\int (3x^2 + 2x - 5)\,dx\).
Show answer
x³ + x² − 5x + C.
Find \(\int (e^{-3x} + \sec^2 x)\,dx\).
Show answer
−(1/3)e^(−3x) + tan x + C.
Solve \(y' = \cos x\), \(y(0) = 2\).
Show answer
y = sin x + 2.
A ball is thrown upward at 15 m/s from 2 m. With a = −9.81 m/s², when does it reach its peak and how high?
Show answer
t = 1.53 s; height 2 + 11.47 = 13.5 m.
Verify that \(y = 3e^{-2t}\) solves \(y' + 2y = 0\).
Show answer
y′ = −6e^(−2t); y′ + 2y = −6e^(−2t) + 6e^(−2t) = 0.
A culture doubles every 3 hours. Write its growth equation.
Show answer
dy/dt = ky with k = ln 2 / 3 ≈ 0.231 per hour.
An object at 100 °C in a 25 °C room has k = 0.05 per minute. Temperature after 20 min?
Show answer
25 + 75e^(−1) = 52.6 °C.
What fraction of its final voltage does an RC circuit reach after 3 time constants?
Show answer
1 − e^(−3) ≈ 95%.
What are the equilibria of \(y' = y(4 - y)\), and are they stable?
Show answer
y = 0 (unstable) and y = 4 (stable).
One Euler step with h = 0.1 for \(y' = y\), \(y(0) = 1\)?
Show answer
y₁ = 1 + 0.1 × 1 = 1.1 (exact 1.105).
Lesson quiz · 5 questions
Score 60% or more to complete this lesson.
Create a free account to save your progress, take quizzes and earn a certificate.