Indefinite Integration Basics: Core Rules, Formulas & Trig Examples

Integration is just differentiation run backward. Here's the intuition behind the power rule, the mysterious +C, and the trig antiderivatives everyone memorizes but nobody explains.

By Petrus Sheya

August 4, 2026 · 6 min read

You know how to find the slope of a curve at a point. That's differentiation. But what if someone handed you the slope everywhere and asked you to hand back the original curve?

That's indefinite integration. And once you see it as an undo operation instead of a bag of rules, the whole thing gets a lot less mysterious.


Differentiation has an undo button

Think about a car. Its speedometer tells you velocity at every instant, v(t)v(t). If you know the position function s(t)s(t), you can get velocity by differentiating: v(t)=s(t)v(t) = s'(t).

Now flip it. Suppose you only have the speedometer reading, v(t)v(t), and you want the position back. You need a function whose derivative is v(t)v(t). That function is called an antiderivative, and finding it is what integration does.

We write this as:

v(t)dt=s(t)+C\int v(t)\, dt = s(t) + C

Read that as: "the antiderivative of v(t)v(t), with respect to tt, is s(t)s(t)." We'll get to the +C+C in a second, it's not a typo.

Watch the two curves below trace each other out. The gold curve is the slope. The green curve is the position, built up by accumulating that slope over time. At every instant, the height of the gold curve tells you exactly how steep the green curve is right there.

The gold curve is the slope, always fully visible. The green curve is the position, drawn only as far as time has reached. Drag the dot or hit play.

t1.20
slope = cos t0.36
position = sin t0.93

Notice the dot never leaves the gold curve's height and the green curve's slope. That's the whole relationship in motion: differentiate the green curve, you get the gold one. Integrate the gold curve, you get the green one back.


But which curve did we undo to?

Here's a wrinkle. Say you're told a curve has slope 2x2x everywhere. Is the curve y=x2y = x^2? Sure, that works: ddx(x2)=2x\frac{d}{dx}(x^2) = 2x.

But so does y=x2+5y = x^2 + 5. And y=x2100y = x^2 - 100. Adding a constant to a function never changes its slope, because the slope of a flat shift is zero.

So "slope 2x2x everywhere" doesn't pin down one curve. It pins down an entire family of curves, all shaped the same, just shifted up or down. That's why every indefinite integral ends with +C+ C: it's a placeholder for "we don't know the vertical starting point, only the shape."

Drag the point along the curve, then slide C. The whole curve shifts up or down, but the tangent slope at any given x never changes.

(1.60, 2.56)
F(x) = x² + C2.56
Slope here3.20
Slope depends on C?No

Drag the point anywhere on the curve. Slide C anywhere you like. The tangent line rotates with your x-position, but it never cares what C is. The slope only depends on where you are, not on which member of the family you're standing on.


The power rule: reverse the exponent shift

Now for an actual formula. Remember the power rule for derivatives: to differentiate xnx^n, you bring the exponent down and knock it off, giving nxn1n x^{n-1}.

Integration reverses that move. Instead of subtracting 1 from the exponent, we add 1. Instead of multiplying by the old exponent, we divide by the new one:

xndx=xn+1n+1+C\int x^n \, dx = \frac{x^{n+1}}{n+1} + C

Try it on something simple. x3dx\int x^3\, dx. Add 1 to the exponent: 4. Divide by that new exponent: x44+C\frac{x^4}{4} + C. Check it by differentiating back: ddx(x44)=4x34=x3\frac{d}{dx}\left(\frac{x^4}{4}\right) = \frac{4x^3}{4} = x^3. It works.

One catch: this formula breaks at n=1n = -1, because you'd be dividing by zero. x1dx\int x^{-1}\, dx needs a different rule entirely (it's lnx+C\ln|x| + C, a story for another post).

Pick a power n, then drag the marker. The shortcut formula and a brute-force sum of five hundred thin slices land on the same number.

Formula: x^(n+1)/(n+1)1.200
500 thin slices1.200
Matchyes

Pick a power n, then drag the marker along the x-axis. The shaded region is the actual area under the curve, computed by brute-force addition of five hundred thin slices, same idea as the Riemann sums from our post on what integration actually is. The formula's answer and the brute-force answer always agree. The power rule isn't a trick, it's a shortcut for a sum you could compute by hand if you had the patience.


Trig functions play by their own rules

Powers of xx shift their exponent when you integrate. Trig functions do something different: they rotate through each other, sometimes flipping sign along the way. Here are the four you'll use constantly:

cosxdx=sinx+C\int \cos x \, dx = \sin x + C sinxdx=cosx+C\int \sin x \, dx = -\cos x + C sec2xdx=tanx+C\int \sec^2 x \, dx = \tan x + C secxtanxdx=secx+C\int \sec x \tan x \, dx = \sec x + C

The sign flip on the sine rule trips people up the most. Why does integrating sinx\sin x produce a negative cosine? Here's the geometric reason.

Drag the point around the circle. The vertical drop is sin θ, the horizontal drop is cos θ, and the segment on the right is tan θ.

θ (rad)0.90
sin θ0.78
cos θ0.62
tan θ1.26
∫ cos θ dθ = sin θ + C →0.783 + C
∫ sin θ dθ = −cos θ + C →-0.622 + C

Drag the point around the circle. The vertical drop is sinθ\sin\theta, the horizontal drop is cosθ\cos\theta. Watch what happens as you drag through the top of the circle, where sinθ\sin\theta is at its peak: cosθ\cos\theta is crossing zero right there and about to go negative. That's not a coincidence.

The rate at which sinθ\sin\theta changes, its derivative, equals cosθ\cos\theta. So the rate at which cosθ\cos\theta changes must be the derivative going the other way, and it comes out to sinθ-\sin\theta. Integration just runs that relationship backward: since differentiating cosx\cos x gives sinx-\sin x, integrating sinx\sin x has to bring back a negative cosine to cancel the sign. The stat panel on the wheel shows both live substitutions as you drag, so you can check it at any angle you land on.


Putting a few rules together

Real integrals usually mix these rules in one expression. The trick is just to integrate term by term. Take:

(3x2+cosx)dx\int (3x^2 + \cos x)\, dx

Apply the power rule to the first term, the cosine rule to the second, and add a single +C+C at the end (not one per term, they'd just combine into one constant anyway):

=x3+sinx+C= x^3 + \sin x + C

That's it. No new ideas, just the two rules you already have, applied piece by piece.


The short version

Integration is the reverse of differentiation. Given a function that tells you the slope everywhere, integration hands you back a function with that exact slope, plus an unknown constant CC because a vertical shift never shows up in the slope.

The power rule reverses the exponent shift from differentiation: add 1 to the exponent, divide by the new exponent. The trig rules rotate functions through each other, sin and cosine trading places, one sign flip along the way, and that flip comes straight from how the two rates of change relate on the unit circle.

Every indefinite integral you'll ever compute is some combination of these ideas, applied term by term.


The visuals on this page are interactive React components. All curve tracing and area shading are computed live in your browser, and the power rule check runs a genuine five-hundred-slice trapezoid sum against the closed-form answer on every drag. No libraries beyond React.