3.227 \(\int \frac{A+B x+C x^2+D x^3}{a+b x+c x^2+b x^3+a x^4} \, dx\)

Optimal. Leaf size=605 \[ \frac{\tan ^{-1}\left (\frac{-\sqrt{8 a^2-4 a c+b^2}+4 a x+b}{\sqrt{2} \sqrt{-b \left (b-\sqrt{8 a^2-4 a c+b^2}\right )+4 a^2+2 a c}}\right ) \left (-a \left (A \left (b-\sqrt{8 a^2-4 a c+b^2}\right )-C \sqrt{8 a^2-4 a c+b^2}+b C+2 c D\right )+b D \left (b-\sqrt{8 a^2-4 a c+b^2}\right )+4 a^2 B\right )}{\sqrt{2} a \sqrt{8 a^2-4 a c+b^2} \sqrt{-b \left (b-\sqrt{8 a^2-4 a c+b^2}\right )+4 a^2+2 a c}}-\frac{\tan ^{-1}\left (\frac{\sqrt{8 a^2-4 a c+b^2}+4 a x+b}{\sqrt{2} \sqrt{-b \left (\sqrt{8 a^2-4 a c+b^2}+b\right )+4 a^2+2 a c}}\right ) \left (-a \left (A \left (\sqrt{8 a^2-4 a c+b^2}+b\right )+C \sqrt{8 a^2-4 a c+b^2}+b C+2 c D\right )+b D \left (\sqrt{8 a^2-4 a c+b^2}+b\right )+4 a^2 B\right )}{\sqrt{2} a \sqrt{8 a^2-4 a c+b^2} \sqrt{-b \left (\sqrt{8 a^2-4 a c+b^2}+b\right )+4 a^2+2 a c}}-\frac{\log \left (x \left (b-\sqrt{8 a^2-4 a c+b^2}\right )+2 a x^2+2 a\right ) \left (D \left (b-\sqrt{8 a^2-4 a c+b^2}\right )+2 a (A-C)\right )}{4 a \sqrt{8 a^2-4 a c+b^2}}+\frac{\log \left (x \left (\sqrt{8 a^2-4 a c+b^2}+b\right )+2 a x^2+2 a\right ) \left (D \left (\sqrt{8 a^2-4 a c+b^2}+b\right )+2 a (A-C)\right )}{4 a \sqrt{8 a^2-4 a c+b^2}} \]

[Out]

((4*a^2*B + b*(b - Sqrt[8*a^2 + b^2 - 4*a*c])*D - a*(A*(b - Sqrt[8*a^2 + b^2 - 4
*a*c]) + b*C - Sqrt[8*a^2 + b^2 - 4*a*c]*C + 2*c*D))*ArcTan[(b - Sqrt[8*a^2 + b^
2 - 4*a*c] + 4*a*x)/(Sqrt[2]*Sqrt[4*a^2 + 2*a*c - b*(b - Sqrt[8*a^2 + b^2 - 4*a*
c])])])/(Sqrt[2]*a*Sqrt[8*a^2 + b^2 - 4*a*c]*Sqrt[4*a^2 + 2*a*c - b*(b - Sqrt[8*
a^2 + b^2 - 4*a*c])]) - ((4*a^2*B + b*(b + Sqrt[8*a^2 + b^2 - 4*a*c])*D - a*(A*(
b + Sqrt[8*a^2 + b^2 - 4*a*c]) + b*C + Sqrt[8*a^2 + b^2 - 4*a*c]*C + 2*c*D))*Arc
Tan[(b + Sqrt[8*a^2 + b^2 - 4*a*c] + 4*a*x)/(Sqrt[2]*Sqrt[4*a^2 + 2*a*c - b*(b +
 Sqrt[8*a^2 + b^2 - 4*a*c])])])/(Sqrt[2]*a*Sqrt[8*a^2 + b^2 - 4*a*c]*Sqrt[4*a^2
+ 2*a*c - b*(b + Sqrt[8*a^2 + b^2 - 4*a*c])]) - ((2*a*(A - C) + (b - Sqrt[8*a^2
+ b^2 - 4*a*c])*D)*Log[2*a + (b - Sqrt[8*a^2 + b^2 - 4*a*c])*x + 2*a*x^2])/(4*a*
Sqrt[8*a^2 + b^2 - 4*a*c]) + ((2*a*(A - C) + (b + Sqrt[8*a^2 + b^2 - 4*a*c])*D)*
Log[2*a + (b + Sqrt[8*a^2 + b^2 - 4*a*c])*x + 2*a*x^2])/(4*a*Sqrt[8*a^2 + b^2 -
4*a*c])

