Prove that $p_2(n) = \left \lfloor{\frac{n}{2}}\right \rfloor+1$ using the identity $$\frac{1}{(1-x)(1-x^2)}=\frac{1}{2}\left(\frac{1}{(1-x)^2}\right)+\frac{1}{2}\left(\frac{1}{1-x^2}\right)$$
where $p_k(n)$ is the number of partitions of an integer $n$ into a most $k$ parts. The generating function $P_k(x)$ of $\{p_k(n)\}$ is $$P_k(x) = \frac{1}{\prod_{r=0}^{k}(1-x^k)}$$ Therefore, the generating function $P_2(x)$ of ${p_2(n)}$ is $$P_2(x) = \frac{1}{(1-x)(1-x^2)}$$ Now I see here that we can use the identity given above, but I am confused of how to apply it to prove the desired statement.
Note that $$\begin{align}\frac{4}{(1-x)(1-x^2)}&=\frac{1}{1+x}+\frac{1}{1-x}+\frac{2}{(1-x)^2}\\ &=\frac{1}{1+x}+\frac{1}{1-x}+\frac{d}{dx}\left(\frac{2}{1-x}\right)\\ &=\sum_{n=0}^{\infty}(-x)^n+\sum_{n=0}^{\infty}x^n +2\sum_{n=1}^{\infty}nx^{n-1}\\ &=\sum_{n=0}^{\infty}((-1)^n+1+2(n+1))x^n \end{align}$$ Can you take it from here?