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

Optimal. Leaf size=79 \[ \frac{n \sqrt{b^2-4 a c} \tanh ^{-1}\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 \]

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

________________________________________________________________________________________

Rubi [A]  time = 0.0617153, antiderivative size = 79, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 6, integrand size = 15, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.4, Rules used = {2523, 773, 634, 618, 206, 628} \[ \frac{n \sqrt{b^2-4 a c} \tanh ^{-1}\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 \]

Antiderivative was successfully verified.

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

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]

Rule 773

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 634

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 618

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 206

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

Rule 628

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]

Rubi steps

\begin{align*} \int \log \left (d \left (a+b x+c x^2\right )^n\right ) \, dx &=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 ) \operatorname{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]  time = 0.0586933, size = 78, normalized size = 0.99 \[ \frac{2 n \sqrt{b^2-4 a c} \tanh ^{-1}\left (\frac{b+2 c x}{\sqrt{b^2-4 a c}}\right )+2 c x \left (\log \left (d (a+x (b+c x))^n\right )-2 n\right )+b n \log (a+x (b+c x))}{2 c} \]

Antiderivative was successfully verified.

[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]  time = 0.015, size = 118, normalized size = 1.5 \begin{align*} x\ln \left ( d \left ( c{x}^{2}+bx+a \right ) ^{n} \right ) -2\,nx+{\frac{bn\ln \left ( c{x}^{2}+bx+a \right ) }{2\,c}}+4\,{\frac{na}{\sqrt{4\,ac-{b}^{2}}}\arctan \left ({\frac{2\,cx+b}{\sqrt{4\,ac-{b}^{2}}}} \right ) }-{\frac{{b}^{2}n}{c}\arctan \left ({(2\,cx+b){\frac{1}{\sqrt{4\,ac-{b}^{2}}}}} \right ){\frac{1}{\sqrt{4\,ac-{b}^{2}}}}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [A]  time = 2.14705, size = 459, normalized size = 5.81 \begin{align*} \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 ] \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[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 [A]  time = 106.601, size = 275, normalized size = 3.48 \begin{align*} \begin{cases} \frac{b n \log{\left (\frac{b^{2}}{4 c} + b x + c x^{2} \right )}}{2 c} + n x \log{\left (\frac{b^{2}}{4 c} + b x + c x^{2} \right )} - 2 n x + x \log{\left (d \right )} & \text{for}\: a = \frac{b^{2}}{4 c} \\\frac{a n \log{\left (a + b x \right )}}{b} + n x \log{\left (a + b x \right )} - n x + x \log{\left (d \right )} & \text{for}\: c = 0 \\\frac{2 a n \log{\left (a + b x + c x^{2} \right )}}{\sqrt{- 4 a c + b^{2}}} - \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{b^{2} n \log{\left (a + b x + c x^{2} \right )}}{2 c \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 n \log{\left (a + b x + c x^{2} \right )}}{2 c} + n x \log{\left (a + b x + c x^{2} \right )} - 2 n x + x \log{\left (d \right )} & \text{otherwise} \end{cases} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

Piecewise((b*n*log(b**2/(4*c) + b*x + c*x**2)/(2*c) + n*x*log(b**2/(4*c) + b*x + c*x**2) - 2*n*x + x*log(d), E
q(a, b**2/(4*c))), (a*n*log(a + b*x)/b + n*x*log(a + b*x) - n*x + x*log(d), Eq(c, 0)), (2*a*n*log(a + b*x + c*
x**2)/sqrt(-4*a*c + b**2) - 4*a*n*log(b/(2*c) + x + sqrt(-4*a*c + b**2)/(2*c))/sqrt(-4*a*c + b**2) - b**2*n*lo
g(a + b*x + c*x**2)/(2*c*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*n*log(a + b*x + c*x**2)/(2*c) + n*x*log(a + b*x + c*x**2) - 2*n*x + x*log(d), True))

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

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