This question is related to at least two previous questions: Finding the power series of a rational function and Computing the $n^{th}$ coefficient of the power series representing a given rational function
However, mine goes in a slightly different (and perhaps more general) direction. I want to obtain the general form of the coefficients of a power series representing some rational function. As it has been observed before, this can be done mechanically, and the Mathematica function SeriesCoefficient
does the magic. E.g. I ask
SeriesCoefficient[-2 ((1 + x)^2) (1 + x + x^2)/((1 - x)^4 (x^2 - 1)), {x, 0, n}]
and I get the answer $(1+n)^2(4+2n+n^2)/2$. Now, does anybody know how Mathematica does it? Ultimately, what I want to know is whether you can trust that answer blindly, i.e. whether it is not necessary to PROVE that result in a paper, say. Thank you very much in advance.