Skip to content
Tutorials Center
My learning

Topics

Lesson 23 of 68 ยท Integrals

Applications of Integrals

Use definite integrals to find the area between curves, volumes of revolution, arc length, average value, work and centre of mass, with sympy and scipy checks.

A definite integral adds up a very large number of very small pieces. That single idea solves a surprising range of engineering questions: how much material is in a curved part, how long a cable must be, how much energy a spring stores, where a beam balances. The method is always the same, and it is more important than any formula.

  1. Cut the quantity into thin slices.
  2. Write the size of one slice as (something depending on x) * dx.
  3. Integrate that expression over the range.

In this lesson you apply that recipe six times. If the idea of accumulation is still new, review The Integral as Accumulated Change and The Fundamental Theorem of Calculus first. For integrals with no neat antiderivative, Numerical Integration shows how scipy takes over.

flowchart LR
    Q["Quantity to find"] --> S["Slice it thinly"]
    S --> P["Size of one slice<br/>g(x) dx"]
    P --> I["Integrate over<br/>[a, b]"]
    I --> R["Area, volume, length,<br/>work, mass ..."]

Every application follows the same pipeline: slice, size one slice, integrate.

Area between curves

If f(x) >= g(x) on [a, b], a thin vertical strip between the curves has height f(x) - g(x) and width dx. So

Area = integral from a to b of (f(x) - g(x)) dx.

The limits are usually the points where the curves cross. Solve f(x) = g(x) to find them. If the curves cross inside the interval, split the integral there, or integrate |f - g|, because area is never negative.

Take f(x) = 2x and g(x) = x**2. They meet where 2x = x**2, at x = 0 and x = 2. On that interval the line is above the parabola.

Python Area between a line and a parabola

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Do it by hand: the integrand is 2x - x**2, its antiderivative is x**2 - x**3/3, and at x = 2 that equals 4 - 8/3 = 4/3.

Sometimes it is easier to slice horizontally. If the region is described as "right curve minus left curve" as functions of y, integrate (x_right(y) - x_left(y)) dy instead.

Volumes of revolution

Spin a region around an axis and you get a solid. Slice the solid perpendicular to the axis and every slice is a disk, so its volume is pi * r**2 * dx, where r is the distance from the axis to the curve.

  • Disk method (region touches the axis): V = pi * integral of r(x)**2 dx.
  • Washer method (region has a gap): V = pi * integral of (R(x)**2 - r(x)**2) dx, where R is the outer radius and r the inner one.
  • Shell method (rotating about the y-axis with x slices): V = 2 * pi * integral of x * h(x) dx, where h is the height of the strip.

Rotate y = sqrt(x) for 0 <= x <= 4 about the x-axis for a disk example. Then rotate the region between y = x and y = x**2 about the x-axis for a washer example.

Python Disk, washer and shell volumes

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The shell result pi/2 can be checked another way. Slicing the same solid with horizontal washers (outer radius 1, inner radius sqrt(y)) gives pi * integral of (1 - y) dy over [0, 1], which is also pi/2. Getting the same answer by two methods is a good habit for catching setup mistakes.

Arc length

A tiny piece of a curve is nearly a straight segment with horizontal run dx and vertical rise dy = f'(x) dx. Pythagoras gives its length sqrt(dx**2 + dy**2) = sqrt(1 + f'(x)**2) dx. Therefore

