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.
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.