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.

Written by

Gaurav Tiwari

WordPress Developer & Content Strategist, CEO · Gatilab · New Delhi, India

18+Years experience
1,215Articles published
4Focus areas

Gaurav Tiwari is a WordPress developer, content marketer, educator, and entrepreneur with 18+ years of hands-on experience building websites, tools, content systems, and growth engines for brands. He is the founder and team lead of Gatilab, where he helps businesses turn slow, confusing websites into fast, clear, conversion-focused platforms. Since 2008, he has published thousands of articles on technology, SEO, blogging, education, business, and web performance, reaching readers who want practical advice without fluff. His work spans WordPress development, search strategy, performance optimization, affiliate marketing, digital publishing, and product-led growth. Gaurav has worked with brands such as IBM, Adobe, HubSpot, Canva, Airtel, Acer, and FreshBooks, while also building education and resource platforms for Indian learners and creators. He writes from experience, mixing technical depth with plain English, honest opinions, and lessons learned from real client work. That blend makes his writing useful for founders, bloggers, students, and independent professionals alike.

WordPress Core Contributor, 18+ years experience, 1100+ client projects

Writes aboutWordPressWeb DevelopmentSEOMarketing

5 comments

Add yours

Leave a Comment

  1. You simply failed to take account of the fact that not only the value of x changes, but also the size of the set itself, which you didn’t. In reaction to the second reply:

    x² = xW(x)+xF(x) Why not just write x² = xW(x) = x*x ? Then you can differentiate this by parts as well.

    And why isn’t multiplication repeated addition? The blog only says it isn’t, without explaining why. As far as I know, multiplication is repeated addition. This fact is very useful if you need to multiply long numbers, like 1,345,843 *3,464,901, in your head or with paper.

  2. Hi! Thanks for your comment. $ x^2 =x+x+x+ldots +x$ is true, if and only if x is a positive integer.
    But x*x is as same as:
    x*x =x*([x]+{x})
    where [x] is integer part of x and {x} is fractional part of x. This post is very old and it need to be edited since I had used W(x) and F(x) for [x] and {x} respectively.

    Regarding, multiplication is not repeated addition: How can you explain— $ {5.74}^2$, or $ {-4}^2$ as addition? One can’t add any number fractional number or negative number of times.

  3. Hi! Thanks for your comment. $ x^2 =x+x+x+ldots +x$ is true, if and only if x is a positive integer.
    But x*x is as same as:
    x*x =x*([x]+{x})
    where [x] is integer part of x and {x} is fractional part of x. This post is very old and it need to be edited since I had used W(x) and F(x) for [x] and {x} respectively.

    Regarding, multiplication is not repeated addition: How can you explain— $ {5.74}^2$, or $ {-4}^2$ as addition? One can’t add any number fractional number or negative number of times.

    • $4$ is a fixed positive integer. You can add things upto 4 times, but not all $ x in mathbb{R}$. Differentiation, here, is defined on real numbers.