Left and Right Sum Calculator

Left and right Riemann sums side by side, their average and the bracket on the integral.

  1. Enter valuesUse your own inputs or an example
  2. CalculateApply your selected settings
  3. View resultExplore the answer and explanation

Enter the function, interval and n

Enter your values below to get started.

Examples:
f(x) =
Use x as the variable: x^2, 1/x, e^x, sqrt(x), cos(x).
1 to 10,000.
Smallest n with |Rₙ − Lₙ| ≤ this value (monotonic f).
Reset restores the default values.

Tips for this calculator

For an increasing f, Ln is a lower bound and Rn an upper bound.

For a decreasing f, the 2 roles swap.

(Ln + Rn) / 2 equals the trapezoidal sum Tn.

Bounds accept pi, e and fractions like 1/2.

A left and right sum calculator computes the left Riemann sum Ln and the right Riemann sum Rn of f(x) on [a, b] at the same time. Enter the function, the limits and n to see both sums side by side, their average, the gap Rn − Ln = (f(b) − f(a))Δx, and, for an increasing or decreasing f, a guaranteed lower and upper bound on the integral.

What are Left and Right Sums?

Left and right sums are 2 Riemann sums that estimate the area under f(x) with n rectangles whose heights come from the left endpoint (Ln) or the right endpoint (Rn) of each subinterval. Both use the same width Δx = (b − a) / n.

Ln=Δx∑i=0n−1f(xi),Rn=Δx∑i=1nf(xi)L_n = \Delta x\sum_{i=0}^{n-1} f(x_i), \qquad R_n = \Delta x\sum_{i=1}^{n} f(x_i)

For f(x) = x² on [0, 2] with n = 4, L4 = 1.75 and R4 = 3.75. The exact area 8/3 ≈ 2.6667 lies between them, since x² is increasing on [0, 2].

InteractiveLeft and right rectangles on the same curve

How Does the Left and Right Sum Calculator Work?

The left and right sum calculator evaluates f at the n + 1 grid points once, adds the first n values for Ln and the last n values for Rn, and multiplies each total by Δx. The 2 sums share n − 1 values, so they differ only by the end terms: Rn − Ln = (f(b) − f(a))Δx.

The calculator then samples f at 2,000 points to test whether f is increasing or decreasing on [a, b]. When f is monotonic, the result card reports the bracket min(Ln, Rn) ≤ ∫ f dx ≤ max(Ln, Rn).

InteractiveRₙ − Lₙ stacks into one column of height f(b) − f(a)
  1. Find Δx

    Δx = (b − a) / n; for [0, 2] and n = 4, Δx = 0.5.

  2. Evaluate n + 1 points

    f(0) = 0, f(0.5) = 0.25, f(1) = 1, f(1.5) = 2.25, f(2) = 4.

  3. Add 2 overlapping lists

    Left: 0 + 0.25 + 1 + 2.25 = 3.5. Right: 0.25 + 1 + 2.25 + 4 = 7.5.

  4. Multiply by Δx

    L4 = 1.75, R4 = 3.75, gap = (4 − 0) × 0.5 = 2.

Left and Right Sum Formulas

The left sum formula is Ln = Δx Σ f(a + iΔx) for i = 0 to n − 1, and the right sum formula is Rn = Δx Σ f(a + iΔx) for i = 1 to n. Only the index range changes.

Left Riemann Sum Formula

Ln=Δx[f(x0)+f(x1)+⋯+f(xn−1)]L_n = \Delta x\left[f(x_0) + f(x_1) + \cdots + f(x_{n-1})\right]

Right Riemann Sum Formula

Rn=Δx[f(x1)+f(x2)+⋯+f(xn)]R_n = \Delta x\left[f(x_1) + f(x_2) + \cdots + f(x_n)\right]

Difference and Average

Rn−Ln=(f(b)−f(a))Δx,Ln+Rn2=TnR_n - L_n = \left(f(b) - f(a)\right)\Delta x, \qquad \frac{L_n + R_n}{2} = T_n

The average of the 2 sums is the trapezoidal sum Tn. For x² on [0, 2] with n = 4, (1.75 + 3.75) / 2 = 2.75.

InteractiveWhich f(xᵢ) values each sum uses

Left and Right Sums on 4 Types of Functions

The order of Ln, Rn and the integral depends on the shape of f: there are 4 cases, namely increasing, decreasing, constant and not monotonic.

InteractiveWhere the integral falls between Lₙ and Rₙ

Increasing f

Ln ≤ ∫ ≤ Rn. Example: x² on [0, 2] gives 1.75 ≤ 2.6667 ≤ 3.75.

Decreasing f

Rn ≤ ∫ ≤ Ln. Example: 1/x on [1, 3] gives 0.95 ≤ 1.0986 ≤ 1.2833.

