gizmobench
BrowseDaily

Average Rate of Change Calculator

Choose Function and enter an expression, its variable and two interval endpoints, or choose Two points and enter the two coordinate pairs. The calculator shows the substituted rise-over-run quotient and draws the secant. Function mode also compares it with estimated endpoint derivatives. For x² from 1 to 3, the net change is 8 and the average rate is 4.

Average rate of change4f(x) = x^2 · from a = 1 to b = 3 · (9 - 1) / (3 - 1)
Given

Type f(x), then the two endpoints. Endpoints may be expressions too, so pi/2 and 1+1 are both fine.

f(a)
1
f(b)
9
Slope
4
Interval
1 to 3
  1. f(1) = 1^2 = 1
  2. f(3) = 3^2 = 9
  3. (f(3) - f(1)) / (3 - 1) = (9 - 1) / (3 - 1) = 8 / 2 = 4

The secant slope is 4. The derivative, estimated by a central difference, is 2 at a (climbing) and 6 at b (climbing). The average is 2 above the rate at a and 2 below the rate at b, which is the whole difference between a secant and a tangent. Between them the derivative passes through 4: the first point found is x = 2, where the dashed tangent on the plot runs parallel to the secant.

(1, 1)(3, 9)0.763.2411.96-1.96

The solid line is the secant through (1, 1) and (3, 9): its slope, 4, is the average rate of change. The curve is the function itself, sampled across the interval and a little beyond it. The dashed line is the tangent at x = 2, the point found inside the interval where the derivative equals that average.

The quotient is exact arithmetic on the two endpoint values. The derivative figures beside it are numerical estimates from a central difference of about one part in a million, checked against a quarter step and dropped where the two disagree. sin, cos and tan read the variable in radians, so a full turn is 2pi.

Three cases, worked

One secant, the same secant with its bounds swapped, and one that comes out at 0 while the curve climbs and then falls. Every line below is computed by the code that answers the calculator above, so the examples and the tool can never disagree.

  • x² from 1 to 3secant slope
    4
  • Bounds reversed, 3 to 1the same two points
    4, unchanged
  • sin(x) from 0 to πboth endpoints are 0
    0, though it climbs then falls
Accuracy. Exact arithmetic on the two endpoint values, with the substitution written out step by step. This is the slope of the secant line between two points, which is an average across the interval and not the derivative at either end: the sin case above returns 0 for a function that is climbing at one end and falling at the other, and the page says so on screen rather than letting the number stand alone.

Common questions

