Problem 147
Hard Trigonometric Integrals

Evaluate the integral: I = integral (x²+x) ln(x+1) dx

Evaluate the integral: $$ I = \int \left(x^2+x\right)\ln(x+1)\,dx. $$

Explanation of Method

Integration by parts with $u=\ln(x+1)$, $dv=(x^2+x)\,dx$ leaves a leftover integral of two improper rational functions, each of which requires polynomial division — and each division leaves a genuine remainder term over $x+1$ that must be tracked through to the end.

  1. Choose $u=\ln(x+1)$, $dv=(x^2+x)\,dx$.
  2. Differentiate $u$ and integrate $dv$.
  3. Divide each leftover fraction, keeping the remainder terms.
  4. Integrate and combine everything, including the logarithmic remainder.

Step 1 · Set up integration by parts

Let:

$$ u = \ln(x+1) \quad \Rightarrow \quad du = \frac{dx}{x+1}, \qquad dv = (x^2+x)\,dx \quad \Rightarrow \quad v = \frac{x^3}{3}+\frac{x^2}{2}. $$

Step 2 · Apply the formula

$$ I = \left(\frac{x^3}{3}+\frac{x^2}{2}\right)\ln(x+1) - \int \left(\frac{x^3}{3}+\frac{x^2}{2}\right)\frac{dx}{x+1}. $$

Step 3 · Divide each term, keeping remainders

Polynomial division gives remainders that must not be dropped:

$$ \frac{x^3}{x+1} = x^2-x+1 - \frac{1}{x+1}, \qquad \frac{x^2}{x+1} = x-1 + \frac{1}{x+1}. $$

So the leftover integrand becomes:

$$ \frac13\left(x^2-x+1-\frac{1}{x+1}\right) + \frac12\left(x-1+\frac{1}{x+1}\right) = \frac{x^2}{3}+\frac{x}{6}-\frac16 + \frac{1}{6(x+1)}, $$

where the two remainder fractions combine as $-\tfrac13+\tfrac12=\tfrac16$ times $\tfrac{1}{x+1}$ — this term does not cancel and must be carried through.

Step 4 · Integrate and combine

Integrating the leftover piece:

$$ \int \left(\frac{x^2}{3}+\frac{x}{6}-\frac16+\frac{1}{6(x+1)}\right) dx = \frac{x^3}{9}+\frac{x^2}{12}-\frac{x}{6}+\frac16\ln|x+1|. $$

Subtracting this from the $uv$ term:

$$ I = \left(\frac{x^3}{3}+\frac{x^2}{2}\right)\ln(x+1) - \frac{x^3}{9}-\frac{x^2}{12}+\frac{x}{6}-\frac16\ln|x+1| + C. $$

Combining the two logarithm terms:

$$ I = \left(\frac{x^3}{3}+\frac{x^2}{2}-\frac16\right)\ln(x+1) - \frac{x^3}{9}-\frac{x^2}{12}+\frac{x}{6} + C. $$


Summary Table

Piece Contribution
$x^3/(x+1)$ remainder$-1/(x+1)$
$x^2/(x+1)$ remainder$+1/(x+1)$
Combined remainder$\tfrac16\cdot\tfrac{1}{x+1}$, integrates to $\tfrac16\ln|x+1|$

Additional Notes

Result

The solution to the integral is:

$$ I = \left(\frac{x^3}{3}+\frac{x^2}{2}-\frac16\right)\ln(x+1) - \frac{x^3}{9}-\frac{x^2}{12}+\frac{x}{6} + C. $$