Integral of infinite G.P. : $ \int 1+ 2x+ 3x^2 + 4x^3 ...... \, dx $ In this $$\int 1+ 2x+ 3x^2 + 4x^3 ...... \, dx $$
textbook solution goes like let $$ S = 1+ 2x+ 3x^2 + 4x^3 ...... $$ (call this equation 1,  then multiple both sides by x , we get $$ Sx= x + 2x^2 + 3x^3 + 4x^4 ...... $$ (call this equation 2), now subtract equation 2 from 1, we get $$ S-Sx= 1 + x^2 + x^3 + x^4 .... $$ now in this right hand side is sum of an infinite G.P. with a=1 and r=x, sum of infinite G.P. is $ \frac{a}{(1-r)} $ so we finally get $$ S(1-x) = \frac{1}{(1-x)} $$ thus $$ S = \frac{1}{(1-x)^2} $$ Now integrating $$ \int \frac{1}{(1-x)^2} \ dx = \frac{1}{(1-x)} + c $$ (where c is an arbitrary constant).
however I can also integrate series as it is, by separating the integration over addition, $$\int 1 \ dx + \int 2x \ dx + \int 3x^2 \ dx + ..... $$  I will get $$ x + x^2 + x^3 + x^4.... + c $$ this is correct as derivative of series $ x + x^2 + x^3 + x^4+.... $ is $ 1+ 2x+ 3x^2 + 4x^3 ....... $, Now $ x + x^2 + x^3 + x^4+... $ is also a sum of infinite G.P. with a=x and r=x so I finally get $\frac{x}{(1-x)} + c$, why I am getting a different answer, I don't understand.

They are actually the same, up to the famous constant:
$$\frac{x}{1-x}=\frac{1}{1-x}-1$$
