Sum the series upto n-terms : 1+(1+x)+(1+x+x^2)+(1+x+x^2+x^3)...............

Answer in the book is [n/(1-x)] - [x(1-x)^n / (1-x)^2]

The answer is in the book, but i dont know how to find it. I need the full solution for the problem by step by step. Can you please anybody give me help to solve this?