Dealing with Generating Functions accurately I'm currently working through Iven Niven's "Mathematics of Choice." In the chapter on Generating Functions, the exercises include problems like:
How many solutions in non-negative integers does the equation $2x+3y+7z+9r=20$ have?
This of course ends up being the same as finding the coefficient of $x^{20}$ in $(1+x^2+x^4+x^6+\cdots+x^{20})(1+x^3+x^6+\cdots+x^{18})(1+x^7+x^{14})(1+x^9+x^{18})$. Maybe I'm just being a big weenie, but dealing with polynomials this large ends up being really tedious and error-prone. 
I've realized that you can save the most involved multiplication for last, since that requires the least detail, and I'm of course not bothering to keep track of any powers greater than the one I'm interested in. 
Any tips for keeping these giant polynomials manageable?

Frankly, I always resort to a computer algebra system at this point, but here is how I think Niven probably expected the problem to be done.  
There are some labor-saving tricks.  First, it usually pays to start with the sparser polynomials (those with fewer non-zero terms).  Second, you only have to work up to the highest degree needed for your answer-- $x^{20}$ in this case; higher powers can be discarded.  Finally, it may not be necessary to perform the final multiplication.  In detail, for this problem, let
$P_2 = 1 +  x^2 + x^4 + x^6 + x^8 + x^{10} + x^{12} + x^{14} + x^{16} + x^{18} + x^{20}\\
P_3 = 1 + x^3 + x^6 + x^9 + x^{12} + x^{15} + x^{18} \\
P_7 = 1 + x^7 + x^{14} \\
P_9 = 1 + x^9 + x^{18} \\$
Then, discarding any terms higher than $x^{20}$, we have
$P_7 P_9 = 1 + x^7 + x^9+ x^{14} + x^{16} + x^{18} + \dots$
next
$P_3 P_7 P_9 = 1 + x^3 + x^6 + x^7 + 2x^9 + x^{10} + 2x^{12} + x^{13} + x^{14} + 2x^{15} + 2x^{16} +x^{17} + 3x^{18} + 2x^{19} + x^{20} + \dots$
Now it is not necessary to compute $P_2 P_3 P_7 P_9$, because we are only interested in the coefficient of $x^{20}$ in the final product.  Since $P_2$ has only even powers of $x$, we can just read off the coefficients of $1, x^2, x^4, \dots , x^{20}$ in $P_3 P_7 P_9$ (the even-powered terms) and add them up:
$1 + 1 + 1 + 2 + 1 + 2 + 3 + 1 = 12$
So the final answer to the number of solutions is 12.
