3.261 \(\int \frac{-1+\log ^2(3 x)}{x+x \log (3 x)+x \log ^2(3 x)} \, dx\)

Optimal. Leaf size=42 \[ -\frac{1}{2} \log \left (\log ^2(3 x)+\log (3 x)+1\right )+\log (x)-\sqrt{3} \tan ^{-1}\left (\frac{2 \log (3 x)+1}{\sqrt{3}}\right ) \]

[Out]

-(Sqrt[3]*ArcTan[(1 + 2*Log[3*x])/Sqrt[3]]) + Log[x] - Log[1 + Log[3*x] + Log[3*x]^2]/2

________________________________________________________________________________________

Rubi [A]  time = 0.0460033, antiderivative size = 42, normalized size of antiderivative = 1., number of steps used = 7, number of rules used = 5, integrand size = 27, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.185, Rules used = {1657, 634, 618, 204, 628} \[ -\frac{1}{2} \log \left (\log ^2(3 x)+\log (3 x)+1\right )+\log (x)-\sqrt{3} \tan ^{-1}\left (\frac{2 \log (3 x)+1}{\sqrt{3}}\right ) \]

Antiderivative was successfully verified.

[In]

Int[(-1 + Log[3*x]^2)/(x + x*Log[3*x] + x*Log[3*x]^2),x]

[Out]

-(Sqrt[3]*ArcTan[(1 + 2*Log[3*x])/Sqrt[3]]) + Log[x] - Log[1 + Log[3*x] + Log[3*x]^2]/2

Rule 1657

Int[(Pq_)*((a_) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIntegrand[Pq*(a + b*x + c*x^2)^p, x
], x] /; FreeQ[{a, b, c}, x] && PolyQ[Pq, x] && IGtQ[p, -2]

Rule 634

Int[((d_.) + (e_.)*(x_))/((a_) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Dist[(2*c*d - b*e)/(2*c), Int[1/(a +
 b*x + c*x^2), x], x] + Dist[e/(2*c), Int[(b + 2*c*x)/(a + b*x + c*x^2), x], x] /; FreeQ[{a, b, c, d, e}, x] &
& NeQ[2*c*d - b*e, 0] && NeQ[b^2 - 4*a*c, 0] &&  !NiceSqrtQ[b^2 - 4*a*c]

Rule 618

Int[((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(-1), x_Symbol] :> Dist[-2, Subst[Int[1/Simp[b^2 - 4*a*c - x^2, x], x]
, x, b + 2*c*x], x] /; FreeQ[{a, b, c}, x] && NeQ[b^2 - 4*a*c, 0]

Rule 204

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> -Simp[ArcTan[(Rt[-b, 2]*x)/Rt[-a, 2]]/(Rt[-a, 2]*Rt[-b, 2]), x] /
; FreeQ[{a, b}, x] && PosQ[a/b] && (LtQ[a, 0] || LtQ[b, 0])

Rule 628

Int[((d_) + (e_.)*(x_))/((a_.) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Simp[(d*Log[RemoveContent[a + b*x +
c*x^2, x]])/b, x] /; FreeQ[{a, b, c, d, e}, x] && EqQ[2*c*d - b*e, 0]

Rubi steps

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

Mathematica [A]  time = 0.0885525, size = 44, normalized size = 1.05 \[ -\frac{1}{2} \log \left (\log ^2(3 x)+\log (3 x)+1\right )+\log (3 x)-\sqrt{3} \tan ^{-1}\left (\frac{2 \log (3 x)+1}{\sqrt{3}}\right ) \]

Antiderivative was successfully verified.

[In]

Integrate[(-1 + Log[3*x]^2)/(x + x*Log[3*x] + x*Log[3*x]^2),x]

[Out]

-(Sqrt[3]*ArcTan[(1 + 2*Log[3*x])/Sqrt[3]]) + Log[3*x] - Log[1 + Log[3*x] + Log[3*x]^2]/2

________________________________________________________________________________________

Maple [A]  time = 0.006, size = 40, normalized size = 1. \begin{align*} \ln \left ( 3\,x \right ) -{\frac{\ln \left ( 1+\ln \left ( 3\,x \right ) + \left ( \ln \left ( 3\,x \right ) \right ) ^{2} \right ) }{2}}-\arctan \left ({\frac{ \left ( 1+2\,\ln \left ( 3\,x \right ) \right ) \sqrt{3}}{3}} \right ) \sqrt{3} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((-1+ln(3*x)^2)/(x+x*ln(3*x)+x*ln(3*x)^2),x)

[Out]

ln(3*x)-1/2*ln(1+ln(3*x)+ln(3*x)^2)-arctan(1/3*(1+2*ln(3*x))*3^(1/2))*3^(1/2)

________________________________________________________________________________________

Maxima [F]  time = 0., size = 0, normalized size = 0. \begin{align*} -\int \frac{\log \left (3\right ) + \log \left (x\right ) + 2}{x{\left (2 \, \log \left (3\right ) + 1\right )} \log \left (x\right ) + x \log \left (x\right )^{2} +{\left (\log \left (3\right )^{2} + \log \left (3\right ) + 1\right )} x}\,{d x} + \log \left (x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Fricas [A]  time = 1.94789, size = 136, normalized size = 3.24 \begin{align*} -\sqrt{3} \arctan \left (\frac{2}{3} \, \sqrt{3} \log \left (3 \, x\right ) + \frac{1}{3} \, \sqrt{3}\right ) - \frac{1}{2} \, \log \left (\log \left (3 \, x\right )^{2} + \log \left (3 \, x\right ) + 1\right ) + \log \left (3 \, x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Sympy [A]  time = 0.178857, size = 19, normalized size = 0.45 \begin{align*} \log{\left (x \right )} + \operatorname{RootSum}{\left (z^{2} + z + 1, \left ( i \mapsto i \log{\left (- i + \log{\left (3 x \right )} \right )} \right )\right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((-1+ln(3*x)**2)/(x+x*ln(3*x)+x*ln(3*x)**2),x)

[Out]

log(x) + RootSum(_z**2 + _z + 1, Lambda(_i, _i*log(-_i + log(3*x))))

________________________________________________________________________________________

Giac [A]  time = 1.34068, size = 53, normalized size = 1.26 \begin{align*} -\sqrt{3} \arctan \left (\frac{1}{3} \, \sqrt{3}{\left (2 \, \log \left (3 \, x\right ) + 1\right )}\right ) - \frac{1}{2} \, \log \left (\log \left (3 \, x\right )^{2} + \log \left (3 \, x\right ) + 1\right ) + \log \left (3 \, x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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