Integral Calculator

Enter a function and choose between definite or indefinite integration. Get the antiderivative, numerical result, and a step-by-step breakdown of the solution process.

Report a Bug

What Integration Actually Means

Integration is one of the two big ideas in calculus, sitting right alongside differentiation as its mirror image. Where a derivative tells you how fast something is changing at any given moment, an integral adds up all those tiny changes to give you the total accumulation. Think of it this way: if your car's speedometer shows your velocity at each instant, then integrating that velocity over time tells you the total distance you've traveled.

The concept has surprisingly ancient roots. Archimedes used a method called exhaustion around 250 BCE to calculate the area under a parabolic arc. He didn't call it integration, of course, but the underlying idea was the same — slice a curved region into thin strips, approximate each strip as a rectangle, and add them up. The thinner the strips, the better the approximation.

Newton and Leibniz independently formalized this intuition in the late 1600s, and Leibniz gave us the elongated S symbol ∫ that we still use today. That symbol is literally a stretched-out letter S, standing for "summa" (Latin for sum). The dx at the end of an integral expression represents an infinitesimally small width, so ∫ f(x) dx reads as "sum up f(x) times dx across all those tiny slices."

There are two flavors of integrals that serve different purposes. A definite integral has specific upper and lower bounds and produces a single number — often representing an area, volume, or total accumulated quantity. An indefinite integral has no bounds and produces a family of functions, all differing by a constant C. That constant shows up because many different functions can share the same derivative. For example, x² + 5 and x² - 3 both have the derivative 2x, so the integral of 2x is x² + C, where C could be anything.

Definite vs. Indefinite Integrals

The difference between definite and indefinite integrals trips people up at first, but it's actually pretty straightforward once you see what each one is asking.

An indefinite integral asks: "What function, when differentiated, gives me f(x)?" The answer is called the antiderivative, and you write it as F(x) + C. That mysterious C isn't just academic formality — it genuinely matters. If you know an object's acceleration is 9.8 m/s² (gravity), then integrating gives you velocity as 9.8t + C, where C is the initial velocity. Without knowing where the object started, you can't pin down the exact velocity at any time.

A definite integral, on the other hand, asks: "What's the total accumulation of f(x) between x = a and x = b?" The answer is a specific number, and here's the beautiful part — you don't need to add up infinitely many rectangles by hand. The Fundamental Theorem of Calculus connects the two types: just find any antiderivative F(x), then compute F(b) minus F(a). The constant C cancels out, which is why definite integrals don't include it.

Geometrically, the definite integral represents the signed area between the curve and the x-axis. "Signed" means that area below the x-axis counts as negative. So if f(x) dips below zero on part of the interval, those portions subtract from the total. If you want the actual geometric area regardless of sign, you'd need to integrate the absolute value of f(x), which sometimes requires splitting the interval at the zeros.

This calculator handles both types. For indefinite integrals, it applies symbolic rules to find the antiderivative expression. For definite integrals, it uses Simpson's rule for numerical accuracy when symbolic methods get complicated, but it'll also show you the antiderivative so you can see the algebraic solution.

Common Integration Rules You Should Know

Most integration problems you'll encounter in a calculus course can be handled with a fairly short list of rules. Memorizing these is like learning vocabulary in a new language — once you've got them down, you can read most of what's thrown at you.

The power rule is the workhorse. The integral of x^n is x^(n+1)/(n+1) + C, as long as n isn't -1. When n is -1, you're integrating 1/x, and the result is ln|x| + C instead. This single exception is easy to forget and causes all sorts of errors on exams.

Trigonometric integrals follow patterns that are essentially the reverse of trig derivatives. The integral of sin(x) is -cos(x) + C (note the negative sign). The integral of cos(x) is sin(x) + C. If you keep mixing these up, here's a mnemonic: differentiation introduces a negative for sine but not cosine, so integration removes a negative for sine but not cosine.

The exponential function e^x is famously its own integral: ∫ e^x dx = e^x + C. It's the only function with this property, which is part of why e shows up everywhere in mathematics and science. For a general exponential a^x, the integral is a^x / ln(a) + C.

Constants just multiply through. The integral of 5 dx is 5x + C. The integral of 3x² dx is 3 times x³/3, which simplifies to x³ + C. This linearity property means you can break apart sums and differences: the integral of (x² + 3x - 7) is the integral of x² plus the integral of 3x minus the integral of 7, evaluated separately and then combined.

More advanced techniques like substitution, integration by parts, and partial fractions handle the cases where basic rules fall short. Substitution is essentially the chain rule in reverse. Integration by parts reverses the product rule. These go beyond what this calculator handles symbolically, but the numerical method still produces accurate results for definite integrals of any continuous function.

Real-World Applications of Integrals

