Pure mathematics is, in its way, the poetry of logical ideas, Albert Einstein.
To find the average of a finite set of numbers, we add them up and divide by how many there are. The discrete average of function values $y_1, y_2, \dots, y_n$ sampled at specific points within an interval $[a, b]$ is: $AVG = \frac{y_1 + y_2 + \dots + y_n}{n}$
But how do you find the average of a continuous function where there are infinitely many points?
We can approximate the continuous average by taking $n$ equally spaced sample points in the interval $[a, b]$. The width of each subinterval is $\Delta x = \frac{b - a}{n}$, which means $n = \frac{b - a}{\Delta x}$.
Substituting this $n$ into our discrete average formula gives: $AVG \approx \frac{y_1 + y_2 + \dots + y_n}{\frac{b - a}{\Delta x}} = \frac{1}{b - a} \sum_{i=1}^{n} y_i \Delta x$
As $n$ approaches infinity, the Riemann sum turns into a definite integral. This leads us to the formal definition.
If $f$ is a continuous function on $[a, b]$, then its average (or mean) value on $[a, b]$ is given by: $\boxed{f_{avg} = \frac{1}{b - a} \int_{a}^{b} f(x) \, d}x$ where the integral represents the signed area under the curve, and $\frac{1}{b - a}$ acts as the scaling factor.
To see how the area under a curve directly relates to its average height, you can explore this interactive visualization:
Definition. The average value of a continuous function f(x) over the interval [a, b] is AVG = $\frac{y_1+y_2+···+y_n}{n}$ where y1, y2, ···, yn represent the function values at specific points within the interval [a, b] and n is the total number of points where the function is evaluated within the interval [a, b].
Since integrals are essentially a sum of all of the possible f(x) values, AVG = $\frac{1}{b-a}\int_{a}^{b} f(x)dx$.
Said in a more mathematical way, $\lim_{n \to ∞}\frac{y_1+y_2+···+y_n}{n}$ = $\frac{1}{b-a}\int_{a}^{b} f(x)dx$ where $\int_{a}^{b} f(x)dx$ represents the signed area under the curve of f(x) between x = a and x = b, $\frac{1}{b-a}$ is a scaling factor.
Average Value Theorem. If f is a continuous function on [a, b], then its average or mean value on [a, b] is given by favg = $\frac{\int_{a}^{b} f(x)dx}{b-a}$
A weighted average is a method of computing a mean where some elements contribute more than others. The weights reflect the relative significance of each data point. In other words, some elements or data points have different weights or importance assigned to them. The weights reflect the relative significance or contribution of each element to the overall average.
For a discrete list of elements $x_1, \dots, x_n$ with corresponding weights $w_1, \dots, w_n$, the weighted average is calculated by multiplying each value by its weight, and dividing by the sum of all the weights:
$\boxed{Weighted\ Average = \frac{w_1x_1 + w_2x_2 + \dots + w_nx_n}{w_1 + \dots + w_n}}$
Note that if the weights are all just 1, that is, all elements or data points have the same importance, then the weighted average is just a plain average.
Stock Portfolio Price. In finance, a weighted average could be used to calculate the average price of your stock.
Let’s suppose that you are interested in investing in a stock, and you bought it for 10, 20, and 25 dollars respectively, purchasing $w_1$, $w_2$, and $w_3$ shares respectively.
How much did you spend? $10w_1 + 20w_2 + 25w_3$
Average price per share: $\frac{10w_1 + 20w_2 + 25w_3}{w_1 + w_2 + w_3}$
Ammo Procurement: A general purchases $20,000$ units at $\$1.00$ each, $15,000$ units at $1.15$ each, and $5,000$ units at $2.00$ each. The total number of units acts as the weight.
To calculate the weighted average price per unit of ammo purchased, we need to consider the total cost and the total number of units purchased, that is, you multiply the price per unit by the total number of units for each purchase, sum them up, and then divide by the total number of units purchased.
$Average = \frac{1(20,000) + 1.15(15,000) + 2(5,000)}{20,000 + 15,000 + 5,000} = \frac{20,000 + 17,250 + 10,000}{40,000} = \frac{47,250}{40,000} \approx 1.18$
So, the weighted average price per unit of ammo purchased is 1.18 dollars.
Exercise Tracking: Calculate the average time you spend exercising over a 30-day month when you exercised 20 mins for 7 days, 60 mins for 5 days, 45 mins for 14 days, and 0 mins for 4 days.
$Average = \frac{20(7) + 60(5) + 45(14) + 0(4)}{7 + 5 + 14 + 4} = \frac{140 + 300 + 630 + 0}{30} = \frac{1070}{30} \approx 35.67 \text{ mins/day}$, the weighted average time you spent working out for this month was approximately 35.67 minutes per day.
The continuous analogue of a weighted average requires integrals. Let $f(x)$ be a function defined on $[a, b]$, and let $w(x)$ be a non-negative weight function on the same interval.
Continuous Weighted Average, $\boxed{f_{avg, w} = \frac{\int_{a}^{b} f(x)w(x) \, dx}{\int_{a}^{b} w(x) \, dx}}$
Self-check: If $f(x) = c$ is constant, then $c$ pulls out of the top integral, the weight integrals cancel, and the average is just $c$.
Problem: Witches are boiling a brew on Halloween. The cauldron’s shape is formed by revolving the curve $y = x^2$ around the y-axis, bounded by a height of $y = 5$. The temperature of the water is not uniform—it is hottest at the bottom ($100^\circ\text{C}$) and cools toward the top ($60^\circ\text{C}$). The temperature at any height $y$ is given by $T(y) = 100 - 8y$. What is the average temperature of the fluid in the cauldron?
Solution:
Because the fluid at the wider top of the cauldron contains more volume than the narrow bottom, we cannot just average the highest and lowest temperatures. We must use a continuous weighted average, where the temperature $T(y)$ is weighted by the volume of water $dV$ at that specific depth, Figure 1.c.
Find the weight function (Volume of a slice):
We slice the cauldron horizontally into disks. The volume of a disk at height $y$ is $dV = \pi r^2 \, dy$.
Since the curve is $y = x^2$, the radius squared is $r^2 = x^2 = y$.
Therefore, the weight function is $dV = \pi y \, dy$.
Calculate the total “heat energy”:
Integrate the product of temperature and volume from $y = 0$ to $y = 5$:
$\int_{0}^{5} T(y) \, dV = \int_{0}^{5} (100 - 8y)(\pi y) \, dy = \pi \int_{0}^{5} (100y - 8y^2) \, dy$
$\pi \left[ 50y^2 - \frac{8}{3}y^3 \right]_{0}^{5} = \pi \left( 50(25) - \frac{8}{3}(125) \right) = \pi \left( 1250 - \frac{1000}{3} \right) = \frac{2750\pi}{3}$
Calculate the total volume (sum of the weights):
$\int_{0}^{5} dV = \int_{0}^{5} \pi y \, dy = \pi \left[ \frac{y^2}{2} \right]_{0}^{5} = \frac{25\pi}{2}$
Find the weighted average: $T_{avg} = \frac{\text{Total Energy}}{\text{Total Volume}} = \frac{\frac{2750\pi}{3}}{\frac{25\pi}{2}} = \frac{2750\pi}{3} \cdot \frac{2}{25\pi} = \frac{5500}{75} \approx 73.3^\circ\text{C}$
Even though the midpoint between $100^\circ\text{C}$ and $60^\circ\text{C}$ is $80^\circ\text{C}$, the actual average temperature is much cooler ($73.3^\circ\text{C}$) because the wider top half of the cauldron holds significantly more of the cooler water.
The Setup: The witches’ cauldron is formed by rotating the parabola $y = 2x^2$ around the y-axis, up to a height of $y = 4$. The temperature decreases linearly from $90^\circ\text{C}$ at the bottom ($y = 0$) to $50^\circ\text{C}$ at the top ($y = 4$), giving the temperature function $T(y) = 90 - 10y$. What is the average temperature of the fluid? (Figure 1)
Because we are rotating around the y-axis, we slice the volume horizontally into thin disks of thickness $dy$. The radius $r$ of each disk is the $x$-coordinate on the curve.
Find the Area of a Slice:
Since $y = 2x^2$, the radius squared is $x^2 = \frac{y}{2}$.
The cross-sectional area of a disk is $A(y) = \pi r^2 = \pi \left(\frac{y}{2}\right)$.
Calculate the Weighted Average:
We integrate the temperature weighted by the disk areas from $y=0$ to $y=4$:
$T_{avg} = \frac{\int_{0}^{4} T(y) A(y) \, dy}{\int_{0}^{4} A(y) \, dy} = \frac{\int_{0}^{4} (90 - 10y)\left(\pi\frac{y}{2}\right) \, dy}{\int_{0}^{4} \pi\frac{y}{2} \, dy}$
Evaluate the Numerator (Total Heat Energy):
Pulling out $\pi$, we multiply the terms inside the integral: $\pi \int_{0}^{4} (45y - 5y^2) \, dy = \pi \left[ \frac{45y^2}{2} - \frac{5y^3}{3} \right]_{0}^{4}$
Evaluating at $y = 4$: $\pi \left( \frac{45(16)}{2} - \frac{5(64)}{3} \right) = \pi \left( 360 - \frac{320}{3} \right) = \pi \left( \frac{1080 - 320}{3} \right) = \frac{760\pi}{3}$
Evaluate the Denominator (Total Volume): $\int_{0}^{4} \pi\frac{y}{2} \, dy = \pi \left[ \frac{y^2}{4} \right]_{0}^{4} = \pi \left( \frac{16}{4} \right) = 4\pi$
Final Result: $T_{avg} = \frac{\frac{760\pi}{3}}{4\pi} = \frac{760}{12} = \frac{190}{3} \approx 63.3^\circ\text{C}$
The Setup: A different cauldron is formed by revolving the line $y = x + 1$ around the y-axis between $y = 1$ and $y = 4$. This creates a cone shape (a frustum). The temperature drops linearly from $87^\circ\text{C}$ at the bottom ($y = 1$) to $23^\circ\text{C}$ at the top ($y = 4$) (Figure 2).