L = integral from a to b of sqrt(1 + f'(x)**2) dx.

That square root rarely has a clean antiderivative, so numerical integration is the everyday tool. A good test curve is y = x**(3/2) on [0, 4], where the exact answer is (8/27)(10**1.5 - 1).

Python Arc length: exact, numeric and polyline

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The curve must be longer than the straight chord between its end points, and it is. The polyline is the integral's own definition in disguise: it sums short segments and approaches the exact value as you add more of them.

Surface area of a solid of revolution

Volume measures the inside of a solid; surface area measures its skin. Spin a curve y = f(x) about the x-axis and a short piece of arc of length ds sweeps out a thin band, a circular ribbon of radius y and width ds. Its area is the circumference times the width:

dS = 2 * pi * y * ds, with ds = sqrt(1 + f'(x)**2) dx.

Adding the bands gives

S = 2 * pi * integral from a to b of f(x) * sqrt(1 + f'(x)**2) dx (about the x-axis).

About the y-axis the radius of each band is x, so replace f(x) by x: S = 2 * pi * integral of x * sqrt(1 + f'(x)**2) dx.

Parametric and polar curves

If the curve is given parametrically as (x(t), y(t)), the same two ideas become

  • volume about the x-axis: V = pi * integral of y(t)**2 * |x'(t)| dt,
  • surface area about the x-axis: S = 2 * pi * integral of y(t) * sqrt(x'(t)**2 + y'(t)**2) dt.

For a polar curve r = r(theta) rotated about the polar axis (the x-axis), use x = r cos(theta) and y = r sin(theta), so that

  • arc length: L = integral of sqrt(r**2 + r'**2) dtheta,
  • surface area: S = 2 * pi * integral of r sin(theta) * sqrt(r**2 + r'**2) dtheta,
  • volume: V = (2 * pi / 3) * integral of r**3 * sin(theta) dtheta.

A good test is the sphere of radius R, whose area 4 * pi * R**2 and volume (4/3) * pi * R**3 are known. A semicircle can be written in all three ways, and the three methods must agree.

Python Surface areas and volumes of revolution, three ways

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Notice that all three descriptions of the sphere agree: only the bookkeeping differs. Choose the form that makes the derivative and the square root simplest. For a rotation about a line other than an axis, measure every radius from that line (for example R(x) = f(x) - c when rotating about y = c).

Average value of a function

The average of n numbers is their sum divided by n. For a continuous function the sum becomes an integral and the count becomes the interval length:

f_avg = (1 / (b - a)) * integral from a to b of f(x) dx.

This is how engineers define the average of a changing signal. For sin(x) on [0, pi] the integral is 2, so the average is 2/pi, about 0.6366. The related root mean square (RMS) value, sqrt(average of f**2), is what a voltmeter reports for AC voltage.

Python Average value and RMS of a signal

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The last line shows that averaging equally spaced samples is a Riemann sum divided by the length, which is why np.mean approximates the integral average.

Work

When a force F(x) pushes an object along a line, the work over a small step is F(x) dx, so total work is W = integral of F(x) dx. In SI units force is in newtons, distance in metres and work in joules.

A spring obeys Hooke's law, F = k*x. Stretching a spring with k = 200 N/m from 0.1 m to 0.3 m costs integral of 200x dx = 100*(0.3**2 - 0.1**2) = 8 J.

A hanging chain shows why constant force is not enough. A 10 m chain of mass 2 kg per metre hangs from the top of a building. Lifting the bottom link to the top is easy, but lifting the top link costs nothing. A slice of chain at depth y has mass 2 dy and must rise y metres, so it needs 2 * 9.81 * y dy of work. Integrate that from 0 to 10 to get the total.

Python Work done by a spring and on a hanging chain

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The final line is a sanity check: pulling up the whole chain is the same as lifting its centre of mass by half its length.

Centre of mass

For a thin rod with density rho(x) (kilograms per metre), the mass is M = integral of rho dx. The first moment is integral of x * rho dx, and the balance point is their ratio:

x_bar = (integral of x * rho(x) dx) / (integral of rho(x) dx).

For a flat region of uniform density (a centroid), rho is constant, the mass is replaced by the area, and the formulas are

x_bar = (1/A) * integral of x * f(x) dx, y_bar = (1/A) * integral of (f(x)**2 / 2) dx.

The second formula comes from treating each vertical strip as a thin bar whose own centre is at half its height.

Python Balance point of a rod and a region

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The rod balances at 7/6, right of its midpoint, because the heavier end pulls the balance point toward itself.

Units are your best error detector. An area integral must end in length squared, a volume in length cubed, work in joules. If the units come out wrong, the integrand is wrong.

Check your understanding

Quick check ยท 5 questions

of 5 answered You scored / 5 ยท perfect!

  1. 1. Which integral gives the area between y = f(x) above y = g(x) from x = a to x = b?

    A vertical strip has height equal to the upper curve minus the lower curve. Reversing the order would give a negative area.
  2. 2. The region under y = sqrt(x) on [0, 4] is rotated about the x-axis. Which setup gives the volume?

    Each slice is a disk of radius sqrt(x), so its area is pi times sqrt(x) squared, which is pi x. Forgetting to square the radius is the most common mistake.
  3. 3. Why does the arc length formula contain sqrt(1 + f'(x)^2)?

    A tiny piece of curve has a run dx and a rise dy = f'(x) dx, so its length is sqrt(dx^2 + dy^2) = sqrt(1 + f'(x)^2) dx.
  4. 4. A spring has k = 200 N/m. What is the work to stretch it from 0.1 m to 0.3 m?

    W = integral of 200x dx from 0.1 to 0.3 = 100 (0.09 - 0.01) = 8 J. Multiplying 200 by 0.2 m would wrongly treat the force as constant.
  5. 5. A rod has density rho(x) = 1 + x on [0, 2]. Where is its balance point relative to the midpoint x = 1?

    The density grows with x, so more mass is on the right. The balance point is the moment 14/3 divided by the mass 4, which is 7/6.

Summary

  • Every application is the same recipe: slice, write the size of one slice, integrate.
  • Area between curves is the integral of upper minus lower; find limits where the curves meet.
  • Volumes of revolution use disks, washers (outer squared minus inner squared) or shells.
  • Arc length is the integral of sqrt(1 + f'(x)**2); use scipy.integrate.quad when no closed form exists.
  • Average value is the integral divided by the interval length; RMS averages the square first.
  • Work is the integral of force over distance; centre of mass is a moment divided by a mass.

Next: Vectors in 2D and 3D.