Skip to main content
CalcChef

Integral Calculator

Enter f(x) and the limits a and b to get the definite integral as a number, by Simpson's rule with 1,000 intervals. Net signed area, no antiderivative. How it works

Use the Integral Calculator

Functions include sin, cos, tan, exp, log (natural log), log10, sqrt and abs, with pi and e. Angles are in radians.

A number, or pi/2, e, 1/3

A number, or pi, 2*pi, 1/3

Definite integral
≈ 0.333333

∫ f(x) dx from 0 to 1, by Simpson's rule with 1,000 intervals

-0.151.151.4-0.11
Shaded: the signed area, positive above the x axis (blue) and negative below it (red).
Show the Simpson's rule working
  1. Step width: h = (b − a) ÷ 1,000 = (1 − 0) ÷ 1,000 = 0.001
  2. Ends: f(a) + f(b) = 0 + 1
  3. Odd samples (weight 4): sum of f = 166.667, times 4 = 666.666
  4. Even interior samples (weight 2): sum of f = 166.167, times 2 = 332.334
  5. Total = 1000; result = h ÷ 3 × total = 0.000333333 × 1000 ≈ 0.333333
ixf(x)WeightWeight × f(x)
00010
10.0010.00000140.000004
20.0020.00000420.000008
30.0030.00000940.000036
40.0040.00001620.000032
50.0050.00002540.0001
… 991 more samples …
9970.9970.99400943.97604
9980.9980.99600421.99201
9990.9990.99800143.992
10001111

About the Integral Calculator

The definite integral of x² from 0 to 1 is 1/3, which the integral calculator shows as 0.333333. Enter f(x) and the limits a and b, and it sums 1,000 intervals by Simpson’s rule and prints the result to six decimals. The answer is a number, the net signed area between the curve and the x-axis, not an antiderivative. The limits can be constants such as pi or 1/3, and a graph shades the area.

Integrals the calculator returns

f(x) as typedFrom aTo bTool showsExact value
x^2010.3333331/3
x^30244
2x+1031212
x^2-403-3-3
sin(x)03.1415922
e^x011.718282e − 1
log(x)120.3862942 ln 2 − 1
4/(1+x^2)013.141593π
exp(-x^2)-331.772415about √π
sqrt(x)010.6666642/3

log is the natural log here. sqrt(x) comes out slightly low because its slope is infinite at 0, where Simpson’s rule is least accurate.

How to use this tool

  1. Type the function of x, for example x^2 or sin(x). Use ^ for powers; 2x is read as 2*x.
  2. Enter the lower limit a and the upper limit b as numbers or constants such as pi, pi/2, e or 1/3. The result follows each edit.
  3. Read the value under Definite Integral. If a message says the integral could not be evaluated, f has no finite value somewhere between the limits. Below the result the graph shades the area, and Show the Simpson’s rule working lists the samples and sums.

Frequently asked questions

How accurate is the integral?
Simpson’s rule is exact for polynomials up to degree three, so 2x+1 from 0 to 3 gives exactly 12. For other smooth functions over a short range it is right to the six decimals shown, as 4/(1+x^2) from 0 to 1 = 3.141593 is. It drifts when the interval holds many waves: sin(x) from 0 to 1000 returns 0.440375 against the exact 0.437621.
Does it give the antiderivative?
No. It returns the definite integral between two limits as a number. To check an antiderivative F you found by hand, compare F(b) − F(a) with the result: for x^3 from 0 to 2, x⁴/4 gives 4 − 0 = 4, the same as the tool.
Why is my integral negative?
Area below the x-axis counts as negative, so x^2-4 from 0 to 3 gives -3, the net of the parts below and above the axis. Swapping the limits also flips the sign: x^3 from 2 to 0 gives -4.
Why does no result appear?
The tool samples f at 1,001 points and shows a message instead of a result if any of them has no finite value. 1/x from 0 to 1 is one case, and so is 1/x from -1 to 1, which passes through 0. Improper integrals and infinite limits are not handled; start just past the problem point, or split the range.
Is log the natural log, and are angles in radians?
Yes to both. log(x) from 1 to 2 gives 0.386294, which is 2 ln 2 − 1; use log10 for base 10. sin(x) from 0 to 3.14159 gives 2 because the limits are read in radians; type pi as the upper limit for π itself.

Related Tools

View all tools