### 3.11 $$\int \frac{\log (c x^n) (a x^m+b \log ^2(c x^n))}{x} \, dx$$

Optimal. Leaf size=41 $\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}$

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.0771009, antiderivative size = 41, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 4, integrand size = 26, $$\frac{\text{number of rules}}{\text{integrand size}}$$ = 0.154, Rules used = {2539, 2304, 2302, 30} $\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}$

Antiderivative was successfully veriﬁed.

[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 2539

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]

Rule 2304

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 2302

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 30

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

Rubi steps

\begin{align*} \int \frac{\log \left (c x^n\right ) \left (a x^m+b \log ^2\left (c x^n\right )\right )}{x} \, dx &=\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 \operatorname{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]  time = 0.0334815, size = 41, normalized size = 1. $\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}$

Antiderivative was successfully veriﬁed.

[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 [C]  time = 0.303, size = 2146, normalized size = 52.3 \begin{align*} \text{result too large to display} \end{align*}

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

[In]

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

[Out]

-a*n*x^m/m^2+(-3/2*b*n*ln(x)^2-3/2*I*Pi*b*csgn(I*c)*csgn(I*x^n)*csgn(I*c*x^n)*ln(x)+3/2*I*Pi*b*csgn(I*c)*csgn(
I*c*x^n)^2*ln(x)+3/2*I*Pi*b*csgn(I*x^n)*csgn(I*c*x^n)^2*ln(x)-3/2*I*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*n*b*Pi^2*ln(x)^2-3/4*csgn(I*c*x^n)^3*csgn(I*x^n)^2*csgn(I*c)*n*b*Pi^2*ln(x)^2+3/2*I*ln(x)^2*ln(c)*Pi*b*n*csg
n(I*c)*csgn(I*x^n)*csgn(I*c*x^n)+3/8*csgn(I*c*x^n)^6*n*b*Pi^2*ln(x)^2-3/4*ln(x)*csgn(I*c*x^n)^6*b*Pi^2*ln(c)-1
/2*I*ln(x)^3*Pi*b*n^2*csgn(I*c*x^n)^3-3/2*I*ln(c)^2*Pi*b*csgn(I*c*x^n)^3*ln(x)-1/8*I*Pi^3*b*csgn(I*c)^3*csgn(I
*c*x^n)^6*ln(x)+3/8*I*Pi^3*b*csgn(I*c)^2*csgn(I*c*x^n)^7*ln(x)-3/8*I*Pi^3*b*csgn(I*c)*csgn(I*c*x^n)^8*ln(x)-1/
8*I*Pi^3*b*csgn(I*x^n)^3*csgn(I*c*x^n)^6*ln(x)+3/8*I*Pi^3*b*csgn(I*x^n)^2*csgn(I*c*x^n)^7*ln(x)-3/8*I*Pi^3*b*c
sgn(I*x^n)*csgn(I*c*x^n)^8*ln(x)

________________________________________________________________________________________

Maxima [F(-2)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}

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

[In]

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

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [B]  time = 1.95644, size = 213, normalized size = 5.2 \begin{align*} \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}} \end{align*}

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

[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]  time = 10.1664, size = 68, normalized size = 1.66 \begin{align*} - 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 - 1 \neq -1 \\\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 ) \end{align*}

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

[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 - 1, -1)), (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))

________________________________________________________________________________________

Giac [A]  time = 1.27757, size = 99, normalized size = 2.41 \begin{align*} \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}} \end{align*}

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

[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