Little question about differentiation My friend told me a wrong proof which involves differentiation, but I cannot point out where he has been wrong.
$x^2 = x + x + x + … + x$ (total $x$ terms)
${\frac d {dx} x^2} = {\frac d {dx} (x + x + x + … + x)}$
$2x = 1 + 1 + 1 + … + 1$ (total x terms of 1)
$2x = x$
$2 = 1$
Can someone points out where is wrong?
 A: $2$ major mistakes:


*

*
$x^2 = x + x + x + … + x$ (total x terms)

Here, you have unknowingly assumed that $x$ is a positive integer.


*The $x$ used is no longer a variable (due to the above reason) and cannot be differentiated.

A: Your first line is incorrect. The equation
$$
x^2=\underbrace{x+x+\dotsb+x}_{x\text{ times}}
$$
makes no sense when $x$ is not a non-negative integer. 
A: This has been covered many times, but my question/hint would be this for you: how would you write the right-hand side of your initial statement if $x=1.5$? Or if $x$ was any non-integer? What do you know about differentiation that you can apply here?
Recall that the definition of the derivative of a function $f(x)$ is:
$f'(x)=\lim\limits_{h\to 0}\dfrac{f(x+h)-f(x)}{h}$.
Notice that your right side requires $x$ to be an integer, or there is no way to write it. Hence, your function is defined only for integer $x$ and is therefore not differentiable at any point, since $f(x+h)$ is not defined as $h\to 0$.
A: Because when you increase $x$ the number of terms in $x+x+\ldots+x$ also increases, your second line should have been
$$
\frac{d}{dx}x^2 = = \frac{d}{dx}(x+x+\ldots+x) + x
$$
If you make this change, your last line comes out $$
2=2$$
 By the way, the steps in your reasoning are pretty shakily defined anyway.
