跳到主要内容
EverydayTools简单 • 免费 • 快速
家类别
搜索工具...
  1. Home
  2. 数学与统计
  3. Integral Calculator
Advertisement
Loading...
Advertisement
Loading...

Compute antiderivatives and definite integrals with step-by-step solutions

Integration is one of the two fundamental operations of calculus, alongside differentiation. An integral describes the accumulation of quantities — whether you are computing the area under a curve, the total distance traveled from a velocity function, the work done by a varying force, or the probability mass under a density curve. Our free Integral Calculator makes it easy to compute both indefinite integrals (antiderivatives) and definite integrals, displaying step-by-step solutions so you can understand exactly how each result is obtained. An indefinite integral, written as ∫ f(x) dx, yields a family of functions F(x) + C, where F′(x) = f(x) and C is an arbitrary constant of integration. A definite integral, written as ∫[a,b] f(x) dx, produces a single number equal to F(b) − F(a) by the Fundamental Theorem of Calculus. That number represents the net signed area between the graph of f(x) and the x-axis from x = a to x = b — positive where the curve lies above the axis and negative where it lies below. Our calculator supports the most common classes of elementary functions: polynomials and power functions (x^n), exponential functions (e^x and a^x), natural and general logarithms (ln x), trigonometric functions (sin, cos, tan, sec²), and inverse trigonometric forms (arctan, arcsin). For each supported form, the tool identifies the applicable integration rule — constant rule, power rule, log rule, exponential rule, trigonometric rule, or integration by parts — and walks you through every transformation in numbered steps. For definite integrals, the calculator also computes four classical Riemann sum approximations: the Left Riemann Sum, Right Riemann Sum, Midpoint Rule, and Trapezoidal Rule. An adjustable rectangle slider lets you choose between 1 and 150 subdivisions, letting you visually explore convergence: as the rectangle count grows, all four methods approach the exact integral value. The error percentage displayed for each method quantifies the gap between the approximation and the exact result, reinforcing the concept that finer partitions yield greater accuracy. The interactive function graph plots f(x) over the domain of integration and shades the region between the bounds, giving you an immediate geometric interpretation of the definite integral as a signed area. For indefinite integrals, the full curve is plotted over the interval [−5, 5], helping you visualize the behavior of the integrand. A virtual math keyboard provides quick access to common symbols — exponents, square roots, π, e, trigonometric functions, and logarithms — so you can build complex expressions without memorizing syntax. A random example button loads a fresh sample problem, and a session history panel keeps track of your last five calculations for easy recall. The keyboard shortcut Ctrl + Enter triggers calculation from anywhere on the page. Whether you are a student working through a calculus course, a teacher preparing classroom examples, an engineer evaluating an integral for a physics or signal-processing problem, or simply someone who needs a quick numerical answer, this calculator provides accurate results with the educational transparency of step-by-step derivations. No account or subscription is required — all computation runs entirely in your browser.

Understanding Integration

What Is an Integral?

An integral is a mathematical object that represents the area under a curve or the accumulation of a quantity over an interval. There are two main types. An indefinite integral ∫ f(x) dx produces an antiderivative F(x) + C — a function whose derivative is f(x). The constant C acknowledges that infinitely many functions share the same derivative, differing only by a vertical shift. A definite integral ∫[a,b] f(x) dx produces a specific number, computed as F(b) − F(a), that equals the net signed area between the curve and the x-axis from a to b. Regions above the axis contribute positive area; regions below contribute negative area. The two types are connected by the Fundamental Theorem of Calculus, which establishes that differentiation and integration are inverse operations.

How Is an Integral Calculated?

Integration uses a set of rules derived from reversing differentiation. The Power Rule states ∫ xⁿ dx = xⁿ⁺¹/(n+1) + C for any n ≠ −1. The special case n = −1 gives ∫ 1/x dx = ln|x| + C via the Log Rule. The Exponential Rule yields ∫ eˣ dx = eˣ + C and ∫ aˣ dx = aˣ/ln(a) + C. Trigonometric rules include ∫ sin(x) dx = −cos(x) + C and ∫ cos(x) dx = sin(x) + C. More complex integrands require techniques such as U-Substitution (reversing the chain rule), Integration by Parts — ∫ u dv = uv − ∫ v du (reversing the product rule) — Partial Fraction Decomposition for rational functions, and Trigonometric Substitution for radicals involving a² ± x². When no closed form exists, numerical methods like Simpson's Rule approximate the definite integral to high precision.

Why Does Integration Matter?

Integration appears throughout science, engineering, economics, and statistics. In physics, the integral of velocity with respect to time gives displacement; the integral of force over distance gives work; the integral of a charge distribution gives total charge. In probability and statistics, definite integrals of probability density functions yield cumulative probabilities. In engineering, control systems use Laplace transforms — which are integrals — to analyze stability; signal processing relies on Fourier transforms; structural engineers compute beam deflections using double integrals. In economics, consumer surplus and producer surplus are areas under demand and supply curves. Even image rendering in computer graphics uses integration to model how light accumulates on a surface. Understanding integration is therefore a foundational skill for any quantitative field.

此计算器的局限性

