Tutorials › Calculus I › Total Mass with Piecewise Linear Density

Average Value and Accumulated Quantities · Tutorial 1293 of 1495

Total Mass with Piecewise Linear Density

Use the density on each section of a rod to find its mass, then add the section masses and check the total.

Intermediate 10 min read

What You'll Learn

  • Express a rod’s total mass as an integral of its linear density.
  • Split the mass integral at every section boundary.
  • Integrate a linear density from its endpoint values.
  • Use the trapezoid area formula to calculate each section’s mass.
  • Check calculated mass using sectionwise minimum and maximum densities.
  • Recognize why the rod’s two endpoint densities alone may not determine its mass.

From Density Along a Rod to Total Mass

A rod may be made of material whose density varies from one point to another. If the density is greater in some sections than in others, multiplying the rod’s length by a single density value will not generally give its mass. Instead, we account for the density at each position and add its contribution along the rod.

When density is given by a piecewise linear function, the calculation is especially manageable. We divide the rod at the points where the linear rule changes, find the mass on each section, and add those masses. Geometrically, each section contributes the area of a trapezoid whose parallel sides are the density values at the section’s endpoints.

Key idea: If \(x\) measures position along a rod and \(\rho(x)\) is its mass density, then total mass is the integral of \(\rho\) over the rod. For a linear density on a section, that integral equals the section length multiplied by the average of its two endpoint densities.

Setting Up the Mass Integral

Suppose a rod occupies the interval from \(x=a\) to \(x=b\), where position is measured in metres, and its density is \(\rho(x)\) kilograms per metre. A short piece of rod of length \(\Delta x\) near position \(x\) has approximate mass \(\rho(x)\Delta x\). Adding these contributions over the rod and taking the limit leads to the total-mass formula

$$ M=\int_a^b \rho(x)\,dx. $$

The units confirm the interpretation: density has units \(\mathrm{kg/m}\), and \(dx\) has units \(\mathrm{m}\), so the integral has units \(\mathrm{kg}\). When the density changes its linear rule at section boundaries, split the integral at every such boundary. For boundaries \(a=x_0<x_1<\cdots<x_n=b\), this gives

$$ M=\sum_{i=1}^{n}\int_{x_{i-1}}^{x_i}\rho(x)\,dx. $$

A value assigned to the density at a single boundary does not affect the integral. The density can therefore have a jump there: the section to the left may end at one density value, while the section to the right begins at another. Each section is integrated using its own linear rule and endpoint values.

Why a Linear Section Gives a Trapezoid

On a section from \(x=a\) to \(x=b\), let the density be linear, with endpoint values \(\rho(a)\) and \(\rho(b)\). Its rule can be written by linearly interpolating between those values:

$$ \rho(x)=\rho(a)+\frac{\rho(b)-\rho(a)}{b-a}(x-a). $$

Integrating this expression explains why only the endpoint values are needed. Set \(L=b-a\), the length of the section. The integral of the constant part is \(L\rho(a)\). The remaining part integrates to \(\frac{\rho(b)-\rho(a)}{L}\cdot\frac{L^2}{2}\). Combining the terms gives the section-mass formula:

$$ \begin{aligned} \int_a^b \rho(x)\,dx &=L\rho(a)+\frac{\rho(b)-\rho(a)}{L}\cdot\frac{L^2}{2}\\ &=L\rho(a)+\frac{L}{2}\bigl(\rho(b)-\rho(a)\bigr)\\ &=\frac{L}{2}\bigl(\rho(a)+\rho(b)\bigr). \end{aligned} $$

This is also the area formula for a trapezoid: its parallel sides have lengths \(\rho(a)\) and \(\rho(b)\), and the distance between them is \(L\). Density is the vertical quantity in this graph, so its graph’s area has the units of mass. If density is nonnegative, the section mass is the ordinary positive area under its graph.

Theorem: For a rod divided into sections on which density is linear, the total mass is the sum, over all sections, of section length times the mean of the two endpoint densities: $$ M=\sum_{i=1}^{n}(x_i-x_{i-1})\, \frac{\rho(x_{i-1})+\rho(x_i)}{2}. $$ Here the endpoint values are those belonging to the linear rule on that section; at a jump, use the appropriate one-sided value for each neighboring section.

