\(\int \log (d (a+b x+c x^2)^n) \, dx\) [86]

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

Optimal result

Integrand size = 15, antiderivative size = 79 \[ \int \log \left (d \left (a+b x+c x^2\right )^n\right ) \, dx=-2 n x+\frac {\sqrt {b^2-4 a c} n \text {arctanh}\left (\frac {b+2 c x}{\sqrt {b^2-4 a c}}\right )}{c}+\frac {b n \log \left (a+b x+c x^2\right )}{2 c}+x \log \left (d \left (a+b x+c x^2\right )^n\right ) \]

[Out]

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

Rubi [A] (verified)

Time = 0.04 (sec) , antiderivative size = 79, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.400, Rules used = {2603, 787, 648, 632, 212, 642} \[ \int \log \left (d \left (a+b x+c x^2\right )^n\right ) \, dx=\frac {n \sqrt {b^2-4 a c} \text {arctanh}\left (\frac {b+2 c x}{\sqrt {b^2-4 a c}}\right )}{c}+x \log \left (d \left (a+b x+c x^2\right )^n\right )+\frac {b n \log \left (a+b x+c x^2\right )}{2 c}-2 n x \]

[In]

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

[Out]

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

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 787

Int[(((d_.) + (e_.)*(x_))*((f_) + (g_.)*(x_)))/((a_.) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Simp[e*g*(x/c
), x] + Dist[1/c, Int[(c*d*f - a*e*g + (c*e*f + c*d*g - b*e*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]

Rule 2603

Int[((a_.) + Log[(c_.)*(RFx_)^(p_.)]*(b_.))^(n_.), x_Symbol] :> Simp[x*(a + b*Log[c*RFx^p])^n, x] - Dist[b*n*p
, Int[SimplifyIntegrand[x*(a + b*Log[c*RFx^p])^(n - 1)*(D[RFx, x]/RFx), x], x], x] /; FreeQ[{a, b, c, p}, x] &
& RationalFunctionQ[RFx, x] && IGtQ[n, 0]

Rubi steps \begin{align*} \text {integral}& = x \log \left (d \left (a+b x+c x^2\right )^n\right )-n \int \frac {x (b+2 c x)}{a+b x+c x^2} \, dx \\ & = -2 n x+x \log \left (d \left (a+b x+c x^2\right )^n\right )-\frac {n \int \frac {-2 a c-b c x}{a+b x+c x^2} \, dx}{c} \\ & = -2 n x+x \log \left (d \left (a+b x+c x^2\right )^n\right )+\frac {(b n) \int \frac {b+2 c x}{a+b x+c x^2} \, dx}{2 c}-\frac {\left (\left (b^2-4 a c\right ) n\right ) \int \frac {1}{a+b x+c x^2} \, dx}{2 c} \\ & = -2 n x+\frac {b n \log \left (a+b x+c x^2\right )}{2 c}+x \log \left (d \left (a+b x+c x^2\right )^n\right )+\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 )}{c} \\ & = -2 n x+\frac {\sqrt {b^2-4 a c} n \tanh ^{-1}\left (\frac {b+2 c x}{\sqrt {b^2-4 a c}}\right )}{c}+\frac {b n \log \left (a+b x+c x^2\right )}{2 c}+x \log \left (d \left (a+b x+c x^2\right )^n\right ) \\ \end{align*}

Mathematica [A] (verified)

Time = 0.03 (sec) , antiderivative size = 78, normalized size of antiderivative = 0.99 \[ \int \log \left (d \left (a+b x+c x^2\right )^n\right ) \, dx=\frac {2 \sqrt {b^2-4 a c} n \text {arctanh}\left (\frac {b+2 c x}{\sqrt {b^2-4 a c}}\right )+b n \log (a+x (b+c x))+2 c x \left (-2 n+\log \left (d (a+x (b+c x))^n\right )\right )}{2 c} \]

[In]

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

[Out]

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

Maple [A] (verified)

Time = 0.15 (sec) , antiderivative size = 89, normalized size of antiderivative = 1.13

method result size
default \(x \ln \left (d \left (c \,x^{2}+b x +a \right )^{n}\right )-n \left (2 x -\frac {b \ln \left (c \,x^{2}+b x +a \right )}{2 c}+\frac {2 \left (-2 a +\frac {b^{2}}{2 c}\right ) \arctan \left (\frac {2 x c +b}{\sqrt {4 c a -b^{2}}}\right )}{\sqrt {4 c a -b^{2}}}\right )\) \(89\)
parts \(x \ln \left (d \left (c \,x^{2}+b x +a \right )^{n}\right )-n \left (2 x -\frac {b \ln \left (c \,x^{2}+b x +a \right )}{2 c}+\frac {2 \left (-2 a +\frac {b^{2}}{2 c}\right ) \arctan \left (\frac {2 x c +b}{\sqrt {4 c a -b^{2}}}\right )}{\sqrt {4 c a -b^{2}}}\right )\) \(89\)
risch \(x \ln \left (\left (c \,x^{2}+b x +a \right )^{n}\right )+\frac {i {\operatorname {csgn}\left (i d \left (c \,x^{2}+b x +a \right )^{n}\right )}^{2} \operatorname {csgn}\left (i \left (c \,x^{2}+b x +a \right )^{n}\right ) x \pi }{2}-\frac {i \pi x \,\operatorname {csgn}\left (i \left (c \,x^{2}+b x +a \right )^{n}\right ) \operatorname {csgn}\left (i d \left (c \,x^{2}+b x +a \right )^{n}\right ) \operatorname {csgn}\left (i d \right )}{2}-\frac {i \pi x {\operatorname {csgn}\left (i d \left (c \,x^{2}+b x +a \right )^{n}\right )}^{3}}{2}+\frac {i \operatorname {csgn}\left (i d \right ) {\operatorname {csgn}\left (i d \left (c \,x^{2}+b x +a \right )^{n}\right )}^{2} x \pi }{2}+\ln \left (d \right ) x +\frac {n \ln \left (-2 x c \sqrt {-4 c a +b^{2}}-b \sqrt {-4 c a +b^{2}}+4 c a -b^{2}\right ) \sqrt {-4 c a +b^{2}}}{2 c}+\frac {n \ln \left (-2 x c \sqrt {-4 c a +b^{2}}-b \sqrt {-4 c a +b^{2}}+4 c a -b^{2}\right ) b}{2 c}-\frac {n \ln \left (2 x c \sqrt {-4 c a +b^{2}}+b \sqrt {-4 c a +b^{2}}+4 c a -b^{2}\right ) \sqrt {-4 c a +b^{2}}}{2 c}+\frac {n \ln \left (2 x c \sqrt {-4 c a +b^{2}}+b \sqrt {-4 c a +b^{2}}+4 c a -b^{2}\right ) b}{2 c}-2 n x\) \(357\)

[In]

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

[Out]

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

Fricas [A] (verification not implemented)

none

Time = 0.32 (sec) , antiderivative size = 190, normalized size of antiderivative = 2.41 \[ \int \log \left (d \left (a+b x+c x^2\right )^n\right ) \, dx=\left [-\frac {4 \, c n x - 2 \, c x \log \left (d\right ) - \sqrt {b^{2} - 4 \, a c} n \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 (2 \, c n x + b n\right )} \log \left (c x^{2} + b x + a\right )}{2 \, c}, -\frac {4 \, c n x - 2 \, c x \log \left (d\right ) - 2 \, \sqrt {-b^{2} + 4 \, a c} n \arctan \left (-\frac {\sqrt {-b^{2} + 4 \, a c} {\left (2 \, c x + b\right )}}{b^{2} - 4 \, a c}\right ) - {\left (2 \, c n x + b n\right )} \log \left (c x^{2} + b x + a\right )}{2 \, c}\right ] \]

[In]

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

[Out]

[-1/2*(4*c*n*x - 2*c*x*log(d) - sqrt(b^2 - 4*a*c)*n*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)) - (2*c*n*x + b*n)*log(c*x^2 + b*x + a))/c, -1/2*(4*c*n*x - 2*c*x*log(d) - 2*s
qrt(-b^2 + 4*a*c)*n*arctan(-sqrt(-b^2 + 4*a*c)*(2*c*x + b)/(b^2 - 4*a*c)) - (2*c*n*x + b*n)*log(c*x^2 + b*x +
a))/c]

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 274 vs. \(2 (75) = 150\).

