$1-x+x^2-x^3+..(-1)^nx^n$

4.4k Views Asked by At

I have the following sum:

$1-x+x^2-x^3+..(-1)^nx^n, x\neq -1$

So what I thought was separating it in two cases like this:

Case 1. n is even $$ 1+x^2+x^4+...+x^n-x(1+x^2+...+x^n) $$

Which I can turn into $\frac{1-x^{n+2}}{1-x^2}-\frac{x(1-x^{n+2})}{1-x^2}=\frac{1-x^{n+2}}{1-x^2}(1-x)$

Case 2. n is odd $$ 1+x^2+x^4+...+x^{n-1}-x(1+x^2+...+x^{n-1})=\frac{1-x^{n+1}}{1-x^2}-x(\frac{1-x^{n+1}}{1-x^2}) $$

My question is: Assuming what I've written is correct, which I'm not entirely sure, how can I combine the two cases for n even and odd into one equation?

4

There are 4 best solutions below

0
On BEST ANSWER

It should be $$\frac{(1-x)(1-(-1)^{n+1}x^{n+1})}{1-x^2} = \frac{1-(-1)^{n+1}x^{n+1}}{1+x}$$ But why make it complicated? This is just a geometric series $\sum_{i=0}^n (-x)^i$.

0
On

As far as I can tell, it is correct what you do. It is easier though to recognise the sum as $\sum_{i = 0}^{n} (-x)^i$ and then use the standard technique to turn it into $\frac{1 - (-x)^{n + 1}}{1 - -x}$

0
On

Call $S(x)$ your sum and note that $$ S(x)(1+x)=1+(-1)^{n}x^{n+1}. $$

0
On

$$S(n)=1-x+x^2-x^3+..(-1)^nx^n$$ multiply by $+x $ $$xS(n)=x-x^2+x^3...(-1)^{n-1}x^n+(-1)^nx^{n+1}$$ now find add $S(n) ,xS(n)$ so

$$s(n)+xS(n)=1+(x-x)+(x^2-x^2)+....+((-1)^{n-1}x^n+(-1)^nx^n)+(-1)^nx^{n+1}\\S(n)(x+1)=1+(-1)^nx^{n+1}\\ s(n)=\frac{1+(-1)^nx^{n+1}}{1+x}=\\ \frac{1+(-1)(-1)^{n+1}x^{n+1}}{1+x}=\\ \to \\ S(n)=\frac{1-(-1)^{n+1}x^{n+1}}{1+x}$$