First, there was a question that stated: $g(x) = \frac{1}{1+x}$, with the power series representation being $\sum_{n=0}^\infty (-1)^nx^n$.
The second question was as follows: find the power series representation for $h(x) = \frac{-1}{(1+x)^2}$.
My method was to define $h(x)$ = $g'(x)$, and I got a power series like $-1+2x-3x^2+...$
My classmate's method was to define $h(x) = -g^2(x)$ and he got something along the lines of $-1+x^2-x^4+...$
As you can tell, these are very different results. Whose method is correct (if any) and what mistake was made?
Further to the comments, let's prove without calculus that $(1-x+x^2-\cdots)^2=1-2x+3x^2-4x^3+\cdots$ as expected. The left-hand side's $x^n$ coefficient is $\sum_{j=0}^n(-1)^j(-1)^{n-j}=\sum_j(-1)^n=(n+1)(-1)^n$, as required.