What is wrong with this derivation of $\frac{d}{dx}x^2$? We have simple function:
$$Y = X^2$$
Writing $X^2$ as: $X^2 = \underbrace{X+X+X+...+X}_{X \text{ times}}$
We can write above equation as:
$$ Y = \underbrace{X+X+X+...+X}_{X \text{ times}}$$
Differentiating with respect to $X$, we get: 
$$
\frac{dY}{dX} = \underbrace{1+1+1+1+........+1}_{X \text{ times}}\\
\frac{dY}{dX} =X
$$
Since it is known that result must be: 
$$\frac{dY}{dX}= 2X$$
I just want to know what is wrong with the above derivation. 
 A: Let's say we play along, just to see what happens. We have
$$
X^2 = X+X+X+\cdots +X\tag{$X$ times}
$$
as well as
$$
(X+h)^2 = X + X + \cdots + X + h+h+\cdots + h \tag{$X+h$ times}
$$
Now, by applying the definition of derivative, we get
$$
\frac {dY}{dX} = \lim_{h \to 0}\frac{(X+h)^2 - X^2}{h}\\
= \lim_{h \to 0}\frac{\overbrace{X+X+\cdots+X}^{X+h - X = h\text{ times}} + \overbrace{h + h +\cdots + h}^{X+h\text{ times}}}{h}\\
= \lim_{h \to 0}\left(\frac{\overbrace{X+X+\cdots+X}^{h\text{ times}}}{h} + \frac{\overbrace{h + h +\cdots + h}^{X+h\text{ times}}}{h}\right)\\
= \lim_{h \to 0}\left(\frac{hX}{h} + \frac{(X+h)h}{h}\right)\\
= \lim_{h\to 0} (X + X+h) = 2X
$$
I still don't approve (although I do admit it was a fun exercise), but just like pretending $\frac{dY}{dX}$ is an actual fraction that can be simplified gives the correct chain rule, this does give the correct result in the end.
A: $$Y = X^2$$
Wrong: $X^2$ as : $X^2 = X+X+X+...........+X$ $(n\,times, n=2, \implies n X )$ in this case,
Right:  $X^2$ as : $X^2 = X * X * X * .....X$ $(n \,times, n=2 ,\implies X^n )$ in this case.
Although multiplication is repeated addition and exponentiation is repeated multiplication, they should not be confused as to their original operative application.
