\(\int \log ^2(x) \, dx\) [57]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 4, antiderivative size = 15 \[ \int \log ^2(x) \, dx=2 x-2 x \log (x)+x \log ^2(x) \]

[Out]

2*x-2*x*ln(x)+x*ln(x)^2

Rubi [A] (verified)

Time = 0.00 (sec) , antiderivative size = 15, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.500, Rules used = {2333, 2332} \[ \int \log ^2(x) \, dx=2 x+x \log ^2(x)-2 x \log (x) \]

[In]

Int[Log[x]^2,x]

[Out]

2*x - 2*x*Log[x] + x*Log[x]^2

Rule 2332

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

Rule 2333

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))^(p_.), x_Symbol] :> Simp[x*(a + b*Log[c*x^n])^p, x] - Dist[b*n*p, In
t[(a + b*Log[c*x^n])^(p - 1), x], x] /; FreeQ[{a, b, c, n}, x] && GtQ[p, 0] && IntegerQ[2*p]

Rubi steps \begin{align*} \text {integral}& = x \log ^2(x)-2 \int \log (x) \, dx \\ & = 2 x-2 x \log (x)+x \log ^2(x) \\ \end{align*}

Mathematica [A] (verified)

Time = 0.00 (sec) , antiderivative size = 15, normalized size of antiderivative = 1.00 \[ \int \log ^2(x) \, dx=2 x-2 x \log (x)+x \log ^2(x) \]

[In]

Integrate[Log[x]^2,x]

[Out]

2*x - 2*x*Log[x] + x*Log[x]^2

Maple [A] (verified)

Time = 0.02 (sec) , antiderivative size = 16, normalized size of antiderivative = 1.07

method result size
default \(2 x -2 x \ln \left (x \right )+x \ln \left (x \right )^{2}\) \(16\)
norman \(2 x -2 x \ln \left (x \right )+x \ln \left (x \right )^{2}\) \(16\)
risch \(2 x -2 x \ln \left (x \right )+x \ln \left (x \right )^{2}\) \(16\)
parallelrisch \(2 x -2 x \ln \left (x \right )+x \ln \left (x \right )^{2}\) \(16\)

[In]

int(ln(x)^2,x,method=_RETURNVERBOSE)

[Out]

2*x-2*x*ln(x)+x*ln(x)^2

Fricas [A] (verification not implemented)

none

Time = 0.24 (sec) , antiderivative size = 15, normalized size of antiderivative = 1.00 \[ \int \log ^2(x) \, dx=x \log \left (x\right )^{2} - 2 \, x \log \left (x\right ) + 2 \, x \]

[In]

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

[Out]

x*log(x)^2 - 2*x*log(x) + 2*x

Sympy [A] (verification not implemented)

Time = 0.04 (sec) , antiderivative size = 15, normalized size of antiderivative = 1.00 \[ \int \log ^2(x) \, dx=x \log {\left (x \right )}^{2} - 2 x \log {\left (x \right )} + 2 x \]

[In]

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

[Out]

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

Maxima [A] (verification not implemented)

none

Time = 0.19 (sec) , antiderivative size = 12, normalized size of antiderivative = 0.80 \[ \int \log ^2(x) \, dx={\left (\log \left (x\right )^{2} - 2 \, \log \left (x\right ) + 2\right )} x \]

[In]

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

[Out]

(log(x)^2 - 2*log(x) + 2)*x

Giac [A] (verification not implemented)

none

Time = 0.29 (sec) , antiderivative size = 15, normalized size of antiderivative = 1.00 \[ \int \log ^2(x) \, dx=x \log \left (x\right )^{2} - 2 \, x \log \left (x\right ) + 2 \, x \]

[In]

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

[Out]

x*log(x)^2 - 2*x*log(x) + 2*x

Mupad [B] (verification not implemented)

Time = 0.03 (sec) , antiderivative size = 12, normalized size of antiderivative = 0.80 \[ \int \log ^2(x) \, dx=x\,\left ({\ln \left (x\right )}^2-2\,\ln \left (x\right )+2\right ) \]

[In]

int(log(x)^2,x)

[Out]

x*(log(x)^2 - 2*log(x) + 2)