3.2183 $$\int \frac{(d+e x)^3}{a+b x+c x^2} \, dx$$

Optimal. Leaf size=151 $\frac{e \left (-c e (a e+3 b d)+b^2 e^2+3 c^2 d^2\right ) \log \left (a+b x+c x^2\right )}{2 c^3}-\frac{(2 c d-b e) \left (-c e (3 a e+b d)+b^2 e^2+c^2 d^2\right ) \tanh ^{-1}\left (\frac{b+2 c x}{\sqrt{b^2-4 a c}}\right )}{c^3 \sqrt{b^2-4 a c}}+\frac{e^2 x (3 c d-b e)}{c^2}+\frac{e^3 x^2}{2 c}$

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.171566, antiderivative size = 151, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 5, integrand size = 20, $$\frac{\text{number of rules}}{\text{integrand size}}$$ = 0.25, Rules used = {701, 634, 618, 206, 628} $\frac{e \left (-c e (a e+3 b d)+b^2 e^2+3 c^2 d^2\right ) \log \left (a+b x+c x^2\right )}{2 c^3}-\frac{(2 c d-b e) \left (-c e (3 a e+b d)+b^2 e^2+c^2 d^2\right ) \tanh ^{-1}\left (\frac{b+2 c x}{\sqrt{b^2-4 a c}}\right )}{c^3 \sqrt{b^2-4 a c}}+\frac{e^2 x (3 c d-b e)}{c^2}+\frac{e^3 x^2}{2 c}$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

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

Rule 701

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

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 \frac{(d+e x)^3}{a+b x+c x^2} \, dx &=\int \left (\frac{e^2 (3 c d-b e)}{c^2}+\frac{e^3 x}{c}+\frac{c^2 d^3-3 a c d e^2+a b e^3+e \left (3 c^2 d^2+b^2 e^2-c e (3 b d+a e)\right ) x}{c^2 \left (a+b x+c x^2\right )}\right ) \, dx\\ &=\frac{e^2 (3 c d-b e) x}{c^2}+\frac{e^3 x^2}{2 c}+\frac{\int \frac{c^2 d^3-3 a c d e^2+a b e^3+e \left (3 c^2 d^2+b^2 e^2-c e (3 b d+a e)\right ) x}{a+b x+c x^2} \, dx}{c^2}\\ &=\frac{e^2 (3 c d-b e) x}{c^2}+\frac{e^3 x^2}{2 c}+\frac{\left (e \left (3 c^2 d^2+b^2 e^2-c e (3 b d+a e)\right )\right ) \int \frac{b+2 c x}{a+b x+c x^2} \, dx}{2 c^3}+\frac{\left ((2 c d-b e) \left (c^2 d^2+b^2 e^2-c e (b d+3 a e)\right )\right ) \int \frac{1}{a+b x+c x^2} \, dx}{2 c^3}\\ &=\frac{e^2 (3 c d-b e) x}{c^2}+\frac{e^3 x^2}{2 c}+\frac{e \left (3 c^2 d^2+b^2 e^2-c e (3 b d+a e)\right ) \log \left (a+b x+c x^2\right )}{2 c^3}-\frac{\left ((2 c d-b e) \left (c^2 d^2+b^2 e^2-c e (b d+3 a e)\right )\right ) \operatorname{Subst}\left (\int \frac{1}{b^2-4 a c-x^2} \, dx,x,b+2 c x\right )}{c^3}\\ &=\frac{e^2 (3 c d-b e) x}{c^2}+\frac{e^3 x^2}{2 c}-\frac{(2 c d-b e) \left (c^2 d^2+b^2 e^2-c e (b d+3 a e)\right ) \tanh ^{-1}\left (\frac{b+2 c x}{\sqrt{b^2-4 a c}}\right )}{c^3 \sqrt{b^2-4 a c}}+\frac{e \left (3 c^2 d^2+b^2 e^2-c e (3 b d+a e)\right ) \log \left (a+b x+c x^2\right )}{2 c^3}\\ \end{align*}

