### 3.32 $$\int \frac{(d x^m+e \log ^{-1+q}(c x^n)) (a x^m+b \log ^q(c x^n))^2}{x} \, dx$$

Optimal. Leaf size=235 $-\frac{b x^m \left (c x^n\right )^{-\frac{m}{n}} \log ^{2 q}\left (c x^n\right ) \left (-\frac{m \log \left (c x^n\right )}{n}\right )^{-2 q} (a e m-b d n q) \text{Gamma}\left (2 q+1,-\frac{m \log \left (c x^n\right )}{n}\right )}{m n q}-\frac{a 2^{-q} x^{2 m} \left (c x^n\right )^{-\frac{2 m}{n}} \log ^q\left (c x^n\right ) \left (-\frac{m \log \left (c x^n\right )}{n}\right )^{-q} (a e m-b d n q) \text{Gamma}\left (q+1,-\frac{2 m \log \left (c x^n\right )}{n}\right )}{m n q}-\frac{a^2 x^{3 m} (a e m-b d n q)}{3 b m n q}+\frac{e \left (a x^m+b \log ^q\left (c x^n\right )\right )^3}{3 b n q}$

[Out]

-(a^2*(a*e*m - b*d*n*q)*x^(3*m))/(3*b*m*n*q) - (b*(a*e*m - b*d*n*q)*x^m*Gamma[1 + 2*q, -((m*Log[c*x^n])/n)]*Lo
g[c*x^n]^(2*q))/(m*n*q*(c*x^n)^(m/n)*(-((m*Log[c*x^n])/n))^(2*q)) - (a*(a*e*m - b*d*n*q)*x^(2*m)*Gamma[1 + q,
(-2*m*Log[c*x^n])/n]*Log[c*x^n]^q)/(2^q*m*n*q*(c*x^n)^((2*m)/n)*(-((m*Log[c*x^n])/n))^q) + (e*(a*x^m + b*Log[c
*x^n]^q)^3)/(3*b*n*q)

________________________________________________________________________________________

Rubi [A]  time = 0.395189, antiderivative size = 235, normalized size of antiderivative = 1., number of steps used = 7, number of rules used = 4, integrand size = 40, $$\frac{\text{number of rules}}{\text{integrand size}}$$ = 0.1, Rules used = {2545, 6742, 2310, 2181} $-\frac{b x^m \left (c x^n\right )^{-\frac{m}{n}} \log ^{2 q}\left (c x^n\right ) \left (-\frac{m \log \left (c x^n\right )}{n}\right )^{-2 q} (a e m-b d n q) \text{Gamma}\left (2 q+1,-\frac{m \log \left (c x^n\right )}{n}\right )}{m n q}-\frac{a 2^{-q} x^{2 m} \left (c x^n\right )^{-\frac{2 m}{n}} \log ^q\left (c x^n\right ) \left (-\frac{m \log \left (c x^n\right )}{n}\right )^{-q} (a e m-b d n q) \text{Gamma}\left (q+1,-\frac{2 m \log \left (c x^n\right )}{n}\right )}{m n q}-\frac{a^2 x^{3 m} (a e m-b d n q)}{3 b m n q}+\frac{e \left (a x^m+b \log ^q\left (c x^n\right )\right )^3}{3 b n q}$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

-(a^2*(a*e*m - b*d*n*q)*x^(3*m))/(3*b*m*n*q) - (b*(a*e*m - b*d*n*q)*x^m*Gamma[1 + 2*q, -((m*Log[c*x^n])/n)]*Lo
g[c*x^n]^(2*q))/(m*n*q*(c*x^n)^(m/n)*(-((m*Log[c*x^n])/n))^(2*q)) - (a*(a*e*m - b*d*n*q)*x^(2*m)*Gamma[1 + q,
(-2*m*Log[c*x^n])/n]*Log[c*x^n]^q)/(2^q*m*n*q*(c*x^n)^((2*m)/n)*(-((m*Log[c*x^n])/n))^q) + (e*(a*x^m + b*Log[c
*x^n]^q)^3)/(3*b*n*q)

