Derivative of x squared is 2x or x ? Where is the fallacy?

The Standard Result

Every calculus student learns the power rule early: the derivative of \( x^2 \) with respect to \( x \) is \( 2x \).

$$\frac{d}{dx}\, x^2 = 2x$$

You can verify this from the limit definition. For any \( h \neq 0 \):

$$\lim_{h \to 0} \frac{(x+h)^2 – x^2}{h} = \lim_{h \to 0} \frac{2xh + h^2}{h} = \lim_{h \to 0}(2x + h) = 2x$$

No controversy there. But a seemingly innocent algebraic rewrite leads to a completely different answer.

The Curious Fallacy

Write \( x^2 \) as the sum of \( x \) added to itself \( x \) times:

$$x^2 = \underbrace{x + x + x + \cdots + x}_{x \text{ times}}$$

Now define \( f(x) = \underbrace{x + x + \cdots + x}_{x \text{ times}} \) and differentiate term by term:

$$f'(x) = \underbrace{\frac{d}{dx}x + \frac{d}{dx}x + \cdots + \frac{d}{dx}x}_{x \text{ times}} = \underbrace{1 + 1 + \cdots + 1}_{x \text{ times}} = x$$

So the derivative of \( x^2 \) is… \( x \)? That is half the correct answer. Where did the other \( x \) go?

x² = x + x + … + xx termsd/dx1 + 1 + … + 1x terms=xWRONGCorrect: 2xMissing half!
The fallacious argument in three steps. Differentiating each \( x \) gives 1, summing \( x \) ones gives \( x \) — but the correct answer is \( 2x \).

Two Hidden Errors

The fallacy hides not one, but two distinct errors.

Error 1: The identity only works for positive integers

The statement \( x^2 = \underbrace{x + x + \cdots + x}_{x \text{ times}} \) is only meaningful when \( x \in \mathbb{Z}^+ \). You cannot add a number to itself “\( \pi \) times” or “\( \sqrt{2} \) times.” The expression has no definition for non-integer \( x \).

Differentiation, however, requires \( f \) to be defined on an open interval of \( \mathbb{R} \). Since the expansion fails for all \( x \in \mathbb{R} \setminus \mathbb{Z}^+ \), we cannot differentiate it as if it were a valid identity over the reals:

$$x^2 \neq \underbrace{x + x + \cdots + x}_{x \text{ times}} \quad \text{for } x \in \mathbb{R}$$

Error 2: The number of terms is not constant

Even setting aside the domain issue, the differentiation step is wrong. The sum rule

$$\frac{d}{dx}\bigl(g_1(x) + g_2(x) + \cdots + g_n(x)\bigr) = g_1′(x) + g_2′(x) + \cdots + g_n'(x)$$

requires \( n \) to be a fixed constant. In our fallacy, the number of terms is \( x \) — the very variable we are differentiating with respect to. As \( x \) changes, terms appear and disappear from the sum. The derivative of such a sum requires the Leibniz rule (the continuous analogue), not the simple sum rule.

This second error is actually the source of the “missing \( x \).” If we were to properly account for the changing number of terms, we would recover exactly the missing \( x \), yielding the correct \( 2x \).

ERROR 1Domain restrictionx + x + … + x (x times)only works for x = 1, 2, 3, …Differentiation needs x in Rx ∉ Z⁺ERROR 2Variable term countSum rule requires n = constantHere n = x (the variable!)Needs Leibniz rule insteadn ≠ const
The two independent errors in the fallacy. Either one alone is enough to invalidate the argument.

The Correct Expansion for Real x

For any real number \( x > 0 \), we can decompose it using the floor function \( \lfloor x \rfloor \) and the fractional part \( \{x\} = x – \lfloor x \rfloor \):

$$x = \lfloor x \rfloor + \{x\}$$

Multiplying both sides by \( x \):

$$x^2 = x \cdot \lfloor x \rfloor + x \cdot \{x\}$$

The first term is \( x \) added \( \lfloor x \rfloor \) times (a genuine positive integer number of terms). The second term accounts for the fractional remainder. Differentiating with the product rule:

$$\frac{d}{dx}(x^2) = \frac{d}{dx}\bigl(x\lfloor x \rfloor\bigr) + \frac{d}{dx}\bigl(x\{x\}\bigr)$$

$$= \lfloor x \rfloor + x\lfloor x \rfloor’ + \{x\} + x\{x\}’$$

$$= \bigl(\lfloor x \rfloor + \{x\}\bigr) + x\bigl(\lfloor x \rfloor’ + \{x\}’\bigr)$$

Since \( \lfloor x \rfloor + \{x\} = x \) and \( \lfloor x \rfloor’ + \{x\}’ = 1 \), we get:

$$\frac{d}{dx}(x^2) = x + x \cdot 1 = 2x \quad \checkmark$$

The “missing \( x \)” from the fallacy comes precisely from the fractional part term and the variable number of terms — the pieces the naive argument ignores.

Visual Comparison

The graph below shows the true parabola \( y = x^2 \) alongside the piecewise-linear function that “repeated addition” actually produces. They agree only at positive integer points.

xy1234149divergencey = x² (true curve)repeated addition
The smooth parabola \( y = x^2 \) (blue) and the piecewise-linear “repeated addition” (red dashed) agree at positive integers (green dots) but diverge everywhere else. The shaded region shows where the naive interpretation fails.

The Derivative Geometrically

There is a satisfying geometric way to see why the derivative of \( x^2 \) must be \( 2x \). Think of \( x^2 \) as the area of a square with side length \( x \). When you increase the side by a tiny amount \( dx \), the new area is:

$$(x + dx)^2 = x^2 + 2x\,dx + (dx)^2$$

The change in area is the L-shaped region: two thin rectangles of area \( x \cdot dx \) each, plus a tiny square of area \( (dx)^2 \) that vanishes as \( dx \to 0 \).

x · dxx · dx(dx)²xdxxArea increase = 2x·dx + (dx)²As dx → 0, the rate of change is 2x
Increasing the side of a square by \( dx \) adds two green strips of area \( x \cdot dx \) each, plus a vanishing red corner \( (dx)^2 \). The derivative is the sum of the strips: \( 2x \).

This geometric argument makes the factor of 2 intuitive: a square has two sides that grow when you increase \( x \), each contributing \( x \cdot dx \) to the area change.

Why This Matters

This fallacy is more than a cute puzzle. It illustrates three fundamental principles:

  1. Multiplication is not repeated addition — at least not over the reals. The extension from integers to real numbers requires continuous operations, not discrete counting.
  2. Calculus requires continuity. The derivative is defined as a limit, which demands the function be defined on a continuous domain. Discrete identities (valid only at isolated integer points) cannot be differentiated.
  3. Operator rules have preconditions. The sum rule for differentiation requires a fixed number of terms. When the number of terms varies with the independent variable, you need the Leibniz integral rule or careful analysis of the limiting process.

For a deeper exploration of why “multiplication = repeated addition” breaks down, see Paul Lockhart’s A Mathematician’s Lament. For the greatest integer function used in the correct proof, see this video explanation.