_______________________________________________________________________________________

Rubi [A]  time = 10.6993, antiderivative size = 605, normalized size of antiderivative = 1., number of steps used = 9, number of rules used = 5, integrand size = 38, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.132 \[ \frac{\tan ^{-1}\left (\frac{-\sqrt{8 a^2-4 a c+b^2}+4 a x+b}{\sqrt{2} \sqrt{-b \left (b-\sqrt{8 a^2-4 a c+b^2}\right )+4 a^2+2 a c}}\right ) \left (-a \left (A \left (b-\sqrt{8 a^2-4 a c+b^2}\right )-C \sqrt{8 a^2-4 a c+b^2}+b C+2 c D\right )+b D \left (b-\sqrt{8 a^2-4 a c+b^2}\right )+4 a^2 B\right )}{\sqrt{2} a \sqrt{8 a^2-4 a c+b^2} \sqrt{-b \left (b-\sqrt{8 a^2-4 a c+b^2}\right )+4 a^2+2 a c}}-\frac{\tan ^{-1}\left (\frac{\sqrt{8 a^2-4 a c+b^2}+4 a x+b}{\sqrt{2} \sqrt{-b \left (\sqrt{8 a^2-4 a c+b^2}+b\right )+4 a^2+2 a c}}\right ) \left (-a \left (A \left (\sqrt{8 a^2-4 a c+b^2}+b\right )+C \sqrt{8 a^2-4 a c+b^2}+b C+2 c D\right )+b D \left (\sqrt{8 a^2-4 a c+b^2}+b\right )+4 a^2 B\right )}{\sqrt{2} a \sqrt{8 a^2-4 a c+b^2} \sqrt{-b \left (\sqrt{8 a^2-4 a c+b^2}+b\right )+4 a^2+2 a c}}-\frac{\log \left (x \left (b-\sqrt{8 a^2-4 a c+b^2}\right )+2 a x^2+2 a\right ) \left (D \left (b-\sqrt{8 a^2-4 a c+b^2}\right )+2 a (A-C)\right )}{4 a \sqrt{8 a^2-4 a c+b^2}}+\frac{\log \left (x \left (\sqrt{8 a^2-4 a c+b^2}+b\right )+2 a x^2+2 a\right ) \left (D \left (\sqrt{8 a^2-4 a c+b^2}+b\right )+2 a (A-C)\right )}{4 a \sqrt{8 a^2-4 a c+b^2}} \]

Antiderivative was successfully verified.

[In]  Int[(A + B*x + C*x^2 + D*x^3)/(a + b*x + c*x^2 + b*x^3 + a*x^4),x]

[Out]