Integration isn't just an abstract exercise in pushing symbols around. It shows up in practically every branch of science and engineering, usually in situations where you need to add up a continuously varying quantity.

Physics is absolutely packed with integrals. Work equals the integral of force over distance. If you push a box across a floor with varying force, you can't just multiply force by distance because the force keeps changing. You have to integrate. Electric potential is the integral of the electric field along a path. The mass of an object with non-uniform density requires integrating the density function over the volume.

In statistics and probability, the area under a probability density curve between two values gives you the probability that a random variable falls in that range. The entire bell curve (normal distribution) has a total area of 1, and the probability of scoring between, say, 70 and 85 on a test is the integral of the density function from 70 to 85. Every time you see a p-value or a confidence interval, there's an integral working behind the scenes.

Economics uses integrals for consumer and producer surplus. The demand curve shows how much consumers are willing to pay at various quantities, and the integral of that curve above the market price gives the total consumer surplus — the collective benefit consumers get from buying at a price lower than what they'd be willing to pay.

Engineering applications are everywhere too. Civil engineers integrate load distributions to find total forces on beams and bridges. Electrical engineers integrate current over time to find charge, and power over time to find energy consumption. Even computer graphics relies on integration: realistic rendering involves integrating light transport equations to determine how much light reaches each pixel from every direction in a scene. Every time you see a beautifully lit video game environment, there are millions of tiny integrals being approximated behind the scenes.

Fundamental Theorem of Calculus

∫ₐᵇ f(x) dx = F(b) - F(a)

The definite integral of a function f(x) from a to b equals F(b) minus F(a), where F is any antiderivative of f. For the indefinite integral, we find the general antiderivative F(x) + C, where C is the constant of integration. Common rules include the power rule, where the integral of x^n is x^(n+1)/(n+1) + C for n not equal to -1, and the integral of 1/x is ln|x| + C. Trigonometric integrals follow standard patterns: the integral of sin(x) is -cos(x) + C, and the integral of cos(x) is sin(x) + C.

Where:

  • f(x) = The function being integrated (the integrand)
  • F(x) = The antiderivative of f(x)
  • a = The lower bound of integration
  • b = The upper bound of integration
  • C = The constant of integration for indefinite integrals

Example Calculations

Definite Integral of a Polynomial

Computing the definite integral of x² from 0 to 5.

Using the power rule, the antiderivative of x² is x³/3. Evaluating from 0 to 5: F(5) - F(0) = (5³)/3 - (0³)/3 = 125/3 - 0 = 41.6667. This represents the area under the parabola y = x² between x = 0 and x = 5.

Indefinite Integral of sin(x)

Finding the antiderivative of sin(x).

The integral of sin(x) is -cos(x) + C. This is because the derivative of -cos(x) is sin(x), confirming the antiderivative is correct. The constant C represents the family of all vertical shifts of -cos(x).

Frequently Asked Questions

A definite integral has specific upper and lower bounds and produces a single numerical answer representing the net area under the curve between those bounds. An indefinite integral has no bounds and produces a general antiderivative function plus a constant C. For example, the indefinite integral of 2x is x² + C, while the definite integral of 2x from 0 to 3 is (3)² - (0)² = 9.

The constant C appears because many different functions can have the same derivative. For instance, x², x² + 7, and x² - 100 all have the derivative 2x. When you integrate 2x, you get x² + C, where C could be any real number. The constant accounts for all these possibilities. In a definite integral, C cancels out during the subtraction F(b) - F(a), so it doesn't appear in the final answer.

This calculator symbolically integrates polynomials (like x^3 or 5x^2 + 3x - 7), basic trigonometric functions (sin(x) and cos(x)), exponential functions (e^x), the natural log reciprocal (1/x), and constants. For definite integrals, it also uses Simpson's rule for numerical computation, which works with any continuous function you can type in. Complex expressions involving products or compositions of these functions are handled numerically rather than symbolically.

The calculator uses Simpson's rule with 1000 subintervals for numerical integration, which provides excellent accuracy for most smooth functions. Simpson's rule approximates the function with parabolic segments rather than rectangles, making it significantly more accurate than simpler methods like the trapezoidal rule. For typical polynomial and trigonometric functions, the result is accurate to at least 6 decimal places. Accuracy may decrease for functions with sharp peaks, discontinuities, or extremely rapid oscillation within the integration interval.

The geometric interpretation is area, but the physical meaning depends on context. If the curve represents velocity over time, the area gives total distance traveled. If it represents power over time, the area gives total energy consumed. If it represents a rate of flow over time, the area gives total volume. In probability, the area under a density curve between two values gives the probability of a random variable falling in that range. The integral is fundamentally about accumulation — adding up infinitely many infinitely small contributions.

Related Calculators