Mathematica [A]  time = 0.130507, size = 148, normalized size = 0.98 $\frac{e \left (-c e (a e+3 b d)+b^2 e^2+3 c^2 d^2\right ) \log (a+x (b+c x))+\frac{2 (2 c d-b e) \left (-c e (3 a e+b d)+b^2 e^2+c^2 d^2\right ) \tan ^{-1}\left (\frac{b+2 c x}{\sqrt{4 a c-b^2}}\right )}{\sqrt{4 a c-b^2}}+2 c e^2 x (3 c d-b e)+c^2 e^3 x^2}{2 c^3}$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [B]  time = 0.153, size = 366, normalized size = 2.4 \begin{align*}{\frac{{e}^{3}{x}^{2}}{2\,c}}-{\frac{{e}^{3}xb}{{c}^{2}}}+3\,{\frac{d{e}^{2}x}{c}}-{\frac{\ln \left ( c{x}^{2}+bx+a \right ) a{e}^{3}}{2\,{c}^{2}}}+{\frac{\ln \left ( c{x}^{2}+bx+a \right ){b}^{2}{e}^{3}}{2\,{c}^{3}}}-{\frac{3\,d\ln \left ( c{x}^{2}+bx+a \right ){e}^{2}b}{2\,{c}^{2}}}+{\frac{3\,\ln \left ( c{x}^{2}+bx+a \right ){d}^{2}e}{2\,c}}+3\,{\frac{ab{e}^{3}}{{c}^{2}\sqrt{4\,ac-{b}^{2}}}\arctan \left ({\frac{2\,cx+b}{\sqrt{4\,ac-{b}^{2}}}} \right ) }-6\,{\frac{ad{e}^{2}}{c\sqrt{4\,ac-{b}^{2}}}\arctan \left ({\frac{2\,cx+b}{\sqrt{4\,ac-{b}^{2}}}} \right ) }+2\,{\frac{{d}^{3}}{\sqrt{4\,ac-{b}^{2}}}\arctan \left ({\frac{2\,cx+b}{\sqrt{4\,ac-{b}^{2}}}} \right ) }-{\frac{{b}^{3}{e}^{3}}{{c}^{3}}\arctan \left ({(2\,cx+b){\frac{1}{\sqrt{4\,ac-{b}^{2}}}}} \right ){\frac{1}{\sqrt{4\,ac-{b}^{2}}}}}+3\,{\frac{{b}^{2}d{e}^{2}}{{c}^{2}\sqrt{4\,ac-{b}^{2}}}\arctan \left ({\frac{2\,cx+b}{\sqrt{4\,ac-{b}^{2}}}} \right ) }-3\,{\frac{b{d}^{2}e}{c\sqrt{4\,ac-{b}^{2}}}\arctan \left ({\frac{2\,cx+b}{\sqrt{4\,ac-{b}^{2}}}} \right ) } \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

int((e*x+d)^3/(c*x^2+b*x+a),x)

[Out]

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

________________________________________________________________________________________

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

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [A]  time = 1.91266, size = 1107, normalized size = 7.33 \begin{align*} \left [\frac{{\left (b^{2} c^{2} - 4 \, a c^{3}\right )} e^{3} x^{2} +{\left (2 \, c^{3} d^{3} - 3 \, b c^{2} d^{2} e + 3 \,{\left (b^{2} c - 2 \, a c^{2}\right )} d e^{2} -{\left (b^{3} - 3 \, a b c\right )} e^{3}\right )} \sqrt{b^{2} - 4 \, a c} \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 ) + 2 \,{\left (3 \,{\left (b^{2} c^{2} - 4 \, a c^{3}\right )} d e^{2} -{\left (b^{3} c - 4 \, a b c^{2}\right )} e^{3}\right )} x +{\left (3 \,{\left (b^{2} c^{2} - 4 \, a c^{3}\right )} d^{2} e - 3 \,{\left (b^{3} c - 4 \, a b c^{2}\right )} d e^{2} +{\left (b^{4} - 5 \, a b^{2} c + 4 \, a^{2} c^{2}\right )} e^{3}\right )} \log \left (c x^{2} + b x + a\right )}{2 \,{\left (b^{2} c^{3} - 4 \, a c^{4}\right )}}, \frac{{\left (b^{2} c^{2} - 4 \, a c^{3}\right )} e^{3} x^{2} - 2 \,{\left (2 \, c^{3} d^{3} - 3 \, b c^{2} d^{2} e + 3 \,{\left (b^{2} c - 2 \, a c^{2}\right )} d e^{2} -{\left (b^{3} - 3 \, a b c\right )} e^{3}\right )} \sqrt{-b^{2} + 4 \, a c} \arctan \left (-\frac{\sqrt{-b^{2} + 4 \, a c}{\left (2 \, c x + b\right )}}{b^{2} - 4 \, a c}\right ) + 2 \,{\left (3 \,{\left (b^{2} c^{2} - 4 \, a c^{3}\right )} d e^{2} -{\left (b^{3} c - 4 \, a b c^{2}\right )} e^{3}\right )} x +{\left (3 \,{\left (b^{2} c^{2} - 4 \, a c^{3}\right )} d^{2} e - 3 \,{\left (b^{3} c - 4 \, a b c^{2}\right )} d e^{2} +{\left (b^{4} - 5 \, a b^{2} c + 4 \, a^{2} c^{2}\right )} e^{3}\right )} \log \left (c x^{2} + b x + a\right )}{2 \,{\left (b^{2} c^{3} - 4 \, a c^{4}\right )}}\right ] \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Sympy [B]  time = 3.44919, size = 892, normalized size = 5.91 \begin{align*} \text{result too large to display} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

