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

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

Optimal result

Integrand size = 26, antiderivative size = 41 \[ \int \frac {\log \left (c x^n\right ) \left (a x^m+b \log ^2\left (c x^n\right )\right )}{x} \, dx=-\frac {a n x^m}{m^2}+\frac {a x^m \log \left (c x^n\right )}{m}+\frac {b \log ^4\left (c x^n\right )}{4 n} \]

[Out]

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

Rubi [A] (verified)

Time = 0.05 (sec) , antiderivative size = 41, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.154, Rules used = {2619, 2341, 2339, 30} \[ \int \frac {\log \left (c x^n\right ) \left (a x^m+b \log ^2\left (c x^n\right )\right )}{x} \, dx=\frac {a x^m \log \left (c x^n\right )}{m}-\frac {a n x^m}{m^2}+\frac {b \log ^4\left (c x^n\right )}{4 n} \]

[In]

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

[Out]

-((a*n*x^m)/m^2) + (a*x^m*Log[c*x^n])/m + (b*Log[c*x^n]^4)/(4*n)

Rule 30

Int[(x_)^(m_.), x_Symbol] :> Simp[x^(m + 1)/(m + 1), x] /; FreeQ[m, x] && NeQ[m, -1]

Rule 2339

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

Rule 2341

Int[((a_.) + Log[(c_.)*(x_)^(n_.)]*(b_.))*((d_.)*(x_))^(m_.), x_Symbol] :> Simp[(d*x)^(m + 1)*((a + b*Log[c*x^
n])/(d*(m + 1))), x] - Simp[b*n*((d*x)^(m + 1)/(d*(m + 1)^2)), x] /; FreeQ[{a, b, c, d, m, n}, x] && NeQ[m, -1
]

Rule 2619

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

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

Mathematica [A] (verified)

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

[In]

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

[Out]

-((a*n*x^m)/m^2) + (a*x^m*Log[c*x^n])/m + (b*Log[c*x^n]^4)/(4*n)

Maple [A] (verified)

Time = 0.82 (sec) , antiderivative size = 47, normalized size of antiderivative = 1.15

method result size
parallelrisch \(-\frac {-b \ln \left (c \,x^{n}\right )^{4} m^{2}-4 x^{m} \ln \left (c \,x^{n}\right ) a m n +4 n^{2} a \,x^{m}}{4 m^{2} n}\) \(47\)
risch \(\text {Expression too large to display}\) \(2146\)

[In]

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

[Out]

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

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 81 vs. \(2 (39) = 78\).

Time = 0.33 (sec) , antiderivative size = 81, normalized size of antiderivative = 1.98 \[ \int \frac {\log \left (c x^n\right ) \left (a x^m+b \log ^2\left (c x^n\right )\right )}{x} \, dx=\frac {b m^{2} n^{3} \log \left (x\right )^{4} + 4 \, b m^{2} n^{2} \log \left (c\right ) \log \left (x\right )^{3} + 6 \, b m^{2} n \log \left (c\right )^{2} \log \left (x\right )^{2} + 4 \, b m^{2} \log \left (c\right )^{3} \log \left (x\right ) + 4 \, {\left (a m n \log \left (x\right ) + a m \log \left (c\right ) - a n\right )} x^{m}}{4 \, m^{2}} \]

[In]

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

[Out]

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

Sympy [A] (verification not implemented)

Time = 8.60 (sec) , antiderivative size = 65, normalized size of antiderivative = 1.59 \[ \int \frac {\log \left (c x^n\right ) \left (a x^m+b \log ^2\left (c x^n\right )\right )}{x} \, dx=- a n \left (\begin {cases} \frac {\begin {cases} \frac {x^{m}}{m} & \text {for}\: m \neq 0 \\\log {\left (x \right )} & \text {otherwise} \end {cases}}{m} & \text {for}\: m > -\infty \wedge m < \infty \wedge m \neq 0 \\\frac {\log {\left (x \right )}^{2}}{2} & \text {otherwise} \end {cases}\right ) + a \left (\begin {cases} \frac {x^{m}}{m} & \text {for}\: m \neq 0 \\\log {\left (x \right )} & \text {otherwise} \end {cases}\right ) \log {\left (c x^{n} \right )} - b \left (\begin {cases} - \log {\left (c \right )}^{3} \log {\left (x \right )} & \text {for}\: n = 0 \\- \frac {\log {\left (c x^{n} \right )}^{4}}{4 n} & \text {otherwise} \end {cases}\right ) \]

[In]

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

[Out]

-a*n*Piecewise((Piecewise((x**m/m, Ne(m, 0)), (log(x), True))/m, (m > -oo) & (m < oo) & Ne(m, 0)), (log(x)**2/
2, True)) + a*Piecewise((x**m/m, Ne(m, 0)), (log(x), True))*log(c*x**n) - b*Piecewise((-log(c)**3*log(x), Eq(n
, 0)), (-log(c*x**n)**4/(4*n), True))

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 186 vs. \(2 (39) = 78\).

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

[In]

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

[Out]

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

Giac [A] (verification not implemented)

none

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

[In]

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

[Out]

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

Mupad [F(-1)]

Timed out. \[ \int \frac {\log \left (c x^n\right ) \left (a x^m+b \log ^2\left (c x^n\right )\right )}{x} \, dx=\int \frac {\ln \left (c\,x^n\right )\,\left (a\,x^m+b\,{\ln \left (c\,x^n\right )}^2\right )}{x} \,d x \]

[In]

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

[Out]

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