∫₀¹ e^(−x²) dx
- Function f(x)
- exp(-x^2)
- Lower limit a
- 0
- Upper limit b
- 1
- Integral
- 0.746824132812
Checked against: Independent calculation
The definite integral of any function f(x) between two limits, by adaptive Gauss–Kronrod quadrature to about 20 significant digits, with the area shaded.
By AdminDrafted with AI writing toolsUpdated Checked examples: 7
The signed integral of f(x) from 0 to 1 is 0.7468241328. Area below the x-axis counts as negative. It took 45 evaluations over 2 subintervals.
| From | To | Contribution | Error estimate |
|---|---|---|---|
| 0 | 0.5 | 0.4613 | 3.2 × 10⁻²² |
| 0.5 | 1 | 0.2855 | 8 × 10⁻²² |
The 7 Gauss nodes are reused by the 15-point rule, so the error estimate costs no extra evaluations; ρ is ∫|f − mean| over the piece (QUADPACK's scaling). Nodes and weights are carried to 52 digits.
Repeatedly split the subinterval with the largest error estimate: 2 subintervals, 45 evaluations of f. The total estimated error met the tolerance.
A definite integral ∫ₐᵇ f(x) dx is the signed area between f and the x-axis from a to b, with area below the axis counted as negative. The calculator uses the 15-point Gauss–Kronrod rule from QUADPACK (routine QK15), which samples f at 15 points on each piece and compares the result with the embedded 7-point Gauss rule to estimate its own error. The piece with the largest error is split in two until the total estimated error falls below 10⁻²⁰ of the answer.
It suits integrals with no convenient antiderivative, such as the bell curve e^(−x²), and checking answers found by hand. The default, ∫₀¹ e^(−x²) dx, equals (√π/2)·erf(1) ≈ 0.7468241328 and took 45 evaluations of f over 2 subintervals.
Trig functions use radians, and limits accept expressions such as pi/2. Integrable endpoint singularities, like √x or ln x at 0, are handled because Gauss–Kronrod nodes never touch the endpoints. Swapping the limits flips the sign.
Find an antiderivative F with F′ = f, then subtract its values at the two limits: ∫ₐᵇ f(x)dx = F(b)−F(a). For f(x) = 2x, F(x) = x², so the integral from 10 to 13 is 13²−10² = 69. The result is the signed area between the curve and the x-axis.
When no antiderivative is convenient, as for e^(−x²), the integral is found numerically to about 20 significant digits: ∫₀¹ e^(−x²) dx ≈ 0.746824132812.
An indefinite integral is a family of antiderivatives, written F(x)+C. A definite integral is a single number, because C cancels in F(b)−F(a). The fundamental theorem of calculus links the two when f is continuous on the interval.
The antiderivative of x is x²/2+C, and that of 1 is x+C; integrating 0 gives just C. For n ≠ −1, xⁿ integrates to xⁿ⁺¹/(n+1)+C. The exception, 1/x, integrates to ln|x|+C on intervals that do not cross zero.
Each antiderivative includes C and holds on intervals where both f and F are defined. tan(x) and sec(x) cannot be integrated across the points where cos(x) = 0.
| Input f(x) | Antiderivative F(x)+C | Interval restriction |
|---|---|---|
| 0 | C | All finite real intervals |
| 1 | x+C | All finite real intervals |
| x | x²/2+C | All finite real intervals |
| 2*x | x²+C | All finite real intervals |
| x^2 | x³/3+C | All finite real intervals |
| x-2 | x²/2−2x+C | All finite real intervals |
| sin(x) | −cos(x)+C | All real x; radians |
| cos(x) | sin(x)+C | All real x; radians |
| sin(2*x) | −cos(2x)/2+C | All real x; radians |
| cos(2*x) | sin(2x)/2+C | All real x; radians |
| tan(x) | −ln(abs(cos(x)))+C | Do not cross cos(x)=0 |
| cot(x) | ln(abs(sin(x)))+C | Do not cross sin(x)=0 |
| cot(3*x) | ln(abs(sin(3x)))/3+C | Do not cross sin(3x)=0 |
| sec(x) | ln(abs(sec(x)+tan(x)))+C | Do not cross cos(x)=0 |
| sin(x)*cos(x) | sin²(x)/2+C | All real x; radians |
| x*sin(x) | −x cos(x)+sin(x)+C | All real x; radians |
| x*cos(x) | x sin(x)+cos(x)+C | All real x; radians |
| x*ln(x) | (x²/2)ln(x)−x²/4+C | x > 0 |
| exp(2*x) | e^(2x)/2+C | All finite real intervals |
| exp(-2*x) | −e^(−2x)/2+C | All finite real intervals |
| 1/x | ln(abs(x))+C | Do not cross zero |
The chain rule explains the factors: differentiating −cos(2x)/2 gives sin(2x), because the inner 2 cancels the 1/2. Integration by parts gives the rows for x sin x, x cos x and x ln x.
sin x cos x integrates to sin²x/2+C, or equally to −cos²x/2+C, since the two differ by a constant. The OpenStax integration formulas lesson covers the standard forms.
Area below the x-axis counts as negative. Integrating x from −1 to 1 gives 0, although each triangle has area 1/2; abs(x) over the same interval gives the total area, 1.
| Input f(x) | a | b | Integral |
|---|---|---|---|
| 0 | 0 | 1 | 0 |
| 1 | 0 | 1 | 1 |
| cos(x) | 0 | 1 | 0.841470985 |
| sin(x)*cos(x) | 0 | 1 | 0.354036709 |
| cot(3*x) | 0.2 | 0.4 | 0.16706067 |
| cot(x) | 0.5 | 1 | 0.56256294 |
| exp(2*x) | 0 | 1 | 3.194528049 |
| exp(-2*x) | 0 | 1 | 0.432332358 |
| 2*x | 10 | 13 | 69 |
| 2*x | 0 | 1 | 1 |
| cos(2*x) | 0 | 1 | 0.454648713 |
| sin(2*x) | 0 | 1 | 0.708073418 |
| x^2 | 0 | 1 | 0.333333333 |
| x-2 | 0 | 1 | -1.5 |
| x | 0 | 1 | 0.5 |
| sec(x) | 0 | 0.5 | 0.522238103 |
| tan(x) | 0 | 0.5 | 0.13058424 |
| x*ln(x) | 1 | 2 | 0.636294361 |
| x*sin(x) | 0 | 1 | 0.301168679 |
| sin(x) | 0 | 1 | 0.459697694 |
| x*cos(x) | 0 | 1 | 0.381773291 |
| sin(x) | 0 | pi | 2 |
| sin(x) | 0 | 2*pi | 0 |
| x^2 | 1 | 0 | -0.333333333 |
| x | -1 | 1 | 0 |
| abs(x) | -1 | 1 | 1 |
| 1/x | 1 | 2 | 0.693147181 |
| sqrt(x) | 0 | 1 | 0.666666667 |
| ln(x) | 0 | 1 | -1 |
| exp(-x^2) | 0 | 1 | 0.746824133 |
| x^2 | 2 | 2 | 0 |
Swapping the limits reverses the sign, and equal limits give 0. The sine integral from 0 to π is 2, while from 0 to 2π its positive and negative arches cancel to 0.
x^2, x-2 or 2*x, whose integrals from 0 to 1 are 1/3, −3/2 and 1.exp(2*x) integrates to e^(2x)/2+C, and exp(-2*x) to −e^(−2x)/2+C.The method is adaptive Gauss–Kronrod quadrature with QUADPACK's 15-point rule (QK15). Each piece of the interval is sampled at 15 points, and the embedded 7-point Gauss rule gives an error estimate without extra evaluations.
The piece with the largest estimated error is split in two until the total estimated error falls below 10⁻²⁰ of the answer, about 20 significant digits. The estimate is usually larger than the true error, but it is not a guaranteed bound.
Sample points never touch the endpoints, so √x and ln x from 0 to 1 give 2/3 and −1. A divergent integral such as 1/x from 0 to 1 ends with a convergence warning instead.
To check an antiderivative, differentiate it at a few points with the numerical derivative calculator and compare with f.
Checked against: Independent calculation
Checked against: −cos π + cos 0 = 2 (antiderivative)
Checked against: Independent calculation
Checked against: Antiderivative eˣ(x⁵ − 5x⁴ + 20x³ − 60x² + 120x − 120) evaluated in exact decimal arithmetic
The signed area between the curve and the x-axis over an interval: area above the axis counts as positive and area below as negative. ∫₀^π sin x dx = 2 because one arch of the sine curve encloses an area of 2, while ∫₀^2π sin x dx = 0 because the second arch lies below the axis and cancels the first. It is also a total change: integrating speed over time gives distance traveled.
Find an antiderivative F with F′ = f, then subtract: ∫ₐᵇ f(x) dx = F(b) − F(a), which is the fundamental theorem of calculus. For ∫₁² 1/x dx, F(x) = ln x, so the answer is ln 2 − ln 1 ≈ 0.693147. When no elementary antiderivative exists, as for e^(−x²), a numerical rule like this one is the practical route.
A rule that estimates an integral from a weighted sum of f at carefully placed points. The 7-point Gauss rule integrates every polynomial up to degree 13 exactly; Kronrod's extension adds 8 more points and reuses the first 7, so comparing the two estimates gives an error estimate without extra evaluations. This estimate is not a rigorous bound for every function. QUADPACK's QK15 routine, used here, pairs it with repeated splitting of the worst subinterval.
It has no antiderivative among elementary functions, so it is written with the error function: ∫₀ˣ e^(−t²) dt = (√π/2) erf(x). From 0 to 1 the value is about 0.7468241328, and over the whole real line it is √π ≈ 1.7724539. This Gaussian integral is what makes the normal distribution's total probability equal 1.
Yes, when more of the area lies below the x-axis than above it, or when the limits run backward. ∫₁² (−x) dx = −1.5, and the integral of x² from 1 down to 0 is −1/3, the negative of ∫₀¹ x² dx = 1/3. For the total area regardless of sign, integrate the absolute value instead: ∫₀^2π |sin x| dx = 4, entered as abs(sin(x)).
This calculator includes 7 worked examples with independently sourced answers. They run in the test suite, and you can run them here too.