3.258 \(\int (\log (x)+\log (1+x)+\log (2+x)) \, dx\)

Optimal. Leaf size=24 \[ -3 x+x \log (x)+(x+1) \log (x+1)+(x+2) \log (x+2) \]

[Out]

-3*x + x*Log[x] + (1 + x)*Log[1 + x] + (2 + x)*Log[2 + x]

________________________________________________________________________________________

Rubi [A]  time = 0.0087903, antiderivative size = 24, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 2, integrand size = 11, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.182, Rules used = {2295, 2389} \[ -3 x+x \log (x)+(x+1) \log (x+1)+(x+2) \log (x+2) \]

Antiderivative was successfully verified.

[In]

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

[Out]

-3*x + x*Log[x] + (1 + x)*Log[1 + x] + (2 + x)*Log[2 + x]

Rule 2295

Int[Log[(c_.)*(x_)^(n_.)], x_Symbol] :> Simp[x*Log[c*x^n], x] - Simp[n*x, x] /; FreeQ[{c, n}, x]

Rule 2389

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_))^(n_.)]*(b_.))^(p_.), x_Symbol] :> Dist[1/e, Subst[Int[(a + b*Log[c*
x^n])^p, x], x, d + e*x], x] /; FreeQ[{a, b, c, d, e, n, p}, x]

Rubi steps

\begin{align*} \int (\log (x)+\log (1+x)+\log (2+x)) \, dx &=\int \log (x) \, dx+\int \log (1+x) \, dx+\int \log (2+x) \, dx\\ &=-x+x \log (x)+\operatorname{Subst}(\int \log (x) \, dx,x,1+x)+\operatorname{Subst}(\int \log (x) \, dx,x,2+x)\\ &=-3 x+x \log (x)+(1+x) \log (1+x)+(2+x) \log (2+x)\\ \end{align*}

Mathematica [A]  time = 0.0029841, size = 30, normalized size = 1.25 \[ -3 x+x \log (x)+x \log (x+1)+x \log (x+2)+\log (x+1)+2 \log (x+2) \]

Antiderivative was successfully verified.

[In]

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

[Out]

-3*x + x*Log[x] + Log[1 + x] + x*Log[1 + x] + 2*Log[2 + x] + x*Log[2 + x]

________________________________________________________________________________________

Maple [A]  time = 0.003, size = 26, normalized size = 1.1 \begin{align*} x\ln \left ( x \right ) -3\,x+ \left ( 1+x \right ) \ln \left ( 1+x \right ) -3+ \left ( 2+x \right ) \ln \left ( 2+x \right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

x*ln(x)-3*x+(1+x)*ln(1+x)-3+(2+x)*ln(2+x)

________________________________________________________________________________________

Maxima [A]  time = 0.946145, size = 34, normalized size = 1.42 \begin{align*}{\left (x + 2\right )} \log \left (x + 2\right ) +{\left (x + 1\right )} \log \left (x + 1\right ) + x \log \left (x\right ) - 3 \, x - 3 \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

(x + 2)*log(x + 2) + (x + 1)*log(x + 1) + x*log(x) - 3*x - 3

________________________________________________________________________________________

Fricas [A]  time = 1.57867, size = 78, normalized size = 3.25 \begin{align*}{\left (x + 2\right )} \log \left (x + 2\right ) +{\left (x + 1\right )} \log \left (x + 1\right ) + x \log \left (x\right ) - 3 \, x \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

(x + 2)*log(x + 2) + (x + 1)*log(x + 1) + x*log(x) - 3*x

________________________________________________________________________________________

Sympy [A]  time = 1.44325, size = 32, normalized size = 1.33 \begin{align*} x \log{\left (x \right )} + x \log{\left (x + 1 \right )} + x \log{\left (x + 2 \right )} - 3 x + \log{\left (x + 1 \right )} + 2 \log{\left (x + 2 \right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

x*log(x) + x*log(x + 1) + x*log(x + 2) - 3*x + log(x + 1) + 2*log(x + 2)

________________________________________________________________________________________

Giac [A]  time = 1.08147, size = 34, normalized size = 1.42 \begin{align*}{\left (x + 2\right )} \log \left (x + 2\right ) +{\left (x + 1\right )} \log \left (x + 1\right ) + x \log \left (x\right ) - 3 \, x - 3 \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

(x + 2)*log(x + 2) + (x + 1)*log(x + 1) + x*log(x) - 3*x - 3