[Math] Give a formula for the coefficient of $x^{k}$ in the expansion of $(x+{1 \over x})^n$

binomial-coefficients

I followed the binomial theorem and got this:

The Binomial Theorem is: $(a+b)^{n}= \sum_{k=0}^{n} {n \choose k}{a}^{k}{b}^{n-k}$

Then let $a=x, b={1\over x}, n = n, k = k.$

I then get $\sum_{j=0}^{n}{n \choose j}{x}^{j}{1 \over x}^{n-j}$

I'm not sure if I'm doing it right. Can someone help me out with this?

Best Answer

\begin{align*} \left( x+\frac{1}{x} \right)^{n} &= x^{-n}\left( x^{2}+1 \right)^{n} \\ &= x^{-n}\sum_{j=0}^{n} \binom{n}{j} x^{2j} \\ &= \sum_{j=0}^{n} \binom{n}{j} x^{2j-n} \end{align*}

\begin{align*} k &= 2j-n \\ c_{k} &= \frac{1+(-1)^{n+k}}{2} \binom{n}{\frac{n+k}{2}} \end{align*}