Time = 33.64 (sec) , antiderivative size = 274, normalized size of antiderivative = 3.47 \[ \int \log \left (d \left (a+b x+c x^2\right )^n\right ) \, dx=\begin {cases} \frac {a \log {\left (d \left (a + b x\right )^{n} \right )}}{b} - n x + x \log {\left (d \left (a + b x\right )^{n} \right )} & \text {for}\: c = 0 \\\frac {b \log {\left (d \left (\frac {b^{2}}{4 c} + b x + c x^{2}\right )^{n} \right )}}{2 c} - 2 n x + x \log {\left (d \left (\frac {b^{2}}{4 c} + b x + c x^{2}\right )^{n} \right )} & \text {for}\: a = \frac {b^{2}}{4 c} \\- \frac {4 a n \log {\left (\frac {b}{2 c} + x + \frac {\sqrt {- 4 a c + b^{2}}}{2 c} \right )}}{\sqrt {- 4 a c + b^{2}}} + \frac {2 a \log {\left (d \left (a + b x + c x^{2}\right )^{n} \right )}}{\sqrt {- 4 a c + b^{2}}} + \frac {b^{2} n \log {\left (\frac {b}{2 c} + x + \frac {\sqrt {- 4 a c + b^{2}}}{2 c} \right )}}{c \sqrt {- 4 a c + b^{2}}} - \frac {b^{2} \log {\left (d \left (a + b x + c x^{2}\right )^{n} \right )}}{2 c \sqrt {- 4 a c + b^{2}}} + \frac {b \log {\left (d \left (a + b x + c x^{2}\right )^{n} \right )}}{2 c} - 2 n x + x \log {\left (d \left (a + b x + c x^{2}\right )^{n} \right )} & \text {otherwise} \end {cases} \]

