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]

ln(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)

________________________________________________________________________________________

Rubi [A]  time = 0.05, antiderivative size = 42, normalized size of antiderivative = 1.00, 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 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 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 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]

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 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]

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.09, 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

________________________________________________________________________________________

fricas [A]  time = 0.43, size = 41, normalized size = 0.98 \[ -\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 ) \]

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)

________________________________________________________________________________________

giac [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {\log \left (3 \, x\right )^{2} - 1}{x \log \left (3 \, x\right )^{2} + x \log \left (3 \, x\right ) + x}\,{d x} \]

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]

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

________________________________________________________________________________________

maple [A]  time = 0.07, size = 40, normalized size = 0.95 \[ -\sqrt {3}\, \arctan \left (\frac {\left (2 \ln \left (3 x \right )+1\right ) \sqrt {3}}{3}\right )+\ln \left (3 x \right )-\frac {\ln \left (\ln \left (3 x \right )^{2}+\ln \left (3 x \right )+1\right )}{2} \]

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.00, size = 0, normalized size = 0.00 \[ -\int \frac {\log \relax (3) + \log \relax (x) + 2}{x {\left (2 \, \log \relax (3) + 1\right )} \log \relax (x) + x \log \relax (x)^{2} + {\left (\log \relax (3)^{2} + \log \relax (3) + 1\right )} x}\,{d x} + \log \relax (x) \]

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)

________________________________________________________________________________________

mupad [B]  time = 0.60, size = 37, normalized size = 0.88 \[ \ln \relax (x)-\frac {\ln \left ({\ln \left (3\,x\right )}^2+\ln \left (3\,x\right )+1\right )}{2}-\sqrt {3}\,\mathrm {atan}\left (\frac {\sqrt {3}\,\left (2\,\ln \left (3\,x\right )+1\right )}{3}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

sympy [A]  time = 0.18, size = 19, normalized size = 0.45 \[ \log {\relax (x )} + \operatorname {RootSum} {\left (z^{2} + z + 1, \left (i \mapsto i \log {\left (- i + \log {\left (3 x \right )} \right )} \right )\right )} \]

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))))

________________________________________________________________________________________