The fallacy is that you are differentiating wrt x, but your function is not definded until x itself is defined, but then x will be a constant. Moreover: in d/dX (X+X+X……..Xtimes) the "function" in the brackets is NOT defined at the time of differentiation and so cannot be differentiated.

For a different way of saying this see http://www.qbyte.org/puzzles/p032s.html

Mitch