\(\int (\frac {a}{x^2}+\frac {2 b n \log (c x^n)}{x^3}) (a x^2+b x \log ^2(c x^n))^2 \, dx\) [23]

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

Optimal result

Integrand size = 39, antiderivative size = 20 \[ \int \left (\frac {a}{x^2}+\frac {2 b n \log \left (c x^n\right )}{x^3}\right ) \left (a x^2+b x \log ^2\left (c x^n\right )\right )^2 \, dx=\frac {1}{3} \left (a x+b \log ^2\left (c x^n\right )\right )^3 \]

[Out]

1/3*(a*x+b*ln(c*x^n)^2)^3

Rubi [A] (verified)

Time = 0.10 (sec) , antiderivative size = 20, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.051, Rules used = {2641, 2624} \[ \int \left (\frac {a}{x^2}+\frac {2 b n \log \left (c x^n\right )}{x^3}\right ) \left (a x^2+b x \log ^2\left (c x^n\right )\right )^2 \, dx=\frac {1}{3} \left (a x+b \log ^2\left (c x^n\right )\right )^3 \]

[In]

Int[(a/x^2 + (2*b*n*Log[c*x^n])/x^3)*(a*x^2 + b*x*Log[c*x^n]^2)^2,x]

[Out]

(a*x + b*Log[c*x^n]^2)^3/3

Rule 2624

Int[((Log[(c_.)*(x_)^(n_.)]^(q_)*(b_.) + (a_.)*(x_)^(m_.))^(p_.)*(Log[(c_.)*(x_)^(n_.)]^(r_.)*(e_.) + (d_.)*(x
_)^(m_.)))/(x_), x_Symbol] :> Simp[e*((a*x^m + b*Log[c*x^n]^q)^(p + 1)/(b*n*q*(p + 1))), x] /; FreeQ[{a, b, c,
 d, e, m, n, p, q, r}, x] && EqQ[r, q - 1] && NeQ[p, -1] && EqQ[a*e*m - b*d*n*q, 0]

Rule 2641

Int[(u_.)*((a_.)*(x_)^(m_.) + Log[(c_.)*(x_)^(n_.)]^(q_.)*(b_.)*(x_)^(r_.))^(p_.), x_Symbol] :> Int[u*x^(p*r)*
(a*x^(m - r) + b*Log[c*x^n]^q)^p, x] /; FreeQ[{a, b, c, m, n, p, q, r}, x] && IntegerQ[p]

Rubi steps \begin{align*} \text {integral}& = \int \frac {\left (a x+2 b n \log \left (c x^n\right )\right ) \left (a x^2+b x \log ^2\left (c x^n\right )\right )^2}{x^3} \, dx \\ & = \int \frac {\left (a x+2 b n \log \left (c x^n\right )\right ) \left (a x+b \log ^2\left (c x^n\right )\right )^2}{x} \, dx \\ & = \frac {1}{3} \left (a x+b \log ^2\left (c x^n\right )\right )^3 \\ \end{align*}

Mathematica [A] (verified)

Time = 0.02 (sec) , antiderivative size = 20, normalized size of antiderivative = 1.00 \[ \int \left (\frac {a}{x^2}+\frac {2 b n \log \left (c x^n\right )}{x^3}\right ) \left (a x^2+b x \log ^2\left (c x^n\right )\right )^2 \, dx=\frac {1}{3} \left (a x+b \log ^2\left (c x^n\right )\right )^3 \]

[In]

Integrate[(a/x^2 + (2*b*n*Log[c*x^n])/x^3)*(a*x^2 + b*x*Log[c*x^n]^2)^2,x]

[Out]

(a*x + b*Log[c*x^n]^2)^3/3

Maple [B] (verified)

Leaf count of result is larger than twice the leaf count of optimal. \(52\) vs. \(2(18)=36\).

Time = 2.34 (sec) , antiderivative size = 53, normalized size of antiderivative = 2.65

method result size
parallelrisch \(\frac {b^{3} \ln \left (c \,x^{n}\right )^{6}}{3}+a x \,b^{2} \ln \left (c \,x^{n}\right )^{4}+a^{2} x^{2} b \ln \left (c \,x^{n}\right )^{2}+\frac {a^{3} x^{3}}{3}\) \(53\)
risch \(\text {Expression too large to display}\) \(20850\)

[In]

int((1/x^2*a+2*b*n*ln(c*x^n)/x^3)*(x^2*a+b*x*ln(c*x^n)^2)^2,x,method=_RETURNVERBOSE)

[Out]

1/3*b^3*ln(c*x^n)^6+a*x*b^2*ln(c*x^n)^4+a^2*x^2*b*ln(c*x^n)^2+1/3*a^3*x^3

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 195 vs. \(2 (18) = 36\).

