\(\int \frac {(a m x^m+b n q \log ^{-1+q}(c x^n)) (a x^m+b \log ^q(c x^n))^2}{x} \, dx\) [17]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [C] (warning: unable to verify)
   Fricas [B] (verification not implemented)
   Sympy [B] (verification not implemented)
   Maxima [F(-2)]
   Giac [F]
   Mupad [B] (verification not implemented)

Optimal result

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

[Out]

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

Rubi [A] (verified)

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

[In]

Int[((a*m*x^m + b*n*q*Log[c*x^n]^(-1 + q))*(a*x^m + b*Log[c*x^n]^q)^2)/x,x]

[Out]

(a*x^m + b*Log[c*x^n]^q)^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]

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

Mathematica [A] (verified)

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

[In]

Integrate[((a*m*x^m + b*n*q*Log[c*x^n]^(-1 + q))*(a*x^m + b*Log[c*x^n]^q)^2)/x,x]

[Out]

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

Maple [C] (warning: unable to verify)

Result contains higher order function than in optimal. Order 9 vs. order 3.

Time = 0.08 (sec) , antiderivative size = 204, normalized size of antiderivative = 9.27

\[\frac {a^{3} x^{3 m}}{3}+\frac {b^{3} {\left (\ln \left (c \right )+\ln \left (x^{n}\right )-\frac {i \pi \,\operatorname {csgn}\left (i c \,x^{n}\right ) \left (-\operatorname {csgn}\left (i c \,x^{n}\right )+\operatorname {csgn}\left (i c \right )\right ) \left (-\operatorname {csgn}\left (i c \,x^{n}\right )+\operatorname {csgn}\left (i x^{n}\right )\right )}{2}\right )}^{3 q}}{3}+a \,b^{2} x^{m} {\left (\ln \left (c \right )+\ln \left (x^{n}\right )-\frac {i \pi \,\operatorname {csgn}\left (i c \,x^{n}\right ) \left (-\operatorname {csgn}\left (i c \,x^{n}\right )+\operatorname {csgn}\left (i c \right )\right ) \left (-\operatorname {csgn}\left (i c \,x^{n}\right )+\operatorname {csgn}\left (i x^{n}\right )\right )}{2}\right )}^{2 q}+a^{2} b \,x^{2 m} {\left (\ln \left (c \right )+\ln \left (x^{n}\right )-\frac {i \pi \,\operatorname {csgn}\left (i c \,x^{n}\right ) \left (-\operatorname {csgn}\left (i c \,x^{n}\right )+\operatorname {csgn}\left (i c \right )\right ) \left (-\operatorname {csgn}\left (i c \,x^{n}\right )+\operatorname {csgn}\left (i x^{n}\right )\right )}{2}\right )}^{q}\]

[In]

int((a*m*x^m+b*n*q*ln(c*x^n)^(-1+q))*(a*x^m+b*ln(c*x^n)^q)^2/x,x)

[Out]

1/3*a^3*(x^m)^3+1/3*b^3*((ln(c)+ln(x^n)-1/2*I*Pi*csgn(I*c*x^n)*(-csgn(I*c*x^n)+csgn(I*c))*(-csgn(I*c*x^n)+csgn
(I*x^n)))^q)^3+a*b^2*x^m*((ln(c)+ln(x^n)-1/2*I*Pi*csgn(I*c*x^n)*(-csgn(I*c*x^n)+csgn(I*c))*(-csgn(I*c*x^n)+csg
n(I*x^n)))^q)^2+a^2*b*(x^m)^2*(ln(c)+ln(x^n)-1/2*I*Pi*csgn(I*c*x^n)*(-csgn(I*c*x^n)+csgn(I*c))*(-csgn(I*c*x^n)
+csgn(I*x^n)))^q

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 65 vs. \(2 (20) = 40\).

