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

Optimal. Leaf size=86 \[ \frac {\sqrt {b^2-4 a c} n \tanh ^{-1}\left (\frac {b+2 c x}{\sqrt {b^2-4 a c}}\right )}{a}+\frac {b n \log (x)}{a}-\frac {b n \log \left (a+b x+c x^2\right )}{2 a}-\frac {\log \left (d \left (a+b x+c x^2\right )^n\right )}{x} \]

[Out]

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

________________________________________________________________________________________

Rubi [A]
time = 0.08, antiderivative size = 86, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 6, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.316, Rules used = {2605, 814, 648, 632, 212, 642} \begin {gather*} \frac {n \sqrt {b^2-4 a c} \tanh ^{-1}\left (\frac {b+2 c x}{\sqrt {b^2-4 a c}}\right )}{a}-\frac {\log \left (d \left (a+b x+c x^2\right )^n\right )}{x}-\frac {b n \log \left (a+b x+c x^2\right )}{2 a}+\frac {b n \log (x)}{a} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

Rule 212

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))*ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 632

Int[((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(-1), x_Symbol] :> Dist[-2, Subst[Int[1/Simp[b^2 - 4*a*c - x^2, x], x]
, x, b + 2*c*x], x] /; FreeQ[{a, b, c}, x] && NeQ[b^2 - 4*a*c, 0]

Rule 642

Int[((d_) + (e_.)*(x_))/((a_.) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Simp[d*(Log[RemoveContent[a + b*x +
c*x^2, x]]/b), x] /; FreeQ[{a, b, c, d, e}, x] && EqQ[2*c*d - b*e, 0]

Rule 648

Int[((d_.) + (e_.)*(x_))/((a_) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Dist[(2*c*d - b*e)/(2*c), Int[1/(a +
 b*x + c*x^2), x], x] + Dist[e/(2*c), Int[(b + 2*c*x)/(a + b*x + c*x^2), x], x] /; FreeQ[{a, b, c, d, e}, x] &
& NeQ[2*c*d - b*e, 0] && NeQ[b^2 - 4*a*c, 0] &&  !NiceSqrtQ[b^2 - 4*a*c]

Rule 814

Int[(((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_)))/((a_.) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Int[Exp
andIntegrand[(d + e*x)^m*((f + g*x)/(a + b*x + c*x^2)), x], x] /; FreeQ[{a, b, c, d, e, f, g}, x] && NeQ[b^2 -
 4*a*c, 0] && NeQ[c*d^2 - b*d*e + a*e^2, 0] && IntegerQ[m]

Rule 2605

Int[((a_.) + Log[(c_.)*(RFx_)^(p_.)]*(b_.))^(n_.)*((d_.) + (e_.)*(x_))^(m_.), x_Symbol] :> Simp[(d + e*x)^(m +
 1)*((a + b*Log[c*RFx^p])^n/(e*(m + 1))), x] - Dist[b*n*(p/(e*(m + 1))), Int[SimplifyIntegrand[(d + e*x)^(m +
1)*(a + b*Log[c*RFx^p])^(n - 1)*(D[RFx, x]/RFx), x], x], x] /; FreeQ[{a, b, c, d, e, m, p}, x] && RationalFunc
tionQ[RFx, x] && IGtQ[n, 0] && (EqQ[n, 1] || IntegerQ[m]) && NeQ[m, -1]

Rubi steps

\begin {align*} \int \frac {\log \left (d \left (a+b x+c x^2\right )^n\right )}{x^2} \, dx &=-\frac {\log \left (d \left (a+b x+c x^2\right )^n\right )}{x}+n \int \frac {b+2 c x}{x \left (a+b x+c x^2\right )} \, dx\\ &=-\frac {\log \left (d \left (a+b x+c x^2\right )^n\right )}{x}+n \int \left (\frac {b}{a x}+\frac {-b^2+2 a c-b c x}{a \left (a+b x+c x^2\right )}\right ) \, dx\\ &=\frac {b n \log (x)}{a}-\frac {\log \left (d \left (a+b x+c x^2\right )^n\right )}{x}+\frac {n \int \frac {-b^2+2 a c-b c x}{a+b x+c x^2} \, dx}{a}\\ &=\frac {b n \log (x)}{a}-\frac {\log \left (d \left (a+b x+c x^2\right )^n\right )}{x}-\frac {(b n) \int \frac {b+2 c x}{a+b x+c x^2} \, dx}{2 a}-\frac {\left (\left (b^2-4 a c\right ) n\right ) \int \frac {1}{a+b x+c x^2} \, dx}{2 a}\\ &=\frac {b n \log (x)}{a}-\frac {b n \log \left (a+b x+c x^2\right )}{2 a}-\frac {\log \left (d \left (a+b x+c x^2\right )^n\right )}{x}+\frac {\left (\left (b^2-4 a c\right ) n\right ) \text {Subst}\left (\int \frac {1}{b^2-4 a c-x^2} \, dx,x,b+2 c x\right )}{a}\\ &=\frac {\sqrt {b^2-4 a c} n \tanh ^{-1}\left (\frac {b+2 c x}{\sqrt {b^2-4 a c}}\right )}{a}+\frac {b n \log (x)}{a}-\frac {b n \log \left (a+b x+c x^2\right )}{2 a}-\frac {\log \left (d \left (a+b x+c x^2\right )^n\right )}{x}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.08, size = 87, normalized size = 1.01 \begin {gather*} \frac {2 \sqrt {-b^2+4 a c} n \tan ^{-1}\left (\frac {b+2 c x}{\sqrt {-b^2+4 a c}}\right )+2 b n \log (x)-b n \log (a+x (b+c x))-\frac {2 a \log \left (d (a+x (b+c x))^n\right )}{x}}{2 a} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [C] Result contains higher order function than in optimal. Order 9 vs. order 3.
time = 0.05, size = 261, normalized size = 3.03

method result size
risch \(-\frac {\ln \left (\left (c \,x^{2}+b x +a \right )^{n}\right )}{x}+\frac {i \pi a \,\mathrm {csgn}\left (i d \right ) \mathrm {csgn}\left (i \left (c \,x^{2}+b x +a \right )^{n}\right ) \mathrm {csgn}\left (i d \left (c \,x^{2}+b x +a \right )^{n}\right )-i \pi a \,\mathrm {csgn}\left (i d \right ) \mathrm {csgn}\left (i d \left (c \,x^{2}+b x +a \right )^{n}\right )^{2}-i \pi a \,\mathrm {csgn}\left (i \left (c \,x^{2}+b x +a \right )^{n}\right ) \mathrm {csgn}\left (i d \left (c \,x^{2}+b x +a \right )^{n}\right )^{2}+i \pi a \mathrm {csgn}\left (i d \left (c \,x^{2}+b x +a \right )^{n}\right )^{3}+2 b n \ln \left (x \right ) x +2 \left (\munderset {\textit {\_R} =\RootOf \left (a \,\textit {\_Z}^{2}+b n \textit {\_Z} +c \,n^{2}\right )}{\sum }\textit {\_R} \ln \left (\left (\left (6 a c -2 b^{2}\right ) \textit {\_R}^{2}+\textit {\_R} b c n +4 c^{2} n^{2}\right ) x -a b \,\textit {\_R}^{2}+\left (-2 a c n +b^{2} n \right ) \textit {\_R} +2 b c \,n^{2}\right )\right ) a x -2 \ln \left (d \right ) a}{2 a x}\) \(261\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-1/x*ln((c*x^2+b*x+a)^n)+1/2*(I*Pi*a*csgn(I*d)*csgn(I*(c*x^2+b*x+a)^n)*csgn(I*d*(c*x^2+b*x+a)^n)-I*Pi*a*csgn(I
*d)*csgn(I*d*(c*x^2+b*x+a)^n)^2-I*Pi*a*csgn(I*(c*x^2+b*x+a)^n)*csgn(I*d*(c*x^2+b*x+a)^n)^2+I*Pi*a*csgn(I*d*(c*
x^2+b*x+a)^n)^3+2*b*n*ln(x)*x+2*sum(_R*ln(((6*a*c-2*b^2)*_R^2+_R*b*c*n+4*c^2*n^2)*x-a*b*_R^2+(-2*a*c*n+b^2*n)*
_R+2*b*c*n^2),_R=RootOf(_Z^2*a+_Z*b*n+c*n^2))*a*x-2*ln(d)*a)/a/x

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'a
ssume' command before evaluation *may* help (example of legal syntax is 'assume(4*a*c-b^2>0)', see `assume?` f
or more deta

________________________________________________________________________________________

Fricas [A]
time = 0.38, size = 199, normalized size = 2.31 \begin {gather*} \left [\frac {2 \, b n x \log \left (x\right ) + \sqrt {b^{2} - 4 \, a c} n x \log \left (\frac {2 \, c^{2} x^{2} + 2 \, b c x + b^{2} - 2 \, a c + \sqrt {b^{2} - 4 \, a c} {\left (2 \, c x + b\right )}}{c x^{2} + b x + a}\right ) - {\left (b n x + 2 \, a n\right )} \log \left (c x^{2} + b x + a\right ) - 2 \, a \log \left (d\right )}{2 \, a x}, \frac {2 \, b n x \log \left (x\right ) + 2 \, \sqrt {-b^{2} + 4 \, a c} n x \arctan \left (-\frac {\sqrt {-b^{2} + 4 \, a c} {\left (2 \, c x + b\right )}}{b^{2} - 4 \, a c}\right ) - {\left (b n x + 2 \, a n\right )} \log \left (c x^{2} + b x + a\right ) - 2 \, a \log \left (d\right )}{2 \, a x}\right ] \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

[1/2*(2*b*n*x*log(x) + sqrt(b^2 - 4*a*c)*n*x*log((2*c^2*x^2 + 2*b*c*x + b^2 - 2*a*c + sqrt(b^2 - 4*a*c)*(2*c*x
 + b))/(c*x^2 + b*x + a)) - (b*n*x + 2*a*n)*log(c*x^2 + b*x + a) - 2*a*log(d))/(a*x), 1/2*(2*b*n*x*log(x) + 2*
sqrt(-b^2 + 4*a*c)*n*x*arctan(-sqrt(-b^2 + 4*a*c)*(2*c*x + b)/(b^2 - 4*a*c)) - (b*n*x + 2*a*n)*log(c*x^2 + b*x
 + a) - 2*a*log(d))/(a*x)]

________________________________________________________________________________________

Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 211 vs. \(2 (78) = 156\).
time = 198.61, size = 211, normalized size = 2.45 \begin {gather*} \begin {cases} - \frac {n}{x} - \frac {\log {\left (d \left (b x\right )^{n} \right )}}{x} & \text {for}\: a = 0 \wedge c = 0 \\- \frac {n}{x} - \frac {\log {\left (d \left (b x + c x^{2}\right )^{n} \right )}}{x} - \frac {2 c n \log {\left (b + c x \right )}}{b} + \frac {c \log {\left (d \left (b x + c x^{2}\right )^{n} \right )}}{b} & \text {for}\: a = 0 \\- \frac {\log {\left (d \left (a + b x\right )^{n} \right )}}{x} + \frac {b n \log {\left (x \right )}}{a} - \frac {b \log {\left (d \left (a + b x\right )^{n} \right )}}{a} & \text {for}\: c = 0 \\- \frac {\log {\left (d \left (a + b x + c x^{2}\right )^{n} \right )}}{x} + \frac {b n \log {\left (x \right )}}{a} - \frac {b \log {\left (d \left (a + b x + c x^{2}\right )^{n} \right )}}{2 a} + \frac {n \sqrt {- 4 a c + b^{2}} \log {\left (\frac {b}{2 c} + x + \frac {\sqrt {- 4 a c + b^{2}}}{2 c} \right )}}{a} - \frac {\sqrt {- 4 a c + b^{2}} \log {\left (d \left (a + b x + c x^{2}\right )^{n} \right )}}{2 a} & \text {otherwise} \end {cases} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

Piecewise((-n/x - log(d*(b*x)**n)/x, Eq(a, 0) & Eq(c, 0)), (-n/x - log(d*(b*x + c*x**2)**n)/x - 2*c*n*log(b +
c*x)/b + c*log(d*(b*x + c*x**2)**n)/b, Eq(a, 0)), (-log(d*(a + b*x)**n)/x + b*n*log(x)/a - b*log(d*(a + b*x)**
n)/a, Eq(c, 0)), (-log(d*(a + b*x + c*x**2)**n)/x + b*n*log(x)/a - b*log(d*(a + b*x + c*x**2)**n)/(2*a) + n*sq
rt(-4*a*c + b**2)*log(b/(2*c) + x + sqrt(-4*a*c + b**2)/(2*c))/a - sqrt(-4*a*c + b**2)*log(d*(a + b*x + c*x**2
)**n)/(2*a), True))

________________________________________________________________________________________

Giac [A]
time = 3.14, size = 99, normalized size = 1.15 \begin {gather*} -\frac {b n \log \left (c x^{2} + b x + a\right )}{2 \, a} + \frac {b n \log \left (x\right )}{a} - \frac {n \log \left (c x^{2} + b x + a\right )}{x} - \frac {{\left (b^{2} n - 4 \, a c n\right )} \arctan \left (\frac {2 \, c x + b}{\sqrt {-b^{2} + 4 \, a c}}\right )}{\sqrt {-b^{2} + 4 \, a c} a} - \frac {\log \left (d\right )}{x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Mupad [B]
time = 0.93, size = 262, normalized size = 3.05 \begin {gather*} \frac {b\,n\,\ln \left (x\right )}{a}-\frac {\ln \left (2\,b\,c^2\,n^2+4\,c^3\,n^2\,x-\frac {n\,\left (b-\sqrt {b^2-4\,a\,c}\right )\,\left (b^2\,c\,n-2\,a\,c^2\,n+b\,c^2\,n\,x+\frac {c\,n\,\left (b-\sqrt {b^2-4\,a\,c}\right )\,\left (2\,x\,b^2+a\,b-6\,a\,c\,x\right )}{2\,a}\right )}{2\,a}\right )\,\left (b\,n-n\,\sqrt {b^2-4\,a\,c}\right )}{2\,a}-\frac {\ln \left (2\,b\,c^2\,n^2+4\,c^3\,n^2\,x-\frac {n\,\left (b+\sqrt {b^2-4\,a\,c}\right )\,\left (b^2\,c\,n-2\,a\,c^2\,n+b\,c^2\,n\,x+\frac {c\,n\,\left (b+\sqrt {b^2-4\,a\,c}\right )\,\left (2\,x\,b^2+a\,b-6\,a\,c\,x\right )}{2\,a}\right )}{2\,a}\right )\,\left (b\,n+n\,\sqrt {b^2-4\,a\,c}\right )}{2\,a}-\frac {\ln \left (d\,{\left (c\,x^2+b\,x+a\right )}^n\right )}{x} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________