Time = 0.32 (sec) , antiderivative size = 195, normalized size of antiderivative = 9.75 \[ \int \left (\frac {a}{x^2}+\frac {2 b n \log \left (c x^n\right )}{x^3}\right ) \left (a x^2+b x \log ^2\left (c x^n\right )\right )^2 \, dx=\frac {1}{3} \, b^{3} n^{6} \log \left (x\right )^{6} + 2 \, b^{3} n^{5} \log \left (c\right ) \log \left (x\right )^{5} + a b^{2} x \log \left (c\right )^{4} + a^{2} b x^{2} \log \left (c\right )^{2} + \frac {1}{3} \, a^{3} x^{3} + {\left (5 \, b^{3} n^{4} \log \left (c\right )^{2} + a b^{2} n^{4} x\right )} \log \left (x\right )^{4} + \frac {4}{3} \, {\left (5 \, b^{3} n^{3} \log \left (c\right )^{3} + 3 \, a b^{2} n^{3} x \log \left (c\right )\right )} \log \left (x\right )^{3} + {\left (5 \, b^{3} n^{2} \log \left (c\right )^{4} + 6 \, a b^{2} n^{2} x \log \left (c\right )^{2} + a^{2} b n^{2} x^{2}\right )} \log \left (x\right )^{2} + 2 \, {\left (b^{3} n \log \left (c\right )^{5} + 2 \, a b^{2} n x \log \left (c\right )^{3} + a^{2} b n x^{2} \log \left (c\right )\right )} \log \left (x\right ) \]

[In]

integrate((a/x^2+2*b*n*log(c*x^n)/x^3)*(a*x^2+b*x*log(c*x^n)^2)^2,x, algorithm="fricas")

[Out]

1/3*b^3*n^6*log(x)^6 + 2*b^3*n^5*log(c)*log(x)^5 + a*b^2*x*log(c)^4 + a^2*b*x^2*log(c)^2 + 1/3*a^3*x^3 + (5*b^
3*n^4*log(c)^2 + a*b^2*n^4*x)*log(x)^4 + 4/3*(5*b^3*n^3*log(c)^3 + 3*a*b^2*n^3*x*log(c))*log(x)^3 + (5*b^3*n^2
*log(c)^4 + 6*a*b^2*n^2*x*log(c)^2 + a^2*b*n^2*x^2)*log(x)^2 + 2*(b^3*n*log(c)^5 + 2*a*b^2*n*x*log(c)^3 + a^2*
b*n*x^2*log(c))*log(x)

Sympy [A] (verification not implemented)

Time = 3.67 (sec) , antiderivative size = 70, normalized size of antiderivative = 3.50 \[ \int \left (\frac {a}{x^2}+\frac {2 b n \log \left (c x^n\right )}{x^3}\right ) \left (a x^2+b x \log ^2\left (c x^n\right )\right )^2 \, dx=\frac {a^{3} x^{3}}{3} + a^{2} b x^{2} \log {\left (c x^{n} \right )}^{2} + a b^{2} x \log {\left (c x^{n} \right )}^{4} - 2 b^{3} n \left (\begin {cases} - \log {\left (c \right )}^{5} \log {\left (x \right )} & \text {for}\: n = 0 \\- \frac {\log {\left (c x^{n} \right )}^{6}}{6 n} & \text {otherwise} \end {cases}\right ) \]

[In]

integrate((a/x**2+2*b*n*ln(c*x**n)/x**3)*(a*x**2+b*x*ln(c*x**n)**2)**2,x)

[Out]

a**3*x**3/3 + a**2*b*x**2*log(c*x**n)**2 + a*b**2*x*log(c*x**n)**4 - 2*b**3*n*Piecewise((-log(c)**5*log(x), Eq
(n, 0)), (-log(c*x**n)**6/(6*n), True))

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 211 vs. \(2 (18) = 36\).

Time = 0.21 (sec) , antiderivative size = 211, normalized size of antiderivative = 10.55 \[ \int \left (\frac {a}{x^2}+\frac {2 b n \log \left (c x^n\right )}{x^3}\right ) \left (a x^2+b x \log ^2\left (c x^n\right )\right )^2 \, dx=\frac {1}{3} \, b^{3} \log \left (c x^{n}\right )^{6} + 4 \, a b^{2} n x \log \left (c x^{n}\right )^{3} + a b^{2} x \log \left (c x^{n}\right )^{4} - \frac {1}{2} \, a^{2} b n^{2} x^{2} + a^{2} b n x^{2} \log \left (c x^{n}\right ) + a^{2} b x^{2} \log \left (c x^{n}\right )^{2} + \frac {1}{3} \, a^{3} x^{3} - 12 \, {\left (n x \log \left (c x^{n}\right )^{2} + 2 \, {\left (n^{2} x - n x \log \left (c x^{n}\right )\right )} n\right )} a b^{2} n + \frac {1}{2} \, {\left (n^{2} x^{2} - 2 \, n x^{2} \log \left (c x^{n}\right )\right )} a^{2} b - 4 \, {\left (n x \log \left (c x^{n}\right )^{3} - 3 \, {\left (n x \log \left (c x^{n}\right )^{2} + 2 \, {\left (n^{2} x - n x \log \left (c x^{n}\right )\right )} n\right )} n\right )} a b^{2} \]