Rule 2545

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] - Dist[(a*e*m - b*
d*n*q)/(b*n*q), Int[x^(m - 1)*(a*x^m + b*Log[c*x^n]^q)^p, x], x] /; FreeQ[{a, b, c, d, e, m, n, p, q, r}, x] &
& EqQ[r, q - 1] && NeQ[p, -1] && NeQ[a*e*m - b*d*n*q, 0]

Rule 6742

Int[u_, x_Symbol] :> With[{v = ExpandIntegrand[u, x]}, Int[v, x] /; SumQ[v]]

Rule 2310

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

Rule 2181

Int[(F_)^((g_.)*((e_.) + (f_.)*(x_)))*((c_.) + (d_.)*(x_))^(m_), x_Symbol] :> -Simp[(F^(g*(e - (c*f)/d))*(c +
d*x)^FracPart[m]*Gamma[m + 1, (-((f*g*Log[F])/d))*(c + d*x)])/(d*(-((f*g*Log[F])/d))^(IntPart[m] + 1)*(-((f*g*
Log[F]*(c + d*x))/d))^FracPart[m]), x] /; FreeQ[{F, c, d, e, f, g, m}, x] &&  !IntegerQ[m]

Rubi steps

\begin{align*} \int \frac{\left (d x^m+e \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{e \left (a x^m+b \log ^q\left (c x^n\right )\right )^3}{3 b n q}-\left (-d+\frac{a e m}{b n q}\right ) \int x^{-1+m} \left (a x^m+b \log ^q\left (c x^n\right )\right )^2 \, dx\\ &=\frac{e \left (a x^m+b \log ^q\left (c x^n\right )\right )^3}{3 b n q}-\left (-d+\frac{a e m}{b n q}\right ) \int \left (a^2 x^{-1+3 m}+2 a b x^{-1+2 m} \log ^q\left (c x^n\right )+b^2 x^{-1+m} \log ^{2 q}\left (c x^n\right )\right ) \, dx\\ &=\frac{a^2 \left (d-\frac{a e m}{b n q}\right ) x^{3 m}}{3 m}+\frac{e \left (a x^m+b \log ^q\left (c x^n\right )\right )^3}{3 b n q}-\left (2 a b \left (-d+\frac{a e m}{b n q}\right )\right ) \int x^{-1+2 m} \log ^q\left (c x^n\right ) \, dx-\left (b^2 \left (-d+\frac{a e m}{b n q}\right )\right ) \int x^{-1+m} \log ^{2 q}\left (c x^n\right ) \, dx\\ &=\frac{a^2 \left (d-\frac{a e m}{b n q}\right ) x^{3 m}}{3 m}+\frac{e \left (a x^m+b \log ^q\left (c x^n\right )\right )^3}{3 b n q}-\frac{\left (2 a b \left (-d+\frac{a e m}{b n q}\right ) x^{2 m} \left (c x^n\right )^{-\frac{2 m}{n}}\right ) \operatorname{Subst}\left (\int e^{\frac{2 m x}{n}} x^q \, dx,x,\log \left (c x^n\right )\right )}{n}-\frac{\left (b^2 \left (-d+\frac{a e m}{b n q}\right ) x^m \left (c x^n\right )^{-\frac{m}{n}}\right ) \operatorname{Subst}\left (\int e^{\frac{m x}{n}} x^{2 q} \, dx,x,\log \left (c x^n\right )\right )}{n}\\ &=\frac{a^2 \left (d-\frac{a e m}{b n q}\right ) x^{3 m}}{3 m}-\frac{b (a e m-b d n q) x^m \left (c x^n\right )^{-\frac{m}{n}} \Gamma \left (1+2 q,-\frac{m \log \left (c x^n\right )}{n}\right ) \log ^{2 q}\left (c x^n\right ) \left (-\frac{m \log \left (c x^n\right )}{n}\right )^{-2 q}}{m n q}-\frac{2^{-q} a (a e m-b d n q) x^{2 m} \left (c x^n\right )^{-\frac{2 m}{n}} \Gamma \left (1+q,-\frac{2 m \log \left (c x^n\right )}{n}\right ) \log ^q\left (c x^n\right ) \left (-\frac{m \log \left (c x^n\right )}{n}\right )^{-q}}{m n q}+\frac{e \left (a x^m+b \log ^q\left (c x^n\right )\right )^3}{3 b n q}\\ \end{align*}

Mathematica [A]  time = 0.927323, size = 298, normalized size = 1.27 $\frac{2^{-q} \left (c x^n\right )^{-\frac{2 m}{n}} \left (-\frac{m \log \left (c x^n\right )}{n}\right )^{-2 q} \left (\left (-\frac{m \log \left (c x^n\right )}{n}\right )^q \left (-3 a^2 e m q x^{2 m} \log ^q\left (c x^n\right ) \text{Gamma}\left (q,-\frac{2 m \log \left (c x^n\right )}{n}\right )+3 a b d n q x^{2 m} \log ^q\left (c x^n\right ) \text{Gamma}\left (q+1,-\frac{2 m \log \left (c x^n\right )}{n}\right )+2^q \left (c x^n\right )^{\frac{2 m}{n}} \left (-\frac{m \log \left (c x^n\right )}{n}\right )^q \left (a^2 d n q x^{3 m}+b^2 e m \log ^{3 q}\left (c x^n\right )\right )\right )-3 a b e m 2^{q+1} q x^m \left (c x^n\right )^{m/n} \log ^{2 q}\left (c x^n\right ) \text{Gamma}\left (2 q,-\frac{m \log \left (c x^n\right )}{n}\right )+3 b^2 d n 2^q q x^m \left (c x^n\right )^{m/n} \log ^{2 q}\left (c x^n\right ) \text{Gamma}\left (2 q+1,-\frac{m \log \left (c x^n\right )}{n}\right )\right )}{3 m n q}$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [F]  time = 17.253, size = 0, normalized size = 0. \begin{align*} \int{\frac{ \left ( d{x}^{m}+e \left ( \ln \left ( c{x}^{n} \right ) \right ) ^{-1+q} \right ) \left ( a{x}^{m}+b \left ( \ln \left ( c{x}^{n} \right ) \right ) ^{q} \right ) ^{2}}{x}}\, dx \end{align*}

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

[In]

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

[Out]

int((d*x^m+e*ln(c*x^n)^(-1+q))*(a*x^m+b*ln(c*x^n)^q)^2/x,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((d*x^m+e*log(c*x^n)^(-1+q))*(a*x^m+b*log(c*x^n)^q)^2/x,x, algorithm="maxima")

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [F]  time = 0., size = 0, normalized size = 0. \begin{align*}{\rm integral}\left (\frac{a^{2} e x^{2 \, m} \log \left (c x^{n}\right )^{q - 1} + a^{2} d x^{3 \, m} +{\left (b^{2} d x^{m} + b^{2} e \log \left (c x^{n}\right )^{q - 1}\right )} \log \left (c x^{n}\right )^{2 \, q} + 2 \,{\left (a b e x^{m} \log \left (c x^{n}\right )^{q - 1} + a b d x^{2 \, m}\right )} \log \left (c x^{n}\right )^{q}}{x}, x\right ) \end{align*}

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

[In]

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

[Out]

integral((a^2*e*x^(2*m)*log(c*x^n)^(q - 1) + a^2*d*x^(3*m) + (b^2*d*x^m + b^2*e*log(c*x^n)^(q - 1))*log(c*x^n)
^(2*q) + 2*(a*b*e*x^m*log(c*x^n)^(q - 1) + a*b*d*x^(2*m))*log(c*x^n)^q)/x, x)

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

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

[In]

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

[Out]

Timed out

________________________________________________________________________________________

Giac [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{{\left (a x^{m} + b \log \left (c x^{n}\right )^{q}\right )}^{2}{\left (d x^{m} + e \log \left (c x^{n}\right )^{q - 1}\right )}}{x}\,{d x} \end{align*}

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

[In]

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

[Out]

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