Find the generating function of the number of non-negative integer solutions to the equation: $x_1+x_2+x_3+x_4+x_5+x_6+x_7+x_8=n$ where $x_1+x_2+x_3+x_4$ is even and $x_5+x_6+x_7+x_8$ is odd.
I have a possible solution but I don't know if it is right.
The generating function of the number of non-negative integer solutions to $x_1+x_2+x_3+x_4=k$ is given by:$$\frac{1}{(1-x)^4}$$
Now we want to get the function s.t the coefficients of the odd terms are $0$ and similarly another function s.t the coefficients of the even terms are $0$.
The functions can be derived as follows:$$\frac{1}{2}\left(\frac{1}{(1-x)^4}+\frac{1}{(1+x)^4}\right)$$ and $$\frac{1}{2}\left(\frac{1}{(1-x)^4}-\frac{1}{(1+x)^4}\right)$$
Hence, the final generating function we want would be:$$\frac{1}{2}\left(\frac{1}{(1-x)^4}+\frac{1}{(1+x)^4}\right)\cdot\frac{1}{2}\left(\frac{1}{(1-x)^4}-\frac{1}{(1+x)^4}\right)=\\\frac{1}{4}\left(\frac{1}{(1-x)^8}-\frac{1}{(1+x)^8}\right)$$
Is this solution correct?