Why Factoring Out Before Integrating Can Wreck Your Integral in Calculus

Factoring a variable, like x, out of an integral before integrating is only valid if it’s truly constant over the interval—which it never is when integrating with respect to that variable. In ∫₀² x(x+1)dx, pulling out x changes the problem entirely: the algebra isn’t the problem; the meaning is. Suppose you see ∫₀² x(x+1)dx and try to simplify by factoring out x.
The x That Survives Substitution
Integral calculus teaches you to compute areas and accumulations with respect to a variable, usually x. The rule you rely on—the constant multiple rule for integrals—says:
If k is constant, then ∫ k·f(x) dx = k ∫ f(x) dx.
But this only holds for true constants (real numbers that do not change as x varies). If you factor out something that depends on x, you quietly break the link between the integrand and the operation: you’re treating part of the function as if it’s not changing, when it is.
Here’s the wrong approach in full:
∫₀² x(x+1)dx
= x ∫₀² (x+1)dx
= x [ (1/2)x^2 + x ] from x=0 to x=2
= x [ 2 + 2 ]
= x [ 4 ]
= 4x
Stop there. This answer, 4x, makes no sense: x is still “alive”. You cannot plug in the bounds x=0 and x=2 into an answer that still contains x. That’s the check. The operation was never performed.
What Actually Happens If You Leave the Variable In
Let’s work the correct path. Multiply out the product:
∫₀² x(x+1)dx = ∫₀² (x^2 + x) dx.
Now integrate term by term:
∫₀² x^2 dx = [ (1/3)x^3 ]₀² = (1/3)(8) - (1/3)(0) = 8/3
∫₀² x dx = [ (1/2)x^2 ]₀² = (1/2)(4) - (1/2)(0) = 2
Add:
Total = 8/3 + 2 = 14/3.
Compare that to the nonsense answer 4x above. Plugging in x=0 and x=2 into 4x gives you “0 and 8,” but you have no idea what that means, and it is not the evaluation of the original definite integral. The correct answer is a single number: 14/3.
The Rule: Only True Constants Can Leave
The constant multiple rule for definite integrals is:
If c is constant with respect to x, ∫ₐᵇ c·f(x)dx = c ∫ₐᵇ f(x)dx.
But “constant” means not depending on x at all. If you try to factor out x, x+1, sin(x), or any x-dependent part, you’re treating it as if it does not change over the interval—a mistake that quietly ruins the computation. That’s the factoring trap: “constant” does not mean “not currently being multiplied,” it means “not varying at all.”
Why Is This So Tempting?
The move feels valid because it is valid in sums, products, and some algebraic simplifications. For example, for sums:
2(x+1) = 2x + 2
and for products:
x(x+1) = x^2 + x
But integration is not multiplication or distribution: it’s a sum over infinitely many values of x. The integral sign “ties down” x as a running variable. When you factor out a true constant (like 5 in ∫₀² 5(x^2)dx), the rule holds. But for anything with x in it: stop.
The Substitution Exception: When a Constant Isn't So Constant
Suppose you see this instead:
∫₀¹ (2y) sin(y^2) dy
Here, it looks tempting to factor out 2y. But 2y depends on y, so it cannot be pulled out. What you can do is use substitution:
Let u = y^2, so du = 2y dy.
Then, as y goes from 0 to 1, u goes from 0 to 1.
So the integral becomes:
∫₀¹ sin(u) du = [ -cos(u) ]₀¹ = -cos(1) + cos(0) = 1 - cos(1).
If you had incorrectly factored out 2y before integrating, you’d have ended up with nonsense—no variable left to integrate. The substitution itself used 2y dy as the new du, not a constant outside the integral. This is the rare case where the “constant” you’re tempted to factor is actually your substitution link.
Try This: One Integral, One Check
Try integrating ∫₁³ x·e^{x^2} dx. Don’t factor out x—try substitution.
Let u = x^2, so du = 2x dx ⇒ (1/2) du = x dx
So the integral becomes
∫_{x=1}^{x=3} x·e^{x^2} dx = ∫_{u=1}^{u=9} (1/2) e^{u} du
= (1/2) [ e^{u} ]₁⁹ = (1/2)(e^9 - e^1)
If you had tried to factor out x and integrate just e^{x^2} dx, you would be stuck: there is no antiderivative in terms of elementary functions, and the bounds make no sense. The variable must stay.
Whenever you’re tempted to factor out a non-constant from an integral, check: does it depend on the variable you’re integrating? If so, leave it in. That’s the only way the integral makes sense.
Summary
Integral calculus teaches you to compute areas and accumulations with respect to a variable, usually x.
