I have been at this for hours and I don't know what I am doing wrong. It's partial fraction decomposition that I am doing but I just can't seem to get what I am supposed to
$$\int\frac{3x^3+1}{x^3-x^2+x-1}dx$$
so the bottom would be
$x^2(x-1)+(x-1)$ which turns into $(x-1)(x^2+1)$
then I separate by
$$\frac{a}{x-1}+\frac{bx+c}{x^2+1}$$
I then got
$$a(x^2+1)+(bx+c)(x-1)$$
$$ax^2+a+bx^2-bx+cx-c$$
it would mean that $a+b=0$ and $-b+c=0$ and $a-c=1$
I got, $a=1/2$ $b=-1/2$ and $c=-1/2$
Did I solve my A right?
My final answer ended up being $$\frac{1}{2}\ln(x-1)-\frac{1}{4}\ln \left|x^2+1\right|-\frac{1}{2}\arctan \left(x\right)+C$$
It's just that when I take the derivative of my answer, it's just 1 as the numerator as opposed to $3x^3+1$
$$\int\frac{3x^3+1}{x^3-x^2+x-1}dx$$ To evaluate this, we have to split the function into partial fraction. \begin{align*} &\frac{3x^3+1}{x^3-x^2+x-1} = A + \frac{B}{x-1} + \frac{Cx + D}{x^2 + 1}\\ \implies &3x^3 + 1 = A(x^3 - x^2 + x - 1) + B(x^2 + 1) + (Cx + D)(x-1)\\ \implies & 3x^3 +1 = Ax^3 - Ax^2 + Ax - A + Bx^2 + B + Cx^2 - Cx + Dx - D\\ \implies & 3x^3 +1 = Ax^3 + (C-A + B)x^2 + (A-C+D)x - A + B - D \end{align*} Comparing coefficients, we obtain: \begin{align*} A &= 3\\ C-A+B &= 0\\ A-C+D &= 0\\ B-A-D &= 1 \end{align*} Since $A = 3$, we have that $$C + B = 3$$ $$D-C = -3$$ $$B-D = 4$$ From the third equation, $B = 4 + D$. Substituting this value into the first equation, we obtain$$C + D = -1$$ Solving \begin{align*} D + C &= -1\\ D - C &= -3 \end{align*} we obtain $2D = -4 \implies D = -2, C = 1$. Also, $B = 4 + D \implies B = 2$.
Hence, $A = 3, B = 2, C = 1, D = -2$ $$\implies \frac{3x^3+1}{x^3-x^2+x-1} = 3 + \frac{2}{x-1} + \frac{x-2}{x^2+1}$$
$$ \therefore \int\frac{3x^3+1}{x^3-x^2+x-1} = \int \left[3 + \frac{2}{x-1} + \frac{x-2}{x^2+1}\right]dx$$
$$ = 3x + 2ln(x-1) + \frac{1}{2}ln(x^2+1) - 2tan^{-1}x$$