Let $(1+x-2x^2)^{20} = \sum_{r=0}^{40} a_r x^r.\;\;$ Find $$a_1+a_3+a_5+\cdots+a_{37}+a_{39}$$
I mean, at first, I don't have any idea how this can be solved. I tried factorizing the LHS: $((2x-1)(1-x))^{20}$ and then using binomial theorem, I get something like:
$$\Biggl(\binom{20}0(2x)^{20}-\binom{20}1(2x)^{19}+\binom{20}2(2x)^{18}-\binom{20}3(2x)^{17}+\cdots-\binom{20}{19}(2x)+1\Biggr)\Biggl(\binom{20}0(x)^{20}-\binom{20}1(x)^{19}+\binom{20}2(x)^{18}-\binom{20}3(x)^{17}+\cdots-\binom{20}{19}(2x)+1\Biggr)$$
Expanding the RHS:
$$a_0+a_1x^1+a_2x^2+\cdots+a_{39}x^{39}+a_{40}x^{40}$$
But I don't get what to do after this. Taking $x$ common doesn't help, nor in the former equation($2x$).
So how do we do it? A hint would be nice.
If you have a polynomial $f(x)=a_0+a_1x+a_2x^2+\cdots +a_n x^n$, then the sum of the odd indexed coefficients is $$a_1+a_3+\cdots=\frac{f(1)-f(-1)}2.$$ Here you know what $f(x)$ is.