This calculator handles the most commonly taught elementary integrals using pattern-matching rules. It does not implement a full computer algebra system (CAS), so it cannot symbolically integrate arbitrary compositions such as sin(x²), √(x³ + 1), or rational functions requiring partial fractions with complex roots. For expressions that fall outside the supported patterns, the definite integral is still computed numerically using Simpson's Rule with 1,000 subintervals, providing excellent precision for smooth functions. Riemann sum visualization is only available for definite integrals with finite bounds. Improper integrals with infinite bounds are approximated over a large finite range (±100), which introduces some error for functions that decay slowly. Functions with discontinuities or singularities inside the integration interval may produce inaccurate numerical results.

How to Use the Integral Calculator

1

Choose Indefinite or Definite

Select Indefinite to find the general antiderivative F(x) + C, or select Definite to compute the numerical area under the curve between two bounds. The input form adjusts automatically to show bound fields when Definite is chosen.

2

Enter the Integrand Expression

Type your function in the expression field using standard notation: x^2 for x², sin(x), e^x, ln(x), 1/(x^2+1), etc. Use the virtual keyboard buttons to insert symbols like π, e, √, and trig functions quickly. For definite integrals, enter the lower and upper bounds — you can use numbers, pi, e, or inf for infinity.

3

Review the Result and Steps

The calculator displays the antiderivative (for indefinite) or the numeric value (for definite) along with the integration technique used. Expand the Step-by-Step Solution panel to see every transformation explained in plain language. For definite integrals, the function graph shades the integrated region to give a geometric view of the result.

4

Explore Riemann Approximations

For definite integrals with finite bounds, scroll down to the Riemann Sum Approximations panel. Use the rectangle slider (1–150) to increase the number of subdivisions and watch all four methods — Left, Right, Midpoint, and Trapezoid — converge toward the exact value. The error percentage quantifies how close each approximation is.

常见问题

What is the difference between an indefinite and a definite integral?

An indefinite integral ∫ f(x) dx produces an antiderivative F(x) + C — a function (or family of functions) whose derivative is f(x). The constant C reflects the fact that any constant disappears when differentiated. A definite integral ∫[a,b] f(x) dx produces a single number equal to F(b) − F(a), representing the net signed area between the curve and the x-axis over the interval [a, b]. The connection between the two is the Fundamental Theorem of Calculus, which states that a definite integral can always be evaluated by finding an antiderivative and subtracting the values at the bounds.

Why does the calculator show '+ C' in the result?

The '+ C' is the constant of integration, and it appears in every indefinite integral result because antiderivatives are not unique. For any antiderivative F(x), the function F(x) + C also has derivative f(x) for any constant C. In practice, C is determined by initial conditions or boundary conditions specific to the problem you are solving. For example, if you know the function passes through a particular point (x₀, y₀), you substitute those values to find C. The definite integral, by contrast, evaluates at two specific bounds, so the constants cancel: (F(b) + C) − (F(a) + C) = F(b) − F(a).

What integration techniques does this calculator support?

The calculator performs symbolic integration using pattern-matching for the most common elementary rules: Constant Rule (∫ a dx = ax + C), Power Rule (∫ xⁿ dx = xⁿ⁺¹/(n+1) + C for n ≠ −1), Log Rule (∫ 1/x dx = ln|x| + C), Exponential Rules (∫ eˣ dx = eˣ + C and ∫ aˣ dx = aˣ/ln(a) + C), Trigonometric Rules (sin, cos, tan, sec²), and Integration by Parts for ln(x). It also recognizes arctan and arcsin standard forms. For expressions outside these patterns, it falls back to numerical integration via Simpson's Rule.

How accurate is the numerical integration for definite integrals?

The definite integral is computed using Simpson's Rule with 1,000 subintervals. For smooth, well-behaved functions on finite intervals, Simpson's Rule achieves extremely high accuracy — typically within 10⁻¹⁰ of the true value. The error bound for Simpson's Rule is proportional to h⁴ · max|f⁴(x)| / 180, where h = (b−a)/n. Functions with discontinuities, singularities, or very steep slopes inside the integration interval may produce larger errors. For those cases, the symbolic result (when available) is used instead of the numerical approximation.

What are Riemann sums, and how do they relate to the definite integral?

A Riemann sum approximates a definite integral by dividing the integration interval into n equal-width rectangles (or trapezoids) and summing the areas. The Left Riemann Sum uses the function value at the left edge of each rectangle; the Right uses the right edge; the Midpoint Rule uses the center; and the Trapezoidal Rule averages the left and right values. As n approaches infinity, all four methods converge to the exact definite integral value. This calculator lets you explore this convergence interactively with a slider from 1 to 150 rectangles, and displays the percentage error of each method relative to the exact computed value.

Can this calculator handle improper integrals with infinite bounds?

Yes — you can enter inf or -inf as bounds. The calculator recognizes these as improper integrals and approximates them by substituting a large finite limit (±100). This works well for functions that decay rapidly, such as e^(−x) on [0, ∞). For functions with slow decay or oscillation at infinity, the approximation may carry noticeable error. The result display flags the integral as improper so you are aware of the approximation. For functions with a singularity at the boundary, numerical results may also be less reliable, and you should verify critical results against analytic methods.

EverydayTools简单 • 免费 • 快速

非IT专业人士的免费在线工具。计算器、转换器、生成器等。

热门类别

  • 健康计算器
  • 财务计算器
  • 转换工具
  • 数学计算器

公司

  • 关于
  • 联系
  • 隐私政策
  • 服务条款

© 2026 EverydayTools.io。版权所有。