3.75 \(\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+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]  time = 0.06, antiderivative size = 79, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, integrand size = 15, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.400, 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 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 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 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]

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

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.06, 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)

________________________________________________________________________________________

fricas [A]  time = 0.48, size = 190, normalized size = 2.41 \[ \left [-\frac {4 \, c n x - 2 \, c x \log \relax (d) - \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 \relax (d) - 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 ] \]

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]

________________________________________________________________________________________

giac [A]  time = 0.19, size = 92, normalized size = 1.16 \[ n x \log \left (c x^{2} + b x + a\right ) - {\left (2 \, n - \log \relax (d)\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} \]

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)

________________________________________________________________________________________

maple [A]  time = 0.08, size = 118, normalized size = 1.49 \[ \frac {4 a n \arctan \left (\frac {2 c x +b}{\sqrt {4 a c -b^{2}}}\right )}{\sqrt {4 a c -b^{2}}}-\frac {b^{2} n \arctan \left (\frac {2 c x +b}{\sqrt {4 a c -b^{2}}}\right )}{\sqrt {4 a c -b^{2}}\, c}+\frac {b n \ln \left (c \,x^{2}+b x +a \right )}{2 c}-2 n x +x \ln \left (d \left (c \,x^{2}+b x +a \right )^{n}\right ) \]

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.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: ValueError} \]

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 >> 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 details)Is 4*a*c-b^2 positive or negative?

________________________________________________________________________________________

mupad [B]  time = 0.34, size = 120, normalized size = 1.52 \[ 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} \]

Verification of antiderivative is not currently implemented for this CAS.

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

________________________________________________________________________________________

sympy [A]  time = 69.12, size = 275, normalized size = 3.48 \[ \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 {\relax (d )} & \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 {\relax (d )} & \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 {\relax (d )} & \text {otherwise} \end {cases} \]

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

________________________________________________________________________________________