The formula is exact for a linear section, not an approximation. It works for increasing, decreasing, and constant densities. For a physical rod, density should be nonnegative throughout. Since a linear function stays between its endpoint values on a section, nonnegative endpoint densities guarantee nonnegative density throughout that section.

Worked Example: Two Sections with a Shared Density

Worked Example: Two Sections with a Shared Density

A \(4\)-metre rod has density, in \(\mathrm{kg/m}\), given by \(\rho(x)=1+x\) for \(0\le x\le2\), and \(\rho(x)=4-\frac{x}{2}\) for \(2\le x\le4\). Find its total mass.

Split the mass integral at the point \(x=2\), where the rule changes:

$$ M=\int_0^2(1+x)\,dx+\int_2^4\left(4-\frac{x}{2}\right)\,dx. $$

For the first section, integrate and evaluate at its two boundaries:

$$ \int_0^2(1+x)\,dx =\left[x+\frac{x^2}{2}\right]_0^2 =\left(2+\frac{4}{2}\right)-\left(0+\frac{0}{2}\right) =4\ \mathrm{kg}. $$

For the second section:

$$ \int_2^4\left(4-\frac{x}{2}\right)\,dx =\left[4x-\frac{x^2}{4}\right]_2^4 =(16-4)-(8-1) =12-7 =5\ \mathrm{kg}. $$

Adding the section masses gives \(M=4+5=9\ \mathrm{kg}\). To check geometrically, the first section has length \(2\ \mathrm{m}\) and endpoint densities \(1\) and \(3\ \mathrm{kg/m}\), so its trapezoid area is \(2(1+3)/2=4\ \mathrm{kg}\). The second has length \(2\ \mathrm{m}\) and endpoint densities \(3\) and \(2\ \mathrm{kg/m}\), giving \(2(3+2)/2=5\ \mathrm{kg}\). The geometric total, \(4+5=9\ \mathrm{kg}\), agrees with the integrals.

Worked Example: A Jump at a Section Boundary

Worked Example: A Jump at a Section Boundary

A \(5\)-metre rod has density \(4-x\) on \(0\le x\le3\), and density \(2+(x-3)\) on \(3\le x\le5\), with density measured in \(\mathrm{kg/m}\). The density is \(1\ \mathrm{kg/m}\) just to the left of \(x=3\), and \(2\ \mathrm{kg/m}\) at the start of the second section. Find the mass.

Calculate each integral separately. On the first section, the endpoint densities are \(4\) and \(1\ \mathrm{kg/m}\):

$$ \begin{aligned} \int_0^3(4-x)\,dx &=\left[4x-\frac{x^2}{2}\right]_0^3\\ &=(12-\frac{9}{2})-0\\ &=\frac{15}{2} =7.5\ \mathrm{kg}. \end{aligned} $$

On the second section, \(2+(x-3)=x-1\). Its endpoint densities are \(2\) and \(4\ \mathrm{kg/m}\), so the integral is

$$ \begin{aligned} \int_3^5(x-1)\,dx &=\left[\frac{x^2}{2}-x\right]_3^5\\ &=(\frac{25}{2}-5)-(\frac{9}{2}-3)\\ &=\frac{15}{2}-\frac{3}{2}\\ &=6\ \mathrm{kg}. \end{aligned} $$

Therefore \(M=7.5+6=13.5\ \mathrm{kg}\). The trapezoid check gives \(3(4+1)/2=7.5\ \mathrm{kg}\) for the first section and \(2(2+4)/2=6\ \mathrm{kg}\) for the second, again totaling \(13.5\ \mathrm{kg}\). The jump at \(x=3\) creates no extra mass: a single position has zero length and contributes nothing to the integral.

Worked Example: Three Sections and a Geometric Bound

Worked Example: Three Sections and a Geometric Bound

A \(4\)-metre rod is divided into sections with boundaries \(0,1,3,4\) metres. The endpoint densities, in \(\mathrm{kg/m}\), are \(0.5\) and \(1.1\) on the first section, \(1.1\) and \(2.1\) on the second, and \(2.1\) and \(0.9\) on the third. Each section has linear density. Find the total mass and check it against bounds from the minimum and maximum densities.

