What's wrong in this equation? What's wrong in this equation?
$$\underbrace{x+x+x+x+\cdots+x}_{x \textrm{ times}}=x^2$$
now differentiate w.r.t. 'x' both sides
$$\underbrace{1+1+1+1+\cdots+1}_{x \textrm{ times}}=2x$$
So, $$x=2x$$ but how?

My friend gave me this and I know there is some problem with this, but what?
Any help will be appreciated.
 A: This is simply wrong because the expression
$$
x+x+\cdots+x\quad(x\text{ times})
$$
does not make sense unless $x$ is an integer. For instance if $x=2.5$, then what is $2.5+\cdots+2.5$ ($2.5$ times)? Furthermore, you cannot differentiate term-by-term since the number of terms also depends on $x$.
Note that also $$x^2=1+1+\cdots + 1\quad (x^2 \text{ times})$$ where the right-hand side has derivative zero. This means that everything has derivative $0$ because $f(x)=1+\cdots + 1$ ($f(x)$ times) for any function $f$ according to this logic.
A: In your second line, you are treating $x$ as a constant, which is where you go wrong.
If you really want to take multiplication as repeated addition, then $x^2$ should be written as $x \times x$, and then differentiated using the chain rule.
$\frac{d}{dx} (x \times x) = \big(\frac{d}{dx} x \big) \times x + x \times \big(\frac{d}{dx}x\big) = x + x = 2x$.
You miss one of them when you say $\text{x times}$, where you are assuming $x$ to be constant, whereas it is a variable.
A: You cannot differentiate since the number of summands depends on $x$. Moreover, if you  differentiate in such a manner the second equation, you will get $0=2$.
A: your first equal is true only for integer X.and so with attention to define of differentiate we can not differentiate form this equal(your equal must be true at an interval at least , it must be true at a neighberhood )
