$n^{\text{th}}$ term of The Maclaurin Expansion of $\dfrac{1}{(1-x)^3(1+x)(1+x+x^2)}$? I am trying to find the coefficient of $n^{\text{th}}$ term of the Maclaurin series of $$\dfrac{1}{(1-x)^3(1+x)(1+x+x^2)}.$$
How can I find the coefficient of $n^{\text{th}}$ term of this function?
 A: You should be able to do the third term in your decomposition.
For the second term, follow Mark Bennet's hint:  write the fraction as $$\frac{x+2}{9(1+x+x^2)} = \frac{(x+2)(1-x)}{9(1-x^3)} = \frac{2-x-x^2}{9} \cdot \frac{1}{1-x^3},$$ then write the second factor as an infinite geometric series with common ratio $x^3$.
For the first term, you need to observe that $$f(x) = \frac{1}{1-x} = \sum_{k=0}^\infty x^k$$ implies $$f'(x) = \frac{1}{(1-x)^2} = \sum_{k=1}^\infty kx^{k-1},$$ and $$f''(x) = \frac{2}{(1-x)^3} = \sum_{k=2}^\infty k(k-1) x^{k-2}.$$  Then you have to put this all together and collect like powers in $x$.  Tedious, but computationally feasible.
A: Using the hint of Mark Bennet you can write
$$ \dfrac{1}{(1-x)^3(1+x)(1+x+x^2)} = \dfrac{1}{(1-x)(1-x)(1+x)(1-x)(1+x+x^2)} = \dfrac{1}{(1-x)(1-x^2)(1-x^3)}. $$
Now, notice that for each fixed $j = 1, 2, 3$ we have:
$$ \frac{1}{1 - x^j} = 1 + x^j + x^{2j} + \ldots$$
Denote by $c_n$ the $n$-th coeficient of your rational function. Then, multiplying the known power series $\frac{1}{1-x^j}$ for $j = 1, 2, 3$ we discover
$$ c_n = \# \{(n_1, n_2, n_3); n_j \geq 0, n_1 + 2n_2 + 3n_3 = n\}$$
Now, you have a combinatorial problem. As Nil pointed out, there is a related post on this kind of problem. I'm following the ideas there. 
First of all, notice that for any fixed $n$ the non-negative solutions of $x + 2y = n$ are described by first choosing some $0 \le 2y \le n$ and then noticing that $x$ is fixed after $y$ is chosen. Thus, you have $\lfloor \frac{n}{2} \rfloor + 1$ solutions.
For the problem we are interested in, first we choose $0 \le 3n_3 \le n$. There are $\lfloor \frac{n}{3} \rfloor + 1$ choices for this. Fixed this first choice, you have exactly $\lfloor \frac{n - 3n_3}{2} \rfloor + 1$ choices for the pair $(n_1, n_2)$. Thus, you can write:
$$ c_n = \sum_{z=0}^{\lfloor \frac{n}{3} \rfloor} \left( \lfloor \frac{n - 3z}{2} \rfloor + 1 \right) = 1 + \lfloor \frac{n}{3} \rfloor + \sum_{z=0}^{\lfloor \frac{n}{3} \rfloor} \lfloor \frac{n - 3z}{2} \rfloor.$$
A: As noted by @Daniel, it equals $1/(1-x)(1-x^2)(1-x^3)$.  Another way to put that is $$\frac{(1+x+...+x^5)(1+x^2+x^4)(1+x^3)}{(1-x^6)^3}$$