[In]

integrate((a/x^2+2*b*n*log(c*x^n)/x^3)*(a*x^2+b*x*log(c*x^n)^2)^2,x, algorithm="maxima")

[Out]

1/3*b^3*log(c*x^n)^6 + 4*a*b^2*n*x*log(c*x^n)^3 + a*b^2*x*log(c*x^n)^4 - 1/2*a^2*b*n^2*x^2 + a^2*b*n*x^2*log(c
*x^n) + a^2*b*x^2*log(c*x^n)^2 + 1/3*a^3*x^3 - 12*(n*x*log(c*x^n)^2 + 2*(n^2*x - n*x*log(c*x^n))*n)*a*b^2*n +
1/2*(n^2*x^2 - 2*n*x^2*log(c*x^n))*a^2*b - 4*(n*x*log(c*x^n)^3 - 3*(n*x*log(c*x^n)^2 + 2*(n^2*x - n*x*log(c*x^
n))*n)*n)*a*b^2

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 198 vs. \(2 (18) = 36\).

Time = 0.36 (sec) , antiderivative size = 198, normalized size of antiderivative = 9.90 \[ \int \left (\frac {a}{x^2}+\frac {2 b n \log \left (c x^n\right )}{x^3}\right ) \left (a x^2+b x \log ^2\left (c x^n\right )\right )^2 \, dx=\frac {1}{3} \, b^{3} n^{6} \log \left (x\right )^{6} + 2 \, b^{3} n^{5} \log \left (c\right ) \log \left (x\right )^{5} + 2 \, b^{3} n \log \left (c\right )^{5} \log \left (x\right ) + a b^{2} x \log \left (c\right )^{4} + a^{2} b x^{2} \log \left (c\right )^{2} + \frac {1}{3} \, a^{3} x^{3} + {\left (5 \, b^{3} n^{4} \log \left (c\right )^{2} + a b^{2} n^{4} x\right )} \log \left (x\right )^{4} + \frac {4}{3} \, {\left (5 \, b^{3} n^{3} \log \left (c\right )^{3} + 3 \, a b^{2} n^{3} x \log \left (c\right )\right )} \log \left (x\right )^{3} + {\left (5 \, b^{3} n^{2} \log \left (c\right )^{4} + 6 \, a b^{2} n^{2} x \log \left (c\right )^{2} + a^{2} b n^{2} x^{2}\right )} \log \left (x\right )^{2} + 2 \, {\left (2 \, a b^{2} n x \log \left (c\right )^{3} + a^{2} b n x^{2} \log \left (c\right )\right )} \log \left (x\right ) \]

[In]

integrate((a/x^2+2*b*n*log(c*x^n)/x^3)*(a*x^2+b*x*log(c*x^n)^2)^2,x, algorithm="giac")

[Out]

1/3*b^3*n^6*log(x)^6 + 2*b^3*n^5*log(c)*log(x)^5 + 2*b^3*n*log(c)^5*log(x) + a*b^2*x*log(c)^4 + a^2*b*x^2*log(
c)^2 + 1/3*a^3*x^3 + (5*b^3*n^4*log(c)^2 + a*b^2*n^4*x)*log(x)^4 + 4/3*(5*b^3*n^3*log(c)^3 + 3*a*b^2*n^3*x*log
(c))*log(x)^3 + (5*b^3*n^2*log(c)^4 + 6*a*b^2*n^2*x*log(c)^2 + a^2*b*n^2*x^2)*log(x)^2 + 2*(2*a*b^2*n*x*log(c)
^3 + a^2*b*n*x^2*log(c))*log(x)

Mupad [B] (verification not implemented)

Time = 1.60 (sec) , antiderivative size = 52, normalized size of antiderivative = 2.60 \[ \int \left (\frac {a}{x^2}+\frac {2 b n \log \left (c x^n\right )}{x^3}\right ) \left (a x^2+b x \log ^2\left (c x^n\right )\right )^2 \, dx=\frac {a^3\,x^3}{3}+a^2\,b\,x^2\,{\ln \left (c\,x^n\right )}^2+a\,b^2\,x\,{\ln \left (c\,x^n\right )}^4+\frac {b^3\,{\ln \left (c\,x^n\right )}^6}{3} \]

[In]

int((a*x^2 + b*x*log(c*x^n)^2)^2*(a/x^2 + (2*b*n*log(c*x^n))/x^3),x)

[Out]

(b^3*log(c*x^n)^6)/3 + (a^3*x^3)/3 + a^2*b*x^2*log(c*x^n)^2 + a*b^2*x*log(c*x^n)^4