Integral Calculator

Evaluate definite and indefinite integrals with AI-powered step-by-step solutions

Drag & drop or click to add images or PDF

Math Input
integral of x^2 * sin(x) dx
integral of 1/(x^2 + 1) dx
integral from 0 to pi of sin(x) dx
integral of ln(x) dx

What is an Integral?

An integral is a fundamental concept in calculus that represents the accumulation of quantities. There are two main types:

Indefinite Integral (Antiderivative)

The indefinite integral of f(x)f(x) is a family of functions F(x)+CF(x) + C such that F(x)=f(x)F'(x) = f(x):

f(x)dx=F(x)+C\int f(x)\,dx = F(x) + C

where CC is the constant of integration.

Definite Integral

The definite integral computes the net signed area under the curve f(x)f(x) from aa to bb:

abf(x)dx=F(b)F(a)\int_a^b f(x)\,dx = F(b) - F(a)

This relationship is known as the Fundamental Theorem of Calculus, which connects differentiation and integration.

Geometrically, the definite integral represents the area between the function and the xx-axis over the interval [a,b][a, b]. Areas above the axis are positive, and areas below are negative.

Integrals have wide applications in physics (work, displacement), engineering (signal processing), probability (expected values), and economics (consumer surplus).

How to Compute Integrals

Basic Integration Rules

xndx=xn+1n+1+C(n1)\int x^n\,dx = \frac{x^{n+1}}{n+1} + C \quad (n \neq -1)

1xdx=lnx+C\int \frac{1}{x}\,dx = \ln|x| + C

exdx=ex+C\int e^x\,dx = e^x + C

sinxdx=cosx+C\int \sin x\,dx = -\cos x + C

cosxdx=sinx+C\int \cos x\,dx = \sin x + C

Method 1: Substitution (u-substitution)

Used when the integrand contains a composite function. Let u=g(x)u = g(x), then du=g(x)dxdu = g'(x)\,dx:

f(g(x))g(x)dx=f(u)du\int f(g(x)) \cdot g'(x)\,dx = \int f(u)\,du

Example: 2xex2dx\int 2x \cdot e^{x^2}\,dx. Let u=x2u = x^2, du=2xdxdu = 2x\,dx, so the integral becomes eudu=ex2+C\int e^u\,du = e^{x^2} + C.

Method 2: Integration by Parts

Based on the product rule for derivatives:

udv=uvvdu\int u\,dv = uv - \int v\,du

Choose uu and dvdv using the LIATE rule (Logarithmic, Inverse trig, Algebraic, Trigonometric, Exponential).

Example: xexdx\int x \cdot e^x\,dx. Let u=xu = x, dv=exdxdv = e^x\,dx. Then du=dxdu = dx, v=exv = e^x. Result: xexex+Cxe^x - e^x + C.

Method 3: Partial Fractions

For rational functions P(x)Q(x)\frac{P(x)}{Q(x)}, decompose into simpler fractions:

1x21dx=12(1x11x+1)dx=12lnx1x+1+C\int \frac{1}{x^2 - 1}\,dx = \int \frac{1}{2}\left(\frac{1}{x-1} - \frac{1}{x+1}\right)dx = \frac{1}{2}\ln\left|\frac{x-1}{x+1}\right| + C

Method 4: Trigonometric Substitution

For integrands involving a2x2\sqrt{a^2 - x^2}, a2+x2\sqrt{a^2 + x^2}, or x2a2\sqrt{x^2 - a^2}:

ExpressionSubstitutionIdentity Used
a2x2\sqrt{a^2 - x^2}x=asinθx = a\sin\theta1sin2θ=cos2θ1 - \sin^2\theta = \cos^2\theta
a2+x2\sqrt{a^2 + x^2}x=atanθx = a\tan\theta1+tan2θ=sec2θ1 + \tan^2\theta = \sec^2\theta
x2a2\sqrt{x^2 - a^2}x=asecθx = a\sec\thetasec2θ1=tan2θ\sec^2\theta - 1 = \tan^2\theta

