### 3.142 $$\int \frac{(2-\log (x)) (3+\log (x))^2}{x} \, dx$$

Optimal. Leaf size=21 $\frac{5}{3} (\log (x)+3)^3-\frac{1}{4} (\log (x)+3)^4$

[Out]

(5*(3 + Log[x])^3)/3 - (3 + Log[x])^4/4

________________________________________________________________________________________

Rubi [A]  time = 0.0359142, antiderivative size = 21, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 16, $$\frac{\text{number of rules}}{\text{integrand size}}$$ = 0.125, Rules used = {2365, 43} $\frac{5}{3} (\log (x)+3)^3-\frac{1}{4} (\log (x)+3)^4$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

(5*(3 + Log[x])^3)/3 - (3 + Log[x])^4/4

Rule 2365

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

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 \frac{(2-\log (x)) (3+\log (x))^2}{x} \, dx &=\operatorname{Subst}\left (\int (2-x) (3+x)^2 \, dx,x,\log (x)\right )\\ &=\operatorname{Subst}\left (\int \left (5 (3+x)^2-(3+x)^3\right ) \, dx,x,\log (x)\right )\\ &=\frac{5}{3} (3+\log (x))^3-\frac{1}{4} (3+\log (x))^4\\ \end{align*}

Mathematica [A]  time = 0.0136064, size = 29, normalized size = 1.38 $-\frac{1}{4} \log ^4(x)-\frac{4 \log ^3(x)}{3}+\frac{3 \log ^2(x)}{2}+18 \log (x)$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [A]  time = 0.004, size = 24, normalized size = 1.1 \begin{align*} -{\frac{ \left ( \ln \left ( x \right ) \right ) ^{4}}{4}}-{\frac{4\, \left ( \ln \left ( x \right ) \right ) ^{3}}{3}}+{\frac{3\, \left ( \ln \left ( x \right ) \right ) ^{2}}{2}}+18\,\ln \left ( x \right ) \end{align*}

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

[In]

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

[Out]

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

________________________________________________________________________________________

Maxima [A]  time = 1.10237, size = 31, normalized size = 1.48 \begin{align*} -\frac{1}{4} \, \log \left (x\right )^{4} - \frac{4}{3} \, \log \left (x\right )^{3} + \frac{3}{2} \, \log \left (x\right )^{2} + 18 \, \log \left (x\right ) \end{align*}

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

[In]

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

[Out]

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

________________________________________________________________________________________

Fricas [A]  time = 2.07586, size = 77, normalized size = 3.67 \begin{align*} -\frac{1}{4} \, \log \left (x\right )^{4} - \frac{4}{3} \, \log \left (x\right )^{3} + \frac{3}{2} \, \log \left (x\right )^{2} + 18 \, \log \left (x\right ) \end{align*}

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

[In]

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

[Out]

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

________________________________________________________________________________________

Sympy [A]  time = 0.129428, size = 27, normalized size = 1.29 \begin{align*} - \frac{\log{\left (x \right )}^{4}}{4} - \frac{4 \log{\left (x \right )}^{3}}{3} + \frac{3 \log{\left (x \right )}^{2}}{2} + 18 \log{\left (x \right )} \end{align*}

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

[In]

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

[Out]

-log(x)**4/4 - 4*log(x)**3/3 + 3*log(x)**2/2 + 18*log(x)

________________________________________________________________________________________

Giac [A]  time = 1.31823, size = 31, normalized size = 1.48 \begin{align*} -\frac{1}{4} \, \log \left (x\right )^{4} - \frac{4}{3} \, \log \left (x\right )^{3} + \frac{3}{2} \, \log \left (x\right )^{2} + 18 \, \log \left (x\right ) \end{align*}

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

[In]

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

[Out]

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