((4*a^2*B + b*(b - Sqrt[8*a^2 + b^2 - 4*a*c])*D - a*(A*(b - Sqrt[8*a^2 + b^2 - 4
*a*c]) + b*C - Sqrt[8*a^2 + b^2 - 4*a*c]*C + 2*c*D))*ArcTan[(b - Sqrt[8*a^2 + b^
2 - 4*a*c] + 4*a*x)/(Sqrt[2]*Sqrt[4*a^2 + 2*a*c - b*(b - Sqrt[8*a^2 + b^2 - 4*a*
c])])])/(Sqrt[2]*a*Sqrt[8*a^2 + b^2 - 4*a*c]*Sqrt[4*a^2 + 2*a*c - b*(b - Sqrt[8*
a^2 + b^2 - 4*a*c])]) - ((4*a^2*B + b*(b + Sqrt[8*a^2 + b^2 - 4*a*c])*D - a*(A*(
b + Sqrt[8*a^2 + b^2 - 4*a*c]) + b*C + Sqrt[8*a^2 + b^2 - 4*a*c]*C + 2*c*D))*Arc
Tan[(b + Sqrt[8*a^2 + b^2 - 4*a*c] + 4*a*x)/(Sqrt[2]*Sqrt[4*a^2 + 2*a*c - b*(b +
 Sqrt[8*a^2 + b^2 - 4*a*c])])])/(Sqrt[2]*a*Sqrt[8*a^2 + b^2 - 4*a*c]*Sqrt[4*a^2
+ 2*a*c - b*(b + Sqrt[8*a^2 + b^2 - 4*a*c])]) - ((2*a*(A - C) + (b - Sqrt[8*a^2
+ b^2 - 4*a*c])*D)*Log[2*a + (b - Sqrt[8*a^2 + b^2 - 4*a*c])*x + 2*a*x^2])/(4*a*
Sqrt[8*a^2 + b^2 - 4*a*c]) + ((2*a*(A - C) + (b + Sqrt[8*a^2 + b^2 - 4*a*c])*D)*
Log[2*a + (b + Sqrt[8*a^2 + b^2 - 4*a*c])*x + 2*a*x^2])/(4*a*Sqrt[8*a^2 + b^2 -
4*a*c])

_______________________________________________________________________________________

