Integral Calculator

The definite integral of a function f(x) from a to b gives the signed area under the curve. The integral of x^2 from 0 to 1 equals 1/3. The integral of sin(x) from 0 to pi equals 2. This calculator uses composite Simpson's rule with 1,000 subdivisions for high-accuracy numerical results. Enter a function and bounds below.

Quick Answer

The integral of x^2 from 0 to 1 is 1/3 (approximately 0.333333). The integral of sin(x) from 0 to pi is 2.

Use * for multiplication. Examples: x^2, sin(x), exp(x), log(x), sqrt(x), 1/x

Common Examples

Input Result
x^2 from 0 to 1 0.333333 (= 1/3)
sin(x) from 0 to pi 2
x from 0 to 10 50
e^x from 0 to 1 1.718282 (= e - 1)
1/x from 1 to e 1 (= ln(e))

How It Works

Definition

The definite integral of f(x) from a to b represents the signed area between the function and the x-axis:

\[\int_a^b f(x)\, dx\]

Simpson’s rule

This calculator uses composite Simpson’s rule for numerical approximation:

\[\int_a^b f(x)\, dx \approx \frac{h}{3}\left[f(x_0) + 4f(x_1) + 2f(x_2) + 4f(x_3) + \cdots + f(x_n)\right]\]

Where \(h = (b - a)/n\) and n is the number of subdivisions (1,000 by default). Simpson’s rule is exact for polynomials up to degree 3 and provides very accurate results for smooth functions.

Common antiderivatives

Function Antiderivative    
\(x^n\) \(\frac{x^{n+1}}{n+1} + C\)    
\(1/x\) $$\ln x + C$$
\(e^x\) \(e^x + C\)    
\(\sin(x)\) \(-\cos(x) + C\)    
\(\cos(x)\) \(\sin(x) + C\)    

Worked example

For the integral of x^2 from 0 to 1: The antiderivative of x^2 is x^3/3. Evaluating at the bounds: (1^3/3) - (0^3/3) = 1/3 - 0 = 1/3 = 0.333333. Simpson’s rule with 1,000 subdivisions produces the same result to 6+ decimal places.

Related Calculators

Frequently Asked Questions

What is a definite integral?
A definite integral calculates the signed area between a function and the x-axis over a specific interval [a, b]. Positive values indicate area above the x-axis, and negative values indicate area below. The result is a single number, unlike an indefinite integral which produces a function.
How accurate is Simpson's rule?
Simpson's rule with 1,000 subdivisions produces results accurate to 6 or more decimal places for most smooth functions. The error decreases rapidly with more subdivisions (proportional to h^4). It is exact for polynomials of degree 3 or less.
What functions can I integrate?
This calculator supports polynomials, trigonometric functions (sin, cos, tan), exponential functions (exp), logarithms (log for natural log), square roots (sqrt), and combinations using arithmetic operations. The function must be defined and finite throughout the integration interval.
What if the function is undefined at a bound?
If the function has a singularity (like 1/x at x = 0), the numerical method may produce inaccurate or infinite results. For improper integrals with singularities, try adjusting the bounds slightly away from the problem point (e.g., integrate 1/sqrt(x) from 0.0001 to 1 instead of 0 to 1).
Can this calculator find antiderivatives?
This calculator computes definite integrals (specific numeric values) rather than symbolic antiderivatives (general formulas). A reference table of common antiderivatives is provided in the results. For symbolic integration, a computer algebra system is needed.