First, we need the formula for the linear temperature function.
Using the point-slope form with $(1, 87)$ and $(4, 23)$:
$\star$ Slope: $m = \frac{23 - 87}{4 - 1} = \frac{-64}{3}$
$\star$ Equation: $T(y) - 87 = \frac{-64}{3}(y - 1) \implies T(y) = 87 - \frac{64}{3}(y - 1)$
We will leave the temperature equation in this unexpanded form because it makes the integral much easier to solve.
Find the Area of a Slice:
Solving $y = x + 1$ for $x$ gives a radius of $x = y - 1$.
The disk area is $A(y) = \pi(y - 1)^2$.
Set Up the Weighted Average:
$T_{avg} = \frac{\int_{1}^{4} \left[ 87 - \frac{64}{3}(y - 1) \right] \pi(y - 1)^2 \, dy}{\int_{1}^{4} \pi(y - 1)^2 \, dy}$
The Trick (U-Substitution):
Instead of expanding those massive polynomials, let’s use $u$-substitution.
Let $u = y - 1$. Then $du = dy$.
The bounds also shift: when $y = 1$, $u = 0$; when $y = 4$, $u = 3$.
Our new integral for the numerator becomes much simpler: $\pi \int_{0}^{3} \left( 87 - \frac{64}{3}u \right) u^2 \, du = \pi \int_{0}^{3} \left( 87u^2 - \frac{64}{3}u^3 \right) \, du$
Evaluate the Numerator:
$\pi \left[ 29u^3 - \frac{16}{3}u^4 \right]_{0}^{3}$
At $u = 3$: $\pi \left( 29(27) - \frac{16}{3}(81) \right) = \pi (783 - 16(27)) = \pi (783 - 432) = 351\pi$
Evaluate the Denominator:
Apply the same $u = y - 1$ substitution: $\int_{1}^{4} \pi(y - 1)^2 \, dy = \pi \int_{0}^{3} u^2 \, du = \pi \left[ \frac{u^3}{3} \right]_{0}^{3} = \pi \left( \frac{27}{3} \right) = 9\pi$
Final Result: $T_{avg} = \frac{351\pi}{9\pi} = 39^\circ\text{C}$
By using $u$-substitution, you arrive at exactly the same $39^\circ\text{C}$ result while skipping the heavy algebra of expanding $(y-1)^2$ and multiplying it by $\frac{325 - 64y}{3}$.