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

Optimal. Leaf size=20 \[ \frac {1}{2} \left (a x+b \log ^2\left (c x^n\right )\right )^2 \]

[Out]

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

________________________________________________________________________________________

Rubi [A]
time = 0.06, antiderivative size = 20, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 2, integrand size = 37, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.054, Rules used = {2641, 2624} \begin {gather*} \frac {1}{2} \left (a x+b \log ^2\left (c x^n\right )\right )^2 \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

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*} \int \left (\frac {a}{x}+\frac {2 b n \log \left (c x^n\right )}{x^2}\right ) \left (a x^2+b x \log ^2\left (c x^n\right )\right ) \, dx &=\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 )}{x^2} \, 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 )}{x} \, dx\\ &=\frac {1}{2} \left (a x+b \log ^2\left (c x^n\right )\right )^2\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.01, size = 38, normalized size = 1.90 \begin {gather*} \frac {a^2 x^2}{2}+a b x \log ^2\left (c x^n\right )+\frac {1}{2} b^2 \log ^4\left (c x^n\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(62\) vs. \(2(18)=36\).
time = 0.24, size = 63, normalized size = 3.15

method result size
default \(\frac {a^{2} x^{2}}{2}+a b x \ln \left (c \,{\mathrm e}^{n \ln \left (x \right )}\right )^{2}-2 a b n x \ln \left (c \,{\mathrm e}^{n \ln \left (x \right )}\right )+\frac {b^{2} \ln \left (c \,x^{n}\right )^{4}}{2}+2 \ln \left (c \,x^{n}\right ) a b n x\) \(63\)
risch \(\text {Expression too large to display}\) \(2698\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 74 vs. \(2 (18) = 36\).
time = 0.28, size = 74, normalized size = 3.70 \begin {gather*} \frac {1}{2} \, b^{2} \log \left (c x^{n}\right )^{4} - 2 \, a b n^{2} x + 2 \, a b n x \log \left (c x^{n}\right ) + a b x \log \left (c x^{n}\right )^{2} + \frac {1}{2} \, a^{2} x^{2} + 2 \, {\left (n^{2} x - n x \log \left (c x^{n}\right )\right )} a b \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 89 vs. \(2 (18) = 36\).
time = 0.37, size = 89, normalized size = 4.45 \begin {gather*} \frac {1}{2} \, b^{2} n^{4} \log \left (x\right )^{4} + 2 \, b^{2} n^{3} \log \left (c\right ) \log \left (x\right )^{3} + a b x \log \left (c\right )^{2} + \frac {1}{2} \, a^{2} x^{2} + {\left (3 \, b^{2} n^{2} \log \left (c\right )^{2} + a b n^{2} x\right )} \log \left (x\right )^{2} + 2 \, {\left (b^{2} n \log \left (c\right )^{3} + a b n x \log \left (c\right )\right )} \log \left (x\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Sympy [A]
time = 5.77, size = 51, normalized size = 2.55 \begin {gather*} \frac {a^{2} x^{2}}{2} + a b x \log {\left (c x^{n} \right )}^{2} - 2 b^{2} n \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 {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 90 vs. \(2 (18) = 36\).
time = 2.75, size = 90, normalized size = 4.50 \begin {gather*} \frac {1}{2} \, b^{2} n^{4} \log \left (x\right )^{4} + 2 \, b^{2} n^{3} \log \left (c\right ) \log \left (x\right )^{3} + 2 \, b^{2} n \log \left (c\right )^{3} \log \left (x\right ) + 2 \, a b n x \log \left (c\right ) \log \left (x\right ) + a b x \log \left (c\right )^{2} + \frac {1}{2} \, a^{2} x^{2} + {\left (3 \, b^{2} n^{2} \log \left (c\right )^{2} + a b n^{2} x\right )} \log \left (x\right )^{2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Mupad [B]
time = 0.29, size = 18, normalized size = 0.90 \begin {gather*} \frac {{\left (b\,{\ln \left (c\,x^n\right )}^2+a\,x\right )}^2}{2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________