Where is the flaw in this "proof" that 1=2? (Derivative of repeated addition) Consider the following:


$1 = 1^2$
$2 + 2 = 2^2$
$3 + 3 + 3 = 3^2$


Therefore,


$\underbrace{x + x + x + \ldots + x}_{x \textrm{ times}}= x^2$


Take the derivative of lhs and rhs and we get:


$\underbrace{1 + 1 + 1 + \ldots + 1}_{x \textrm{ times}} = 2x$


Which simplifies to:


$x = 2x$


and hence 


$1 = 2$.




Clearly something is wrong but I am unable pinpoint my mistake.
I think the discrete/continuous issue is sort of a red herring.  To me, the problem is forgetting to use the chain rule!

To un-discretize, think of the function $F(u,v) = uv$, which we could think of as $u + \dots + u$, $v$ times.  Then $x^2 = F(x,x)$.  Differentiating both sides gives $2x = F_u(x,x) + F_v(x,x)$, which is perfectly true.  In the fallacious example, the problem is essentially that the $F_v$ term has been omitted.  In some sense, one has forgotten to differentiate the operation "$x$ times" with respect to $x$!  Of course, the notation makes this easier to do.
Even if x were to be an integer, once you have x=2x, a possible value for is 0 which would make that equation true. Thus if x can be zero, then you are simply dividing by a variable that equals 0. And you cannot divide by zero!!!!