Time = 0.36 (sec) , antiderivative size = 65, normalized size of antiderivative = 2.95 \[ \int \frac {\left (a m x^m+b n q \log ^{-1+q}\left (c x^n\right )\right ) \left (a x^m+b \log ^q\left (c x^n\right )\right )^2}{x} \, dx={\left (n \log \left (x\right ) + \log \left (c\right )\right )}^{q} a^{2} b x^{2 \, m} + {\left (n \log \left (x\right ) + \log \left (c\right )\right )}^{2 \, q} a b^{2} x^{m} + \frac {1}{3} \, {\left (n \log \left (x\right ) + \log \left (c\right )\right )}^{3 \, q} b^{3} + \frac {1}{3} \, a^{3} x^{3 \, m} \]

[In]

integrate((a*m*x^m+b*n*q*log(c*x^n)^(-1+q))*(a*x^m+b*log(c*x^n)^q)^2/x,x, algorithm="fricas")

[Out]

(n*log(x) + log(c))^q*a^2*b*x^(2*m) + (n*log(x) + log(c))^(2*q)*a*b^2*x^m + 1/3*(n*log(x) + log(c))^(3*q)*b^3
+ 1/3*a^3*x^(3*m)

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 61 vs. \(2 (17) = 34\).

Time = 66.40 (sec) , antiderivative size = 61, normalized size of antiderivative = 2.77 \[ \int \frac {\left (a m x^m+b n q \log ^{-1+q}\left (c x^n\right )\right ) \left (a x^m+b \log ^q\left (c x^n\right )\right )^2}{x} \, dx=\frac {a^{3} x^{3 m}}{3} + a^{2} b x^{2 m} \log {\left (c x^{n} \right )}^{q} + a b^{2} x^{m} \log {\left (c x^{n} \right )}^{2 q} + \frac {b^{3} \log {\left (c x^{n} \right )}^{3 q}}{3} \]

[In]

integrate((a*m*x**m+b*n*q*ln(c*x**n)**(-1+q))*(a*x**m+b*ln(c*x**n)**q)**2/x,x)

[Out]

a**3*x**(3*m)/3 + a**2*b*x**(2*m)*log(c*x**n)**q + a*b**2*x**m*log(c*x**n)**(2*q) + b**3*log(c*x**n)**(3*q)/3

Maxima [F(-2)]

Exception generated. \[ \int \frac {\left (a m x^m+b n q \log ^{-1+q}\left (c x^n\right )\right ) \left (a x^m+b \log ^q\left (c x^n\right )\right )^2}{x} \, dx=\text {Exception raised: RuntimeError} \]

[In]

integrate((a*m*x^m+b*n*q*log(c*x^n)^(-1+q))*(a*x^m+b*log(c*x^n)^q)^2/x,x, algorithm="maxima")

[Out]

Exception raised: RuntimeError >> ECL says: In function CAR, the value of the first argument is  0which is not
 of the expected type LIST

Giac [F]

\[ \int \frac {\left (a m x^m+b n q \log ^{-1+q}\left (c x^n\right )\right ) \left (a x^m+b \log ^q\left (c x^n\right )\right )^2}{x} \, dx=\int { \frac {{\left (b n q \log \left (c x^{n}\right )^{q - 1} + a m x^{m}\right )} {\left (a x^{m} + b \log \left (c x^{n}\right )^{q}\right )}^{2}}{x} \,d x } \]

[In]

integrate((a*m*x^m+b*n*q*log(c*x^n)^(-1+q))*(a*x^m+b*log(c*x^n)^q)^2/x,x, algorithm="giac")

[Out]

integrate((b*n*q*log(c*x^n)^(q - 1) + a*m*x^m)*(a*x^m + b*log(c*x^n)^q)^2/x, x)

Mupad [B] (verification not implemented)

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

[In]

int(((a*m*x^m + b*n*q*log(c*x^n)^(q - 1))*(a*x^m + b*log(c*x^n)^q)^2)/x,x)

[Out]

(a*x^m + b*log(c*x^n)^q)^3/3