where is the error ???

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

so
x^2 = x+x+x+x+x+x+x.........x times

Differentiate both dides w.r.t x

2x = 1+1+1+1+1......x times

so
2x = x ( 1+1+1...xtimes = x)

Hence 1=2 ??????