Constant f

Ln = Rn = ∫ for every n, since each rectangle matches the graph.

Not Monotonic f

No guaranteed order. For 2x − x² on [0, 2], L4 = R4 = 1.25 while the integral is 4/3.

How to Calculate Left and Right Sums by Hand

To calculate left and right sums by hand, find Δx, evaluate f at all n + 1 grid points, add the first n values for the left sum and the last n values for the right sum, and multiply both totals by Δx. Here is f(x) = 1/x on [1, 3] with n = 4.

  1. Δx = (3 − 1) / 4 = 0.5.
  2. Values at 1, 1.5, 2, 2.5, 3: 1, 0.6667, 0.5, 0.4, 0.3333.
  3. Left total: 1 + 0.6667 + 0.5 + 0.4 = 2.5667 → L4 = 1.2833.
  4. Right total: 0.6667 + 0.5 + 0.4 + 0.3333 = 1.9 → R4 = 0.95.
  5. 1/x decreases, so 0.95 ≤ ln 3 ≈ 1.0986 ≤ 1.2833.
InteractiveStep through left and right sums

    Left and Right Sums as Upper and Lower Bounds

    For a monotonic function, the left and right sums are a guaranteed lower and upper bound on the integral, and the bracket narrows to 0 as n grows. The width of the bracket is exactly |f(b) − f(a)|(b − a) / n.

    min⁡(Ln,Rn)≤∫abf(x) dx≤max⁡(Ln,Rn)\min(L_n, R_n) \le \int_a^b f(x)\,dx \le \max(L_n, R_n)

    For x² on [0, 2], the bracket is 1.75 to 3.75 at n = 4 (width 2) and 2.6268 to 2.7068 at n = 100 (width 0.08). Augustin-Louis Cauchy defined the integral as the limit of left-endpoint sums in 1823.

    InteractiveLₙ and Rₙ squeeze the integral

    How Many Subintervals Do Left and Right Sums Need?

    To make the bracket from left and right sums no wider than ε, use n ≥ |f(b) − f(a)|(b − a) / ε. The error falls in proportion to 1/n, so 10× more rectangles give 10× less error.

    ∣Rn−Ln∣=∣f(b)−f(a)∣ (b−a)n≤ε  ⟺  n≥∣f(b)−f(a)∣ (b−a)ε|R_n - L_n| = \frac{|f(b) - f(a)|\,(b-a)}{n} \le \varepsilon \iff n \ge \frac{|f(b) - f(a)|\,(b-a)}{\varepsilon}

    For x² on [0, 2] and ε = 0.01: n ≥ 4 × 2 / 0.01 = 800. The trapezoidal average of the same 2 sums reaches that accuracy with far fewer rectangles.

    InteractivePick a target width and get n

    Common Mistakes with Left and Right Sums

    • Swapping the index ranges: the left sum stops at xn−1; the right sum starts at x1.
    • Calling Ln a lower bound for every f: the left sum is a lower bound only when f is increasing.
    • Forgetting Δx: the sum of heights must be multiplied by the width.
    • Using bounds on a non-monotonic f: a curve that rises and falls breaks the bracket.
    • Adding n + 1 values: each sum has exactly n terms.
    InteractiveTrue or false: left and right sums
    1. For a decreasing function, the right sum overestimates the integral.

    2. Rₙ − Lₙ = (f(b) − f(a))Δx for equal subintervals.

    3. The average of Lₙ and Rₙ is the midpoint sum.

    4. For a constant function, Lₙ = Rₙ.

    5. Doubling n halves the bracket width for a monotonic f.

    Score: 0 / 5

    How to Use the Left and Right Sum Calculator

    Type f(x), enter a, b and n, add a target bracket width if you need one, and press Calculate. The result card shows Ln and Rn, their average, their gap and the bracket; the tabs show the steps, both sets of rectangles and a row-by-row table.

    InteractiveLoad a left and right sum problem

    Each button fills the calculator and runs it.

    1. Enter f(x)

      Use x as the variable, for example e^(-x).

    2. Set a, b and n

      n is the number of rectangles in each sum (1 to 10,000).

    3. Add a width

      Optional: type 0.01 to get the n that makes |Rn − Ln| ≤ 0.01.

    4. Compare

      The Graph tab draws left rectangles in purple and right rectangles in orange.

    Real-Life Uses of Left and Right Sums

    Left and right sums give a guaranteed range for a total when a rate only rises or only falls between readings. 4 common uses:

    • Distance bounds: a car that only speeds up has traveled between the left and right sums of its speed log, in meters or feet.
    • Reservoir levels: a falling inflow rate gives a minimum and maximum volume in m³ (or acre-feet).
    • AP Calculus: College Board free-response questions ask whether Ln or Rn overestimates from a table of increasing data.
    • Cooling and heating: a decreasing heat-loss rate in watts (W) brackets total energy lost in joules (J).
    InteractiveBracket a car's distance from its speed readings

    Left and Right Sum Examples

    Left sums, right sums and the exact integral for common functions.

    Left and Right Sum Examples
    IntegralnLₙRₙExactCalculator
    ∫02x2 dx\int_0^2 x^2\,dx41.753.752.6667
    ∫131x dx\int_1^3 \frac{1}{x}\,dx41.28330.951.0986
    ∫01ex dx\int_0^1 e^x\,dx41.51241.9421.7183
    ∫04x dx\int_0^4 \sqrt{x}\,dx44.14636.14635.3333
    ∫02x3 dx\int_0^2 x^3\,dx42.256.254
    ∫02e−x dx\int_0^2 e^{-x}\,dx41.09880.66640.8647

    Popular Left and Right Sum Problems

    Find both sums, then reveal the answer or solve it in the calculator.

    1. Left and right sums of f(x) = x² + 1 on [0, 3] with n = 3.

      L_3,\ R_3,\ f(x)=x^2+1
      Show answerL_3 = 8,\ R_3 = 17
    2. Left and right sums of f(x) = 2x on [1, 5] with n = 4. What is their average?

      L_4,\ R_4,\ f(x)=2x
      Show answerL_4 = 20,\ R_4 = 28,\ \text{average } 24
    3. Left and right sums of f(x) = 9 − x² on [0, 3] with n = 6. Which one is the upper bound?

      L_6,\ R_6,\ f(x)=9-x^2
      Show answerL_6 = 20.125\ (\text{upper}),\ R_6 = 15.625
    4. Left and right sums of f(x) = cos x on [0, π/2] with n = 3.

      L_3,\ R_3,\ f(x)=\cos x
      Show answerL_3 \approx 1.2388,\ R_3 \approx 0.7152
    5. Smallest n so that left and right sums of x² on [0, 2] differ by at most 0.01.

      |R_n - L_n| \le 0.01
      Show answern = 800
    6. Left and right sums of f(x) = ln x on [1, 2] with n = 5.

      L_5,\ R_5,\ f(x)=\ln x
      Show answerL_5 \approx 0.3153,\ R_5 \approx 0.4539

    Explore More Sum Calculators

    Discover 67 free sum calculators across different categories. Find the right calculator for your needs.

    Browse All 67 Calculators
    Questions and answers

    Frequently Asked Questions

    What is a left and right sum calculator?

    A left and right sum calculator is an online tool that computes the left Riemann sum Lₙ and the right Riemann sum Rₙ of f(x) on [a, b] together, with their average, their difference and a bracket on the definite integral.

    What is the difference between a left and a right Riemann sum?

    A left sum takes each rectangle's height at the left endpoint xᵢ₋₁; a right sum takes the height at the right endpoint xᵢ. The 2 sums differ by (f(b) − f(a))Δx.

    When is the left sum an underestimate?

    The left sum underestimates the integral when f is increasing on [a, b], since every rectangle uses the lowest value on its subinterval.

    Is the average of the left and right sums the trapezoidal sum?

    Yes, (Lₙ + Rₙ) / 2 = Tₙ for equal subintervals. For x² on [0, 2] with n = 4, (1.75 + 3.75) / 2 = 2.75.

    Do left and right sums always bracket the integral?

    No, left and right sums bracket the integral only when f is monotonic on [a, b]. For 2x − x² on [0, 2] with n = 4, both sums equal 1.25 while the integral is 4/3.

    How do I find n so the left and right sums are within ε?

    Use n ≥ |f(b) − f(a)|(b − a) / ε. For x² on [0, 2] and ε = 0.01, n = 800.

    Can a right sum be smaller than a left sum?

    Yes, the right sum is smaller whenever f(b) < f(a), for example on any decreasing function such as 1/x on [1, 3], where R₄ = 0.95 and L₄ = 1.2833.

    How fast do left and right sums converge?

    The error of a left or right sum shrinks in proportion to 1/n, so doubling n roughly halves the error. Midpoint and trapezoidal sums shrink with 1/n².

    Conclusion

    Left and right sums use the 2 endpoints of every subinterval, and the left and right sum calculator returns both at once, with their average, their gap (f(b) − f(a))Δx and a guaranteed bracket for monotonic functions. Check whether f is increasing or decreasing before calling either sum a bound, and use n ≥ |f(b) − f(a)|(b − a) / ε to size the bracket.

    Not sure which sum answers your question? Use the decision tree below.

    InteractiveWhich sum answers your question?