integrate((e*x+d)**3/(c*x**2+b*x+a),x)

[Out]

(-e*(a*c*e**2 - b**2*e**2 + 3*b*c*d*e - 3*c**2*d**2)/(2*c**3) - sqrt(-4*a*c + b**2)*(b*e - 2*c*d)*(3*a*c*e**2
- b**2*e**2 + b*c*d*e - c**2*d**2)/(2*c**3*(4*a*c - b**2)))*log(x + (2*a**2*c*e**3 - a*b**2*e**3 + 3*a*b*c*d*e
**2 + 4*a*c**3*(-e*(a*c*e**2 - b**2*e**2 + 3*b*c*d*e - 3*c**2*d**2)/(2*c**3) - sqrt(-4*a*c + b**2)*(b*e - 2*c*
d)*(3*a*c*e**2 - b**2*e**2 + b*c*d*e - c**2*d**2)/(2*c**3*(4*a*c - b**2))) - 6*a*c**2*d**2*e - b**2*c**2*(-e*(
a*c*e**2 - b**2*e**2 + 3*b*c*d*e - 3*c**2*d**2)/(2*c**3) - sqrt(-4*a*c + b**2)*(b*e - 2*c*d)*(3*a*c*e**2 - b**
2*e**2 + b*c*d*e - c**2*d**2)/(2*c**3*(4*a*c - b**2))) + b*c**2*d**3)/(3*a*b*c*e**3 - 6*a*c**2*d*e**2 - b**3*e
**3 + 3*b**2*c*d*e**2 - 3*b*c**2*d**2*e + 2*c**3*d**3)) + (-e*(a*c*e**2 - b**2*e**2 + 3*b*c*d*e - 3*c**2*d**2)
/(2*c**3) + sqrt(-4*a*c + b**2)*(b*e - 2*c*d)*(3*a*c*e**2 - b**2*e**2 + b*c*d*e - c**2*d**2)/(2*c**3*(4*a*c -
b**2)))*log(x + (2*a**2*c*e**3 - a*b**2*e**3 + 3*a*b*c*d*e**2 + 4*a*c**3*(-e*(a*c*e**2 - b**2*e**2 + 3*b*c*d*e
- 3*c**2*d**2)/(2*c**3) + sqrt(-4*a*c + b**2)*(b*e - 2*c*d)*(3*a*c*e**2 - b**2*e**2 + b*c*d*e - c**2*d**2)/(2
*c**3*(4*a*c - b**2))) - 6*a*c**2*d**2*e - b**2*c**2*(-e*(a*c*e**2 - b**2*e**2 + 3*b*c*d*e - 3*c**2*d**2)/(2*c
**3) + sqrt(-4*a*c + b**2)*(b*e - 2*c*d)*(3*a*c*e**2 - b**2*e**2 + b*c*d*e - c**2*d**2)/(2*c**3*(4*a*c - b**2)
)) + b*c**2*d**3)/(3*a*b*c*e**3 - 6*a*c**2*d*e**2 - b**3*e**3 + 3*b**2*c*d*e**2 - 3*b*c**2*d**2*e + 2*c**3*d**
3)) + e**3*x**2/(2*c) - x*(b*e**3 - 3*c*d*e**2)/c**2

________________________________________________________________________________________

Giac [A]  time = 1.13914, size = 217, normalized size = 1.44 \begin{align*} \frac{c x^{2} e^{3} + 6 \, c d x e^{2} - 2 \, b x e^{3}}{2 \, c^{2}} + \frac{{\left (3 \, c^{2} d^{2} e - 3 \, b c d e^{2} + b^{2} e^{3} - a c e^{3}\right )} \log \left (c x^{2} + b x + a\right )}{2 \, c^{3}} + \frac{{\left (2 \, c^{3} d^{3} - 3 \, b c^{2} d^{2} e + 3 \, b^{2} c d e^{2} - 6 \, a c^{2} d e^{2} - b^{3} e^{3} + 3 \, a b c e^{3}\right )} \arctan \left (\frac{2 \, c x + b}{\sqrt{-b^{2} + 4 \, a c}}\right )}{\sqrt{-b^{2} + 4 \, a c} c^{3}} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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