Integral Calculator

Find antiderivatives and evaluate definite integrals with the rules shown at every step. Handles the power rule, substitution, integration by parts, and numeric area when no closed form exists.

What do you need?

Use x as the variable. Write powers with ^, functions as sin(x) or ln(x), and e^x for the exponential.

Insert
Try one of these

Your result will appear here

Enter a function above or tap an example to see the antiderivative and the rules behind it.

See the rule, not just the result

Calculus marks are usually lost on method, not arithmetic. This calculator names the rule behind every line, from the power rule through substitution and integration by parts, and shades the area a definite integral actually measures so the number on screen connects to the picture.

Antiderivatives · Definite integrals · Area

Why use this integral calculator?

Exact answers where they exist

Results come back as fractions and standard functions, so you get (1/3)x^3 rather than 0.333x^3, and ln|x| with the absolute value kept in place.

A number even without a formula

Functions such as e^(-x^2) have no antiderivative in standard form. Adaptive Simpson integration still returns an accurate value across any interval.

Every result is checked

The antiderivative is differentiated again and compared against your function at several points before the answer is shown.

Runs entirely offline in the browser

No account, no upload, no daily limit. The parser and the integration rules are plain JavaScript on your own device.

How this Integral Calculator works

This calculator does not look your function up in a table. It reads the text you type, splits it into numbers, the variable x, operators, and named functions, and builds a small tree that mirrors the structure of the expression. Brackets, implicit multiplication such as 2x, and a leading minus in front of a power all get resolved at this stage, so -x^2 is read as minus x squared rather than the square of minus x.

The solver then walks that tree and tries the standard rules in order. Sums split into separate integrals. Constants move outside. Anything that reduces to powers of x goes through the power rule, with 1/x handled separately because raising minus one by one would divide by zero. When the inside of a function is a straight line, such as cos(3x + 1), it divides by the slope. When one factor is a constant multiple of the derivative of another part, it applies substitution. Products of a polynomial and an exponential, sine, cosine, or logarithm go through integration by parts, repeating until the polynomial runs down to a constant.

For a definite integral it evaluates the antiderivative at both limits and subtracts. It also runs adaptive Simpson integration, which subdivides the interval more finely wherever the curve bends, so functions with no closed form still return an accurate number.

Every answer is then differentiated again and compared against your function as a check. Nothing is uploaded — all of it runs in your browser.

How to use this Integral Calculator

1

Pick the type

Choose Antiderivative for the general result with + C, or Definite integral when you need the area between two limits.

2

Type the function

Use x as the variable, ^ for powers, and named functions such as sin(x), ln(x), sqrt(x), or e^x.

3

Read the result and the rules

The answer appears with the rule behind every step, plus a graph that shades the area a definite integral measures.

Example Usage

Integrating a product with integration by parts:

Input
Function: x*e^x Type: Antiderivative
Output
x·e^x - e^x + C Rule 1 Integration by parts with u = x and dv = e^x dx Rule 2 The exponential is its own integral Check Differentiating the result returns x·e^x

Frequently Asked Questions

What is the difference between an indefinite and a definite integral?
An indefinite integral gives a function, the antiderivative, and it ends with + C because shifting a function up or down does not change its slope. A definite integral gives a single number: the signed area between the curve and the x-axis across the limits you set.
How do I type the function?
Use x as the variable. Write x squared as x^2, a square root as sqrt(x), the natural log as ln(x), and the exponential as e^x or exp(x). Trigonometric functions need brackets, so write sin(x) rather than sin x. Multiplication can be written as 2x or 2*x.
Why does the answer always end with + C?
Every constant differentiates to zero, so x^2 + 1 and x^2 + 7 have the same derivative. When you reverse the process you cannot recover which constant was there, so the answer covers all of them at once with + C.
What does the shaded area on the graph mean?
It is the region the definite integral measures. Anything above the x-axis counts as positive and anything below counts as negative, so a curve that spends equal time above and below can integrate to zero even though the region on screen looks large.
Why did I get a number but no antiderivative?
Some functions, such as e^(-x^2) and sin(x)/x, have no antiderivative that can be written with standard functions. That is a property of the function, not a limitation of the tool. Numeric integration still gives an accurate value across any interval you choose.
How accurate is the numeric result?
The calculator uses adaptive Simpson integration, which splits the interval further wherever the curve bends sharply. For smooth functions the answer usually matches to around ten significant figures.
Can I use pi or e in the limits?
Yes. The limit boxes accept plain numbers as well as constants and small expressions, so pi, 2*pi, -pi/2, and e all work.
What happens if the lower limit is bigger than the upper limit?
The result comes out negative. Swapping the limits of a definite integral flips its sign, which is a standard property rather than an error, and the calculator points it out below the answer.
Does it handle integration by parts and substitution?
Yes. Products such as x·e^x and x^2·sin(x) go through integration by parts, and expressions where one factor is the derivative of another part, such as x·sqrt(x^2 + 1), go through substitution. The rules panel names the method used.
Why does the result show ln|x| instead of ln(x)?
The antiderivative of 1/x is ln|x| because the absolute value keeps the answer valid for negative x as well. Dropping the bars would restrict the result to positive values only.
How do I know the answer is right?
The calculator differentiates its own result and compares it with the function you entered at several points. When they match, a confirmation note appears under the answer. You can also check by hand: differentiating the antiderivative should return the original function.
Is anything I type uploaded?
No. The parser, the integration rules, and the numeric routine all run in your browser, so the functions you enter never leave your device.

Related Tools

The Integral Calculator is maintained by CodeItBro. We aim to provide the best free developer tools on the web. If you have feedback or suggestions, please visit our contact page.

Comments

Questions, corrections, and useful tips are welcome. Comments are reviewed before publication.

Loading comments...

Comments are stored and moderated using Cusdis Cloud. Email is optional. Privacy Policy

As featured on

CodeItBro - Free dev tools + practical guides to help you ship faster | Product HuntCodeItBro - Free Online Developer Tools badgeCodeItBro badge