The first section has length \(1\ \mathrm{m}\). Its mass is

$$ 1\cdot\frac{0.5+1.1}{2}=1\cdot0.8=0.8\ \mathrm{kg}. $$

The second section has length \(3-1=2\ \mathrm{m}\), so its mass is

$$ 2\cdot\frac{1.1+2.1}{2} =2\cdot\frac{3.2}{2} =2\cdot1.6 =3.2\ \mathrm{kg}. $$

The third section has length \(4-3=1\ \mathrm{m}\). Its mass is

$$ 1\cdot\frac{2.1+0.9}{2} =1\cdot\frac{3.0}{2} =1.5\ \mathrm{kg}. $$

Adding the contributions gives \(M=0.8+3.2+1.5=5.5\ \mathrm{kg}\). To check, use the minimum and maximum endpoint density on each linear section. The section masses must lie between the section length times these densities. Thus the total mass is at least \(1(0.5)+2(1.1)+1(0.9)=3.6\ \mathrm{kg}\), and at most \(1(1.1)+2(2.1)+1(2.1)=7.4\ \mathrm{kg}\). Since \(3.6\le5.5\le7.4\), the calculated mass lies within the bounds. The exact trapezoid calculations above provide the sharper value.

A Common Mistake: Using Only the Rod’s Endpoints

A tempting shortcut is to average the density at the two ends of the entire rod and multiply by the total length. This is correct only when the density is linear across the whole rod. A piecewise linear density may rise or fall within the rod, so its interior values cannot be discarded.

Pitfall: For the three-section rod in the last example, using only its end densities gives $$ 4\cdot\frac{0.5+0.9}{2} =4\cdot0.7 =2.8\ \mathrm{kg}. $$ This is wrong: it treats the density as a single straight line from \(0.5\) to \(0.9\ \mathrm{kg/m}\), ignoring the higher interior densities. Splitting at the actual section boundaries gives the correct mass \(5.5\ \mathrm{kg}\).

Another useful check is to compare the result with lower and upper estimates. On a linear section, the density stays between its endpoint values, so section length times the smaller endpoint density is a lower bound for its mass, and section length times the larger endpoint density is an upper bound. If a proposed mass lies outside the sum of these bounds, check the section lengths, density values, units, and arithmetic.

Summary

For a rod with piecewise linear density, total mass is found by splitting the integral at every change in the density rule, integrating each section, and adding the results. On a section of length \(L\) with endpoint densities \(\rho_1\) and \(\rho_2\), the exact contribution is \(L(\rho_1+\rho_2)/2\), the area of the corresponding trapezoid. Sectionwise density bounds and the trapezoid geometry provide direct checks on the result.

Check Your Understanding

Use the section boundaries and density rules stated in each question. Include units when reporting mass.

  1. A linear section is \(3\) metres long, with endpoint densities \(2\) and \(6\ \mathrm{kg/m}\). What is its mass?
  2. Why should a mass integral be split where the linear density rule changes?
  3. A section has length \(2\) metres and endpoint densities \(1\) and \(3\ \mathrm{kg/m}\). Give a lower bound, an upper bound, and the exact mass.
  4. Can a density jump at a single boundary add a positive amount to the rod’s mass? Explain.
  5. When is multiplying the total rod length by the average of the two end densities a valid way to find mass?

Test yourself: Calculus I final exam practice

Ready to check what you know? Work a full-length practice final, then open the complete worked solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers the full Calculus AB & BC curriculum (the core of Calculus I and II): full review, every practice question, and step-by-step solutions to each one.

QR code to download the Calc Pass app

Get the Calc Pass App

Scan to download and practice on the go, with instant scoring.

Calc Pass Volume 1: 1,114 Practice Questions book cover

Vol. 1: 1,114 Questions

The complete practice question bank, organized by AB & BC topic.

View on Amazon
Calc Pass Volume 2: Solutions Manual book cover

Vol. 2: Solutions Manual

Fully worked solutions to every question in Volume 1.

View on Amazon