Let's say f(x) = x^2.

This would give f'(x) = 2x.

Now we change the definition of f(x) = x^2 to f(x) = x + x + x... up to x times.

If we now differentiate it with respect to x, we will get f'(x) = d(x)/dx + d(x)/dx + d(x)/dx ....up to x times. And this sums up to x. Thus according to new definition of f(x), the derivative f'(x) would be x and not 2x.

Though we all know that there is some gap in calculating the derivative in second method, what is the missing thing here? How can it be captured to cover every aspect?