### 3.285 $$\int x^2 \log (1+x) \, dx$$

Optimal. Leaf size=39 $-\frac{x^3}{9}+\frac{x^2}{6}+\frac{1}{3} x^3 \log (x+1)-\frac{x}{3}+\frac{1}{3} \log (x+1)$

[Out]

-x/3 + x^2/6 - x^3/9 + Log[1 + x]/3 + (x^3*Log[1 + x])/3

________________________________________________________________________________________

Rubi [A]  time = 0.0150372, antiderivative size = 39, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 8, $$\frac{\text{number of rules}}{\text{integrand size}}$$ = 0.25, Rules used = {2395, 43} $-\frac{x^3}{9}+\frac{x^2}{6}+\frac{1}{3} x^3 \log (x+1)-\frac{x}{3}+\frac{1}{3} \log (x+1)$

Antiderivative was successfully veriﬁed.

[In]

Int[x^2*Log[1 + x],x]

[Out]

-x/3 + x^2/6 - x^3/9 + Log[1 + x]/3 + (x^3*Log[1 + x])/3

Rule 2395

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))*((f_.) + (g_.)*(x_))^(q_.), x_Symbol] :> Simp[((f + g
*x)^(q + 1)*(a + b*Log[c*(d + e*x)^n]))/(g*(q + 1)), x] - Dist[(b*e*n)/(g*(q + 1)), Int[(f + g*x)^(q + 1)/(d +
e*x), x], x] /; FreeQ[{a, b, c, d, e, f, g, n, q}, x] && NeQ[e*f - d*g, 0] && NeQ[q, -1]

Rule 43

Int[((a_.) + (b_.)*(x_))^(m_.)*((c_.) + (d_.)*(x_))^(n_.), x_Symbol] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d
*x)^n, x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && IGtQ[m, 0] && ( !IntegerQ[n] || (EqQ[c, 0]
&& LeQ[7*m + 4*n + 4, 0]) || LtQ[9*m + 5*(n + 1), 0] || GtQ[m + n + 2, 0])

Rubi steps

\begin{align*} \int x^2 \log (1+x) \, dx &=\frac{1}{3} x^3 \log (1+x)-\frac{1}{3} \int \frac{x^3}{1+x} \, dx\\ &=\frac{1}{3} x^3 \log (1+x)-\frac{1}{3} \int \left (1+\frac{1}{-1-x}-x+x^2\right ) \, dx\\ &=-\frac{x}{3}+\frac{x^2}{6}-\frac{x^3}{9}+\frac{1}{3} \log (1+x)+\frac{1}{3} x^3 \log (1+x)\\ \end{align*}

Mathematica [A]  time = 0.0092566, size = 28, normalized size = 0.72 $\frac{1}{18} \left (x \left (-2 x^2+3 x-6\right )+6 \left (x^3+1\right ) \log (x+1)\right )$

Antiderivative was successfully veriﬁed.

[In]

Integrate[x^2*Log[1 + x],x]

[Out]

(x*(-6 + 3*x - 2*x^2) + 6*(1 + x^3)*Log[1 + x])/18

________________________________________________________________________________________

Maple [A]  time = 0.002, size = 46, normalized size = 1.2 \begin{align*}{\frac{ \left ( 1+x \right ) ^{3}\ln \left ( 1+x \right ) }{3}}-{\frac{{x}^{3}}{9}}+{\frac{{x}^{2}}{6}}-{\frac{x}{3}}-{\frac{11}{18}}- \left ( 1+x \right ) ^{2}\ln \left ( 1+x \right ) + \left ( 1+x \right ) \ln \left ( 1+x \right ) \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

int(x^2*ln(1+x),x)

[Out]

1/3*(1+x)^3*ln(1+x)-1/9*x^3+1/6*x^2-1/3*x-11/18-(1+x)^2*ln(1+x)+(1+x)*ln(1+x)

________________________________________________________________________________________

Maxima [A]  time = 0.953137, size = 39, normalized size = 1. \begin{align*} \frac{1}{3} \, x^{3} \log \left (x + 1\right ) - \frac{1}{9} \, x^{3} + \frac{1}{6} \, x^{2} - \frac{1}{3} \, x + \frac{1}{3} \, \log \left (x + 1\right ) \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^2*log(1+x),x, algorithm="maxima")

[Out]

1/3*x^3*log(x + 1) - 1/9*x^3 + 1/6*x^2 - 1/3*x + 1/3*log(x + 1)

________________________________________________________________________________________

Fricas [A]  time = 1.91516, size = 74, normalized size = 1.9 \begin{align*} -\frac{1}{9} \, x^{3} + \frac{1}{6} \, x^{2} + \frac{1}{3} \,{\left (x^{3} + 1\right )} \log \left (x + 1\right ) - \frac{1}{3} \, x \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^2*log(1+x),x, algorithm="fricas")

[Out]

-1/9*x^3 + 1/6*x^2 + 1/3*(x^3 + 1)*log(x + 1) - 1/3*x

________________________________________________________________________________________

Sympy [A]  time = 0.107155, size = 29, normalized size = 0.74 \begin{align*} \frac{x^{3} \log{\left (x + 1 \right )}}{3} - \frac{x^{3}}{9} + \frac{x^{2}}{6} - \frac{x}{3} + \frac{\log{\left (x + 1 \right )}}{3} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

integrate(x**2*ln(1+x),x)

[Out]

x**3*log(x + 1)/3 - x**3/9 + x**2/6 - x/3 + log(x + 1)/3

________________________________________________________________________________________

Giac [A]  time = 1.04495, size = 66, normalized size = 1.69 \begin{align*} \frac{1}{3} \,{\left (x + 1\right )}^{3} \log \left (x + 1\right ) - \frac{1}{9} \,{\left (x + 1\right )}^{3} -{\left (x + 1\right )}^{2} \log \left (x + 1\right ) + \frac{1}{2} \,{\left (x + 1\right )}^{2} +{\left (x + 1\right )} \log \left (x + 1\right ) - x - 1 \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^2*log(1+x),x, algorithm="giac")

[Out]

1/3*(x + 1)^3*log(x + 1) - 1/9*(x + 1)^3 - (x + 1)^2*log(x + 1) + 1/2*(x + 1)^2 + (x + 1)*log(x + 1) - x - 1