Answer
$$\frac{1}{3} \ln |x+1|-\frac{1}{3} \ln |x+4|+\frac{8}{(x+4)^{2}}+C $$
Work Step by Step
Given $$\int \frac{\left(x^{2}-8 x\right) d x}{(x+1)(x+4)^{3}}$$
Since
\begin{align*}
\frac{\left(x^{2}-8 x\right)}{(x+1)(x+4)^{3}}&=\frac{A}{(x+1)}+\frac{B}{(x+4)}+\frac{C}{(x+4)^{2}}+\frac{D}{(x+4)^{3}}\\
&=\frac{A(x+4)^{3}+B(x+1)(x+4)^{2}+C(x+1)(x+4)+D(x+1)}{(x+1)(x+4)^{3}}\\
x^{2}-8 x&=A(x+4)^{3}+B(x+1)(x+4)^{2}+C(x+1)(x+4)+D(x+1)
\end{align*}
Then
\begin{align*}
\text{at } x&= -1\ \ \ \ \to A=1/3 \\
\text{at } x&= -4\ \ \ \ \to D=-16\\
\text{at } x&= 0\ \ \ \ \to 4B+C=-4/3\\
\text{at } x&= 1\ \ \ \ \to 5B+C=-5/3\\
\end{align*}
Hence $A=-1/3,\ \ C=0$ and
\begin{aligned}
\int \frac{\left(x^{2}-8 x\right) d x}{(x+1)(x+4)^{3}} &=\int \frac{\frac{1}{3} d x}{(x+1)}-\int \frac{\frac{1}{3} d x}{(x+4)}-\int \frac{16 d x}{(x+4)^{3}} \\
&=\frac{1}{3} \int \frac{d x}{(x+1)}-\frac{1}{3} \int \frac{d x}{(x+4)}-16 \int \frac{d x}{(x+4)^{3}} \\
&=\frac{1}{3} \ln |x+1|-\frac{1}{3} \ln |x+4|+\frac{8}{(x+4)^{2}}+C
\end{aligned}