Binomial summation with alternating terms?

How do I solve problems of type :$$\sum_{k=1}^{(n+1)/2}\binom n{2k-1}x^k\text{ or }\sum_{k=0}^{n/2}\binom n{2k}x^k$$

I tried transferring the binomial to $n-1$ but the repeating $x^k$ makes it weird.

Edit: I started with $$(1+x)^n+(1-x)^n$$ with $x=\sqrt5$

• @robjohn but the power of x will be changed then no? – Anvit Apr 13 '18 at 15:19
• I don't see the question, now. Your edit says you started with what seemed to be almost the answer. – robjohn Apr 13 '18 at 15:20
• the power of $x$ will be $2k$ in what you started with, so you will need to use $\sqrt{x}$ in the final form. – robjohn Apr 13 '18 at 15:21
• I cant really expand $(1+\sqrt5)^{16}+(1-\sqrt5)^{16}$ directly, can I? – Anvit Apr 13 '18 at 15:22
• why not? the odd powers of $\sqrt5$ will cancel and you'll be left with twice the even powers of $\sqrt5$, which are integer powers of $5$. – robjohn Apr 13 '18 at 15:23

You can use the binomial theorem twice, $$(1+x)^n=\sum_{k=0}^n{\binom{n}{k}x^k}\\ (1-x)^n=\sum_{k=0}^n{(-1)^k\binom{n}{k}x^k}$$ If $E$ is the sum of the even terms, and $O$ the sum of the odd terms, we have $$(1+x)^n=E+O\\ (1-x)^n=E-O$$

• My bad but that's where i started with $x=\sqrt5$ – Anvit Apr 13 '18 at 15:16
• So $E=((1+\sqrt 5)^n+(1-\sqrt 5)^n)/2$ etc. What's the problem? – saulspatz Apr 13 '18 at 15:20

Hint

Consider $$(1+x)^n+(1-x)^n=\sum_{k=0}^n\binom{n}{k}(1+(-1)^k)x^k$$ and $$(1+x)^n-(1-x)^n=\sum_{k=0}^n\binom{n}{k}(1-(-1)^k)x^k$$ What can you say about $1+(-1)^k$ and $1-(-1)^k$ when $k$ is even or odd?

• I should've clarified. I started from here and wanted exact value of the term – Anvit Apr 13 '18 at 15:14
• @AFalseName: please clarify the question. – robjohn Apr 13 '18 at 15:15

Okay, now that you've added some context, I think I can answer this question. The Binomial Theorem says $$\left(1+\sqrt{x}\right)^n=\sum_{k=0}^n\binom{n}{k}x^{k/2}\tag1$$ and $$\left(1-\sqrt{x}\right)^n=\sum_{k=0}^n\binom{n}{k}(-1)^kx^{k/2}\tag2$$ Adding $(2)$ to $(1)$ and dividing by $2$ gives \begin{align} \frac12\left(\left(1+\sqrt{x}\right)^n+\left(1-\sqrt{x}\right)^n\right) &=\sum_{k=0}^n\binom{n}{k}\overbrace{\frac{1+(-1)^k}2}^{\text{1 when k is even}}x^{k/2}\\ &=\sum_{k=0}^{n/2}\binom{n}{2k}x^k\tag3 \end{align} Subtracting $(2)$ from $(1)$ and dividing by $2$ gives \begin{align} \frac12\left(\left(1+\sqrt{x}\right)^n-\left(1-\sqrt{x}\right)^n\right) &=\sum_{k=0}^n\binom{n}{k}\overbrace{\frac{1-(-1)^k}2}^{\text{1 when k is odd}}x^{k/2}\\ &=\sum_{k=1}^{(n+1)/2}\binom{n}{2k-1}x^{k-\frac12}\tag4 \end{align}