Rubi in Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \[ \text{Timed out} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  rubi_integrate((D*x**3+C*x**2+B*x+A)/(a*x**4+b*x**3+c*x**2+b*x+a),x)

[Out]

Timed out

_______________________________________________________________________________________

Mathematica [C]  time = 0.117919, size = 98, normalized size = 0.16 \[ \text{RootSum}\left [\text{$\#$1}^4 a+\text{$\#$1}^3 b+\text{$\#$1}^2 c+\text{$\#$1} b+a\&,\frac{\text{$\#$1}^3 D \log (x-\text{$\#$1})+\text{$\#$1}^2 C \log (x-\text{$\#$1})+A \log (x-\text{$\#$1})+\text{$\#$1} B \log (x-\text{$\#$1})}{4 \text{$\#$1}^3 a+3 \text{$\#$1}^2 b+2 \text{$\#$1} c+b}\&\right ] \]

Antiderivative was successfully verified.

[In]  Integrate[(A + B*x + C*x^2 + D*x^3)/(a + b*x + c*x^2 + b*x^3 + a*x^4),x]

[Out]

RootSum[a + b*#1 + c*#1^2 + b*#1^3 + a*#1^4 & , (A*Log[x - #1] + B*Log[x - #1]*#
1 + C*Log[x - #1]*#1^2 + D*Log[x - #1]*#1^3)/(b + 2*c*#1 + 3*b*#1^2 + 4*a*#1^3)
& ]

_______________________________________________________________________________________

Maple [B]  time = 0.071, size = 2105, normalized size = 3.5 \[ \text{result too large to display} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  int((D*x^3+C*x^2+B*x+A)/(a*x^4+b*x^3+c*x^2+b*x+a),x)

[Out]

1/2/(8*a^2-4*a*c+b^2)^(1/2)*ln(2*a*x^2+(8*a^2-4*a*c+b^2)^(1/2)*x+b*x+2*a)*A-1/2/
(8*a^2-4*a*c+b^2)^(1/2)*ln(2*a*x^2+(8*a^2-4*a*c+b^2)^(1/2)*x+b*x+2*a)*C+1/4/a*ln
(2*a*x^2+(8*a^2-4*a*c+b^2)^(1/2)*x+b*x+2*a)*D+1/4/a/(8*a^2-4*a*c+b^2)^(1/2)*ln(2
*a*x^2+(8*a^2-4*a*c+b^2)^(1/2)*x+b*x+2*a)*D*b+1/(8*a^2+4*a*c-2*b^2-2*b*(8*a^2-4*
a*c+b^2)^(1/2))^(1/2)*arctan((b+4*a*x+(8*a^2-4*a*c+b^2)^(1/2))/(8*a^2+4*a*c-2*b^
2-2*b*(8*a^2-4*a*c+b^2)^(1/2))^(1/2))*A+1/(8*a^2-4*a*c+b^2)^(1/2)/(8*a^2+4*a*c-2
*b^2-2*b*(8*a^2-4*a*c+b^2)^(1/2))^(1/2)*arctan((b+4*a*x+(8*a^2-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/(8*a^2+4*a*c-2*b^2+2*b*(8*a^2-4*a*c+b^2)^(1/2))^(1/2)*arctan((-4*a*x+(8*a^2-
4*a*c+b^2)^(1/2)-b)/(8*a^2+4*a*c-2*b^2+2*b*(8*a^2-4*a*c+b^2)^(1/2))^(1/2))*D*c-1
/a/(8*a^2-4*a*c+b^2)^(1/2)/(8*a^2+4*a*c-2*b^2+2*b*(8*a^2-4*a*c+b^2)^(1/2))^(1/2)
*arctan((-4*a*x+(8*a^2-4*a*c+b^2)^(1/2)-b)/(8*a^2+4*a*c-2*b^2+2*b*(8*a^2-4*a*c+b
^2)^(1/2))^(1/2))*D*b^2+1/a/(8*a^2+4*a*c-2*b^2+2*b*(8*a^2-4*a*c+b^2)^(1/2))^(1/2
)*arctan((-4*a*x+(8*a^2-4*a*c+b^2)^(1/2)-b)/(8*a^2+4*a*c-2*b^2+2*b*(8*a^2-4*a*c+
b^2)^(1/2))^(1/2))*D*b-4*a/(8*a^2-4*a*c+b^2)^(1/2)/(8*a^2+4*a*c-2*b^2+2*b*(8*a^2
-4*a*c+b^2)^(1/2))^(1/2)*arctan((-4*a*x+(8*a^2-4*a*c+b^2)^(1/2)-b)/(8*a^2+4*a*c-
2*b^2+2*b*(8*a^2-4*a*c+b^2)^(1/2))^(1/2))*B

_______________________________________________________________________________________

Maxima [F]  time = 0., size = 0, normalized size = 0. \[ \int \frac{D x^{3} + C x^{2} + B x + A}{a x^{4} + b x^{3} + c x^{2} + b x + a}\,{d x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((D*x^3 + C*x^2 + B*x + A)/(a*x^4 + b*x^3 + c*x^2 + b*x + a),x, algorithm="maxima")

[Out]

integrate((D*x^3 + C*x^2 + B*x + A)/(a*x^4 + b*x^3 + c*x^2 + b*x + a), x)

_______________________________________________________________________________________

Fricas [F(-1)]  time = 0., size = 0, normalized size = 0. \[ \text{Timed out} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((D*x^3 + C*x^2 + B*x + A)/(a*x^4 + b*x^3 + c*x^2 + b*x + a),x, algorithm="fricas")

[Out]

Timed out

_______________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \[ \text{Timed out} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((D*x**3+C*x**2+B*x+A)/(a*x**4+b*x**3+c*x**2+b*x+a),x)

[Out]

Timed out

_______________________________________________________________________________________

GIAC/XCAS [F]  time = 0., size = 0, normalized size = 0. \[ \int \frac{D x^{3} + C x^{2} + B x + A}{a x^{4} + b x^{3} + c x^{2} + b x + a}\,{d x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]  integrate((D*x^3 + C*x^2 + B*x + A)/(a*x^4 + b*x^3 + c*x^2 + b*x + a),x, algorithm="giac")

[Out]

integrate((D*x^3 + C*x^2 + B*x + A)/(a*x^4 + b*x^3 + c*x^2 + b*x + a), x)