[In]

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

[Out]

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

Maxima [F(-2)]

Exception generated. \[ \int \log \left (d \left (a+b x+c x^2\right )^n\right ) \, dx=\text {Exception raised: ValueError} \]

[In]

integrate(log(d*(c*x^2+b*x+a)^n),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

Giac [A] (verification not implemented)

none

Time = 0.46 (sec) , antiderivative size = 92, normalized size of antiderivative = 1.16 \[ \int \log \left (d \left (a+b x+c x^2\right )^n\right ) \, dx=n x \log \left (c x^{2} + b x + a\right ) - {\left (2 \, n - \log \left (d\right )\right )} x + \frac {b n \log \left (c x^{2} + b x + a\right )}{2 \, c} - \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} c} \]

[In]

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

[Out]

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

Mupad [B] (verification not implemented)

Time = 0.00 (sec) , antiderivative size = 120, normalized size of antiderivative = 1.52 \[ \int \log \left (d \left (a+b x+c x^2\right )^n\right ) \, dx=x\,\ln \left (d\,{\left (c\,x^2+b\,x+a\right )}^n\right )-2\,n\,x-\frac {n\,\mathrm {atan}\left (\frac {b\,n\,\sqrt {4\,a\,c-b^2}}{2\,\left (\frac {b^2\,n}{2}-2\,a\,c\,n\right )}-\frac {n\,x\,\sqrt {4\,a\,c-b^2}}{2\,a\,n-\frac {b^2\,n}{2\,c}}\right )\,\sqrt {4\,a\,c-b^2}}{c}+\frac {b\,n\,\ln \left (c\,x^2+b\,x+a\right )}{2\,c} \]

[In]

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

[Out]

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