Partial fraction: is my final answer and computation correct? I need some help at this exercise (partial fraction): $$\int{\frac{4x + 1}{x^3(x+2)}} dx$$
First of all I calculated the roots of the denominator.
$$
x_{1, 2, 3} = 0 \\
x_4 = -2
$$
After that I assigned the roots to the partial fraction.
$$
\frac{A_1}{x}, \frac{A_2}{x^2}, \frac{A_3}{x^3}, \frac{B}{(x+2)} \\
\frac{4x + 1}{x^3(x+2)} = \frac{4x + 1}{x^3(x+2)} = \frac{A_1}{x} + \frac{A_2}{x^2} + \frac{A_3}{x^3} + \frac{B}{(x+2)} \\
4x + 1 = A_1x^2(x+2) + A_2x(x+2) + A_3(x+2) + Bx^3 \\
4x + 1 = A_1(x^3+2x^2) + A_2(x^2+2x) + A_3(x+2) + Bx^3 \\
$$
Then I insert the root values.
For $-2$, I get $B = \frac{7}{8}$. For $0$ I get $A_3 = \frac{1}{2}$.
After that I insert two additional numbers, I choose $1$ and $-1$.
I transformend the equation to $A_1$ and $A_2$ and get $A_1 = \frac{23}{20}$ and $A_2 = \frac{197}{120}$.
$$
\frac{4x + 1}{x^3(x+2)} = \frac{\frac{23}{20}}{x} + \frac{\frac{197}{120}}{x^2} + \frac{\frac{1}{2}}{x^3} + \frac{\frac{7}{8}}{(x+2)}
$$
Could anyone tell me if it's correct? I belive it is wrong :), where is my misstake?
 A: Reduce the RHS to a common denominator
$$\begin{eqnarray*}
\frac{4x+1}{x^{3}(x+2)} &=&\frac{A_{1}}{x}+\frac{A_{2}}{x^{2}}+\frac{A_{3}}{
x^{3}}+\frac{B}{x+2} \\
&=&\frac{A_{1}x^{2}\left( x+2\right) +A_{2}x\left( x+2\right) +A_{3}\left(
x+2\right) +Bx^{3}}{x^{3}(x+2)} \\
&=&\frac{\left( A_{1}+B\right) x^{3}+\left( 2A_{1}+A_{2}\right) x^{2}+\left(
2A_{2}+A_{3}\right) x+2A_{3}}{x^{3}(x+2)}.
\end{eqnarray*}$$
You can proceed by equating coefficients of
$$\begin{equation*}
4x+1=\left( A_{1}+B\right) x^{3}+\left( 2A_{1}+A_{2}\right) x^{2}+\left(
2A_{2}+A_{3}\right) x+2A_{3}. 
\end{equation*}$$
So$^1$
$$\begin{eqnarray*}
2A_{3} &=&1\Leftrightarrow A_{3}=\frac{1}{2} \\
2A_{2}+\frac{1}{2} &=&4\Leftrightarrow A_{2}=\frac{7}{4} \\
2A_{1}+\frac{7}{4} &=&0\Leftrightarrow A_{1}=-\frac{7}{8} \\
-\frac{7}{8}+B &=&0\Leftrightarrow B=\frac{7}{8},
\end{eqnarray*}$$
and
$$\begin{equation*}
\frac{4x+1}{x^{3}(x+2)}=-\frac{7}{8}\frac{1}{x}+\frac{7}{4}\frac{1}{x^{2}}+
\frac{1}{2}\frac{1}{x^{3}}+\frac{7}{8}\frac{1}{x+2}.
\end{equation*}$$
--
$^1$ It corresponds to solve the system
$$\left\{ 
\begin{array}{c}
A_{1}+B=0 \\ 
2A_{1}+A_{2}=0 \\ 
2A_{2}+A_{3}=4 \\ 
2A_{3}=1
\end{array}
\right. $$
ADDED. Your method works just as well, but you have made some mistake in the computation.

Then I insert the root values. For $-2$, I get $B = \frac{7}{8}$. For
  $0$ I get $A_3 = \frac{1}{2}$. After that I insert two additional
  numbers, I choose $1$ and $-1$.

Using
$$\begin{equation*}
4x+1=A_{1}x^{2}\left( x+2\right) +A_{2}x\left( x+2\right) +A_{3}\left(
x+2\right) +Bx^{3}
\end{equation*}$$
you get for $x=1$
$$\begin{equation*}
5=3A_{1}+3A_{2}+\frac{3}{2}+\frac{7}{8},
\end{equation*}$$
and for $x=-1$
$$\begin{equation*}
-3=A_{1}-A_{2}+\frac{1}{2}-\frac{7}{8},
\end{equation*}$$
whose solutions are  $A_{2}=\frac{7}{4},A_{1}=-\frac{7}{8}$ as above and not $A_1 = \frac{23}{20}$, $A_2 = \frac{197}{120}$.