Comparison of Methods

MethodBest ForKey Indicator
SubstitutionComposite functionsInner function's derivative present
By PartsProducts of different typesProduct of algebraic × transcendental
Partial FractionsRational functionsPolynomial / polynomial
Trig SubstitutionSquare roots of quadraticsa2±x2\sqrt{a^2 \pm x^2} forms

Common Mistakes to Avoid

  • Forgetting the constant of integration: Every indefinite integral must include +C+ C. The antiderivative is a family of functions.
  • Incorrect power rule application: x1dx=lnx+C\int x^{-1}\,dx = \ln|x| + C, not x00\frac{x^0}{0}. The power rule xn+1n+1\frac{x^{n+1}}{n+1} does not apply when n=1n = -1.
  • Sign errors with trig integrals: sinxdx=cosx+C\int \sin x\,dx = -\cos x + C (negative sign). cosxdx=sinx+C\int \cos x\,dx = \sin x + C (positive sign).
  • Forgetting to substitute back: When using uu-substitution, always convert the final answer back to the original variable xx.
  • Wrong bounds in definite integrals: When using substitution in definite integrals, either change the limits to match the new variable or substitute back before evaluating.

Examples

Step 1: Apply integration by parts: let u=x2u = x^2, dv=exdxdv = e^x\,dx, so du=2xdxdu = 2x\,dx, v=exv = e^x
Step 2: First application: x2ex2xexdxx^2 e^x - \int 2x e^x\,dx
Step 3: Apply by parts again to 2xexdx\int 2xe^x\,dx: let u=2xu = 2x, dv=exdxdv = e^x\,dx, giving 2xex2ex2xe^x - 2e^x
Step 4: Combine: x2ex2xex+2ex+C=ex(x22x+2)+Cx^2 e^x - 2xe^x + 2e^x + C = e^x(x^2 - 2x + 2) + C
Answer: ex(x22x+2)+Ce^x(x^2 - 2x + 2) + C

Step 1: Recognize that 11+x2\frac{1}{1+x^2} is the derivative of arctan(x)\arctan(x)
Step 2: Apply the Fundamental Theorem: [arctan(x)]01\left[\arctan(x)\right]_0^1
Step 3: Evaluate: arctan(1)arctan(0)=π40=π4\arctan(1) - \arctan(0) = \frac{\pi}{4} - 0 = \frac{\pi}{4}
Answer: π4\frac{\pi}{4}

Step 1: Factor the denominator: x2+3x+2=(x+1)(x+2)x^2+3x+2 = (x+1)(x+2)
Step 2: Notice the numerator 2x+32x+3 is the derivative of the denominator x2+3x+2x^2+3x+2
Step 3: Apply the formula f(x)f(x)dx=lnf(x)+C\int \frac{f'(x)}{f(x)}\,dx = \ln|f(x)| + C
Step 4: Result: lnx2+3x+2+C\ln|x^2+3x+2| + C
Answer: lnx2+3x+2+C\ln|x^2+3x+2| + C

Frequently Asked Questions

An indefinite integral gives a general antiderivative (a function plus a constant C), while a definite integral evaluates the net area under a curve between two specific bounds and produces a numerical value.

Use substitution when you see a composite function whose inner function's derivative appears in the integrand. Use integration by parts when you have a product of two different types of functions, such as x times e^x or x times sin(x).

Because differentiation eliminates constants (the derivative of any constant is zero), there are infinitely many antiderivatives that differ by a constant. The +C represents this entire family of solutions.

No. Many functions like e^(-x^2), sin(x)/x, and x^x do not have closed-form antiderivatives. These must be evaluated using numerical methods or expressed in terms of special functions.

Related Solvers

DerivativeLimitSeriesDifferential equation
Try AI-Math for Free

Get step-by-step solutions to any math problem. Upload a photo or type your question.

Start Solving