How do you find the average rate of change of a function?
Evaluate the function at both endpoints, subtract, and divide by the run: (f(b) - f(a)) / (b - a). For f(x) = x^2 from 1 to 3 that is f(1) = 1, f(3) = 9, and (9 - 1) / (3 - 1) = 8 / 2 = 4. The page prints those three lines with your own figures in them, so a number typed into the wrong field is easy to spot.
Is the average rate of change the same as the slope?
It is the slope of one particular line: the secant through (a, f(a)) and (b, f(b)). That is why the two-point mode exists here. Give it (1, 1) and (3, 9) and it returns 4, the same answer the function mode gives for x^2 on that interval, because the quotient is the same rise over run either way.
What is the difference between average and instantaneous rate of change?
The average is one number for the whole interval; the instantaneous rate is the derivative at a single point. For x^2 from 1 to 3 the average is 4, while the derivative is about 2 at x = 1 and about 6 at x = 3. Those two figures are printed beside the answer, along with the point inside the interval where the derivative equals the average, x = 2 here, which is the point the dashed tangent touches. The derivative figures are numerical estimates from a central difference and are labelled as estimates; the quotient itself is exact arithmetic.
Can the average rate of change be zero when the function is not flat?
Yes, and that is the case the page is built around. sin(x) from 0 to pi returns 0 because both endpoint values are 0, while the curve climbs to 1 and comes back down: the estimated derivative is 1 at one end and -1 at the other. A bare 0 would suggest nothing happened, so the page writes that sentence under the number rather than leaving it to be misread.
Does it matter which endpoint I call a and which I call b?
No. Reversing them negates the rise and the run together, so both cancel: x^2 from 3 to 1 is still 4. The tool shows the substitution in the order you typed it, so you can see (1 - 9) / (1 - 3) = -8 / -2 = 4 and check it by hand.
Can I use pi, a square root or an expression as an endpoint?
Yes. An endpoint is read by the same parser as the function, so pi, pi/2, 1+1 and 2e3 all work, and an endpoint written as a constant is kept as that constant on screen. That matters more than it looks: sin(pi) is 0, while the sine of pi cut to ten significant figures is -4.102069e-10, so the page substitutes pi rather than a rounded version of it.
Why does it refuse when a and b are the same?
Because b - a would be zero and the quotient has no answer. An average rate of change needs an interval rather than a point, and returning an infinity would be a wrong result that looks like a right one. Two points with the same x are refused the same way: the line through them is vertical and has no slope to divide out.
What can I type in the function, and does it run as code?
It never runs as code. A parser written for this page reads the text, so only the names in its own table exist: sin, cos, tan, sec, csc, cot, asin, acos, atan, sinh, cosh, tanh, sqrt, cbrt, abs, exp, ln, log, log2, floor, ceil, round, sign, mod, min, max, plus the constants pi, tau and e. A name that is not on the list comes back as an error with the list attached. Implicit multiplication is understood, so 2x and 3sin(x) are fine, and the variable does not have to be x: 16t^2 from t = 1 to t = 3 returns 64.
Does it work in degrees as well as radians?
Yes, and the setting is named beside the result so an answer can never be read under the wrong convention. In radians sin(x) from 0 to 1 is 0.8414709848; in degrees sin(x) from 0 to 90 is 0.01111111111, which is 1 divided by 90. The angle setting only affects the trigonometric functions.
What if the function has a pole or a gap inside the interval?
The quotient still runs, because it only needs the two endpoint values, and the page says what it found. 1/x from -2 to 2 returns 0.25 with a note that the sampled values flip from -63.5 to 63.5 either side of x = 0, which is how a pole shows up in samples, and that an average across a break does not describe one unbroken curve. An endpoint that is itself outside the domain is refused instead: sqrt(x) starting at -4 says so rather than returning a value that is not a number.
Why does it sometimes refuse to estimate the derivative?
Because there is nothing honest to print. At a corner the slope from the left and the slope from the right disagree, so abs(x) from -1 to 1 returns an average of 0 and no tangent point, while the derivative at the two ends is still reported as -1 and 1. Where a tangent is vertical the estimate will not settle and is dropped with the reason given, which is what happens at x = 0 for sqrt(x). The average rate of change itself is unaffected either way, because it only ever needed the two endpoint values.
How precise are the figures, and is anything I type stored or sent?
The arithmetic is ordinary double precision. Values are shown to ten significant figures, estimated derivatives to eight, and the distance between an exact figure and an estimated one to six, because subtracting two nearly equal numbers costs digits. A value smaller than 1e-12 of the largest value on the interval is reported as 0 with the raw figure named in a note, which is how sin(pi) reads as 0 rather than as 1.224647e-16, and a difference that is only cancellation noise is refused instead of divided. Everything happens in this browser: the last set you typed is remembered locally so the page opens where you left it, and if storage is blocked the calculator still works, it simply forgets.
Can I calculate from a table or an existing graph?
The inputs are a function or two individual points. The page draws a graph from those inputs, but it does not read a pasted table, uploaded graph, graph image or plotted-point selection. Its graph is an output, not a way to import endpoint values.
Where is the net change, and can I use years as the interval?
The subtraction in the final working line is the net change f(b) - f(a); dividing it by b - a gives the average rate. For x² from 1 to 3, that line shows 8 / 2 = 4. Years can be the x values of supplied points, giving an absolute change per year in the y units. This is not a compound annual percentage growth rate. A polar expression can be entered with a variable for its radius function, but the tool does not plot polar coordinates or calculate change between Cartesian polar-curve points.
What do the square-root and exponential examples return?
sqrt(x) from 1 to 9 has an average rate of 0.25. exp(x), equivalently e^x, from 0 to 1 gives 1.718281828. Enter each function and its endpoints to see the endpoint values, substituted quotient and secant graph.

Exact arithmetic on the two endpoint values, with the substitution written out step by step. This is the slope of the secant line between two points, which is an average across the interval and not the derivative at either end: the sin case above returns 0 for a function that is climbing at one end and falling at the other, and the page says so on screen rather than letting the number stand alone.