<s>[INST] Integral $\int \frac{2x^5-2x^4+2x^3+3}{2x^4-2x^3-x^2+1}dx$ as partial fraction solved using matrix equation in order to solve the integral $$\int \frac{2x^5-2x^4+2x^3+3}{2x^4-2x^3-x^2+1}\mathrm dx,$$
the expression inside the integral can be expressed as
$$(2x^5-2x^4+2x^3+3/2x^4-2x^3-x^2+1)= x+(A/(x-1))+(B/(x-1)^2)+(Cx+D/2x^2+2x+1)$$
from here I have been ask to set up the system of linear simultaneous equations that are needed to be solved to calculate the integral, by utilising MX=Z, where M is the coefficient matrix, X is the solution vector containing the coefficients, and Z is the RHS of the matrix equation 
I have attempt to do this by factoring the LHS denominator to the form of 
$$(x-1)^2(2x^2+2x+1)$$ and then multiplied both sides by this giving the resulting equation 
$$2x^5-2x^4+2x^3+3 = 2x^5-2x^4+2x^3+3+A(x-1)(2x^2+2x+1)+B(2x^2+2x+1)+CxD(x-1)^2$$
if I subtract $(2x^5-2x^4+2x^3+3)$ from LHS I am left with 
$$LHS = 3x^3-x+3$$
I have tried expanding out the rest of the RHS and then collected like terms and to try and set up four equations
$3=2A+CD$
$0=2B-2CD$
$-1=-A+2B+CD$
$3=-A+B$
however, there is no solution. 
any help would be appreciated
 [/INST] Decompose the simplified integrand as,
$$\frac{3x^3-x+3}{(x-1)^2(2x^2+2x+1)}=\frac A{x-1}+\frac B{(x-1)^2}+\frac{Cx+D}{2x^2+2x+1}$$
The coefficients $A$, $B$, $C$ and $D$ are obtained successively as follows. Multiply both sides by $(x-1)^2(2x^2+2x+1)$
$$3x^3-x+3=A(x-1)(2x^2+2x+1)+B(2x^2+2x+1)+(Cx+D)(x-1)^2\tag 1$$
First, set $x=1$ to get $B=1$, which is plugged into (1) to get
$$(x+1)(3x-2)=A(2x^2+2x+1)+(Cx+D)(x-1)\tag 2$$
Then, set $x=1$ again to get $A=\frac25$, which is plugged into (2) to get
$$\frac15(11x+12) = Cx+D$$
which yields $C=\frac{11}5$ and $D=\frac{12}5$.
</s>