### 3.145 $$\int \frac{A+C x^2}{(a+b x+c x^2)^2} \, dx$$

Optimal. Leaf size=100 $\frac{4 (a C+A c) \tanh ^{-1}\left (\frac{b+2 c x}{\sqrt{b^2-4 a c}}\right )}{\left (b^2-4 a c\right )^{3/2}}-\frac{x \left (C \left (b^2-2 a c\right )+2 A c^2\right )+b c \left (\frac{a C}{c}+A\right )}{c \left (b^2-4 a c\right ) \left (a+b x+c x^2\right )}$

[Out]

-((b*c*(A + (a*C)/c) + (2*A*c^2 + (b^2 - 2*a*c)*C)*x)/(c*(b^2 - 4*a*c)*(a + b*x + c*x^2))) + (4*(A*c + a*C)*Ar
cTanh[(b + 2*c*x)/Sqrt[b^2 - 4*a*c]])/(b^2 - 4*a*c)^(3/2)

________________________________________________________________________________________

Rubi [A]  time = 0.0682772, antiderivative size = 100, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 4, integrand size = 20, $$\frac{\text{number of rules}}{\text{integrand size}}$$ = 0.2, Rules used = {1660, 12, 618, 206} $\frac{4 (a C+A c) \tanh ^{-1}\left (\frac{b+2 c x}{\sqrt{b^2-4 a c}}\right )}{\left (b^2-4 a c\right )^{3/2}}-\frac{x \left (C \left (b^2-2 a c\right )+2 A c^2\right )+b c \left (\frac{a C}{c}+A\right )}{c \left (b^2-4 a c\right ) \left (a+b x+c x^2\right )}$

Antiderivative was successfully veriﬁed.

[In]

Int[(A + C*x^2)/(a + b*x + c*x^2)^2,x]

[Out]

-((b*c*(A + (a*C)/c) + (2*A*c^2 + (b^2 - 2*a*c)*C)*x)/(c*(b^2 - 4*a*c)*(a + b*x + c*x^2))) + (4*(A*c + a*C)*Ar
cTanh[(b + 2*c*x)/Sqrt[b^2 - 4*a*c]])/(b^2 - 4*a*c)^(3/2)

Rule 1660

Int[(Pq_)*((a_.) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> With[{Q = PolynomialQuotient[Pq, a + b*x + c*
x^2, x], f = Coeff[PolynomialRemainder[Pq, a + b*x + c*x^2, x], x, 0], g = Coeff[PolynomialRemainder[Pq, a + b
*x + c*x^2, x], x, 1]}, Simp[((b*f - 2*a*g + (2*c*f - b*g)*x)*(a + b*x + c*x^2)^(p + 1))/((p + 1)*(b^2 - 4*a*c
)), x] + Dist[1/((p + 1)*(b^2 - 4*a*c)), Int[(a + b*x + c*x^2)^(p + 1)*ExpandToSum[(p + 1)*(b^2 - 4*a*c)*Q - (
2*p + 3)*(2*c*f - b*g), x], x], x]] /; FreeQ[{a, b, c}, x] && PolyQ[Pq, x] && NeQ[b^2 - 4*a*c, 0] && LtQ[p, -1
]

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

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

Rubi steps

\begin{align*} \int \frac{A+C x^2}{\left (a+b x+c x^2\right )^2} \, dx &=-\frac{b c \left (A+\frac{a C}{c}\right )+\left (2 A c^2+\left (b^2-2 a c\right ) C\right ) x}{c \left (b^2-4 a c\right ) \left (a+b x+c x^2\right )}+\frac{\int \frac{2 (A c+a C)}{a+b x+c x^2} \, dx}{-b^2+4 a c}\\ &=-\frac{b c \left (A+\frac{a C}{c}\right )+\left (2 A c^2+\left (b^2-2 a c\right ) C\right ) x}{c \left (b^2-4 a c\right ) \left (a+b x+c x^2\right )}-\frac{(2 (A c+a C)) \int \frac{1}{a+b x+c x^2} \, dx}{b^2-4 a c}\\ &=-\frac{b c \left (A+\frac{a C}{c}\right )+\left (2 A c^2+\left (b^2-2 a c\right ) C\right ) x}{c \left (b^2-4 a c\right ) \left (a+b x+c x^2\right )}+\frac{(4 (A c+a C)) \operatorname{Subst}\left (\int \frac{1}{b^2-4 a c-x^2} \, dx,x,b+2 c x\right )}{b^2-4 a c}\\ &=-\frac{b c \left (A+\frac{a C}{c}\right )+\left (2 A c^2+\left (b^2-2 a c\right ) C\right ) x}{c \left (b^2-4 a c\right ) \left (a+b x+c x^2\right )}+\frac{4 (A c+a C) \tanh ^{-1}\left (\frac{b+2 c x}{\sqrt{b^2-4 a c}}\right )}{\left (b^2-4 a c\right )^{3/2}}\\ \end{align*}

Mathematica [A]  time = 0.0839401, size = 98, normalized size = 0.98 $\frac{a C (b-2 c x)+A c (b+2 c x)+b^2 C x}{c \left (4 a c-b^2\right ) (a+x (b+c x))}+\frac{4 (a C+A c) \tan ^{-1}\left (\frac{b+2 c x}{\sqrt{4 a c-b^2}}\right )}{\left (4 a c-b^2\right )^{3/2}}$

Antiderivative was successfully veriﬁed.

[In]

Integrate[(A + C*x^2)/(a + b*x + c*x^2)^2,x]

[Out]

(b^2*C*x + a*C*(b - 2*c*x) + A*c*(b + 2*c*x))/(c*(-b^2 + 4*a*c)*(a + x*(b + c*x))) + (4*(A*c + a*C)*ArcTan[(b
+ 2*c*x)/Sqrt[-b^2 + 4*a*c]])/(-b^2 + 4*a*c)^(3/2)

________________________________________________________________________________________

Maple [A]  time = 0.19, size = 146, normalized size = 1.5 \begin{align*}{\frac{1}{c{x}^{2}+bx+a} \left ({\frac{ \left ( 2\,A{c}^{2}-2\,Cac+C{b}^{2} \right ) x}{c \left ( 4\,ac-{b}^{2} \right ) }}+{\frac{b \left ( Ac+aC \right ) }{c \left ( 4\,ac-{b}^{2} \right ) }} \right ) }+4\,{\frac{Ac}{ \left ( 4\,ac-{b}^{2} \right ) ^{3/2}}\arctan \left ({\frac{2\,cx+b}{\sqrt{4\,ac-{b}^{2}}}} \right ) }+4\,{\frac{aC}{ \left ( 4\,ac-{b}^{2} \right ) ^{3/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((C*x^2+A)/(c*x^2+b*x+a)^2,x)

[Out]

((2*A*c^2-2*C*a*c+C*b^2)/c/(4*a*c-b^2)*x+b/c*(A*c+C*a)/(4*a*c-b^2))/(c*x^2+b*x+a)+4/(4*a*c-b^2)^(3/2)*arctan((
2*c*x+b)/(4*a*c-b^2)^(1/2))*A*c+4/(4*a*c-b^2)^(3/2)*arctan((2*c*x+b)/(4*a*c-b^2)^(1/2))*a*C

________________________________________________________________________________________

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((C*x^2+A)/(c*x^2+b*x+a)^2,x, algorithm="maxima")

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [B]  time = 1.60237, size = 1085, normalized size = 10.85 \begin{align*} \left [-\frac{C a b^{3} - 4 \, A a b c^{2} + 2 \,{\left (C a^{2} c + A a c^{2} +{\left (C a c^{2} + A c^{3}\right )} x^{2} +{\left (C a b c + A b c^{2}\right )} x\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 ) -{\left (4 \, C a^{2} b - A b^{3}\right )} c +{\left (C b^{4} - 6 \, C a b^{2} c - 8 \, A a c^{3} + 2 \,{\left (4 \, C a^{2} + A b^{2}\right )} c^{2}\right )} x}{a b^{4} c - 8 \, a^{2} b^{2} c^{2} + 16 \, a^{3} c^{3} +{\left (b^{4} c^{2} - 8 \, a b^{2} c^{3} + 16 \, a^{2} c^{4}\right )} x^{2} +{\left (b^{5} c - 8 \, a b^{3} c^{2} + 16 \, a^{2} b c^{3}\right )} x}, -\frac{C a b^{3} - 4 \, A a b c^{2} - 4 \,{\left (C a^{2} c + A a c^{2} +{\left (C a c^{2} + A c^{3}\right )} x^{2} +{\left (C a b c + A b c^{2}\right )} x\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 ) -{\left (4 \, C a^{2} b - A b^{3}\right )} c +{\left (C b^{4} - 6 \, C a b^{2} c - 8 \, A a c^{3} + 2 \,{\left (4 \, C a^{2} + A b^{2}\right )} c^{2}\right )} x}{a b^{4} c - 8 \, a^{2} b^{2} c^{2} + 16 \, a^{3} c^{3} +{\left (b^{4} c^{2} - 8 \, a b^{2} c^{3} + 16 \, a^{2} c^{4}\right )} x^{2} +{\left (b^{5} c - 8 \, a b^{3} c^{2} + 16 \, a^{2} b c^{3}\right )} x}\right ] \end{align*}

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

[In]

integrate((C*x^2+A)/(c*x^2+b*x+a)^2,x, algorithm="fricas")

[Out]

[-(C*a*b^3 - 4*A*a*b*c^2 + 2*(C*a^2*c + A*a*c^2 + (C*a*c^2 + A*c^3)*x^2 + (C*a*b*c + A*b*c^2)*x)*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)) - (4*C*a^2*b -
A*b^3)*c + (C*b^4 - 6*C*a*b^2*c - 8*A*a*c^3 + 2*(4*C*a^2 + A*b^2)*c^2)*x)/(a*b^4*c - 8*a^2*b^2*c^2 + 16*a^3*c
^3 + (b^4*c^2 - 8*a*b^2*c^3 + 16*a^2*c^4)*x^2 + (b^5*c - 8*a*b^3*c^2 + 16*a^2*b*c^3)*x), -(C*a*b^3 - 4*A*a*b*c
^2 - 4*(C*a^2*c + A*a*c^2 + (C*a*c^2 + A*c^3)*x^2 + (C*a*b*c + A*b*c^2)*x)*sqrt(-b^2 + 4*a*c)*arctan(-sqrt(-b^
2 + 4*a*c)*(2*c*x + b)/(b^2 - 4*a*c)) - (4*C*a^2*b - A*b^3)*c + (C*b^4 - 6*C*a*b^2*c - 8*A*a*c^3 + 2*(4*C*a^2
+ A*b^2)*c^2)*x)/(a*b^4*c - 8*a^2*b^2*c^2 + 16*a^3*c^3 + (b^4*c^2 - 8*a*b^2*c^3 + 16*a^2*c^4)*x^2 + (b^5*c - 8
*a*b^3*c^2 + 16*a^2*b*c^3)*x)]

________________________________________________________________________________________

Sympy [B]  time = 1.28657, size = 376, normalized size = 3.76 \begin{align*} - 2 \sqrt{- \frac{1}{\left (4 a c - b^{2}\right )^{3}}} \left (A c + C a\right ) \log{\left (x + \frac{2 A b c + 2 C a b - 32 a^{2} c^{2} \sqrt{- \frac{1}{\left (4 a c - b^{2}\right )^{3}}} \left (A c + C a\right ) + 16 a b^{2} c \sqrt{- \frac{1}{\left (4 a c - b^{2}\right )^{3}}} \left (A c + C a\right ) - 2 b^{4} \sqrt{- \frac{1}{\left (4 a c - b^{2}\right )^{3}}} \left (A c + C a\right )}{4 A c^{2} + 4 C a c} \right )} + 2 \sqrt{- \frac{1}{\left (4 a c - b^{2}\right )^{3}}} \left (A c + C a\right ) \log{\left (x + \frac{2 A b c + 2 C a b + 32 a^{2} c^{2} \sqrt{- \frac{1}{\left (4 a c - b^{2}\right )^{3}}} \left (A c + C a\right ) - 16 a b^{2} c \sqrt{- \frac{1}{\left (4 a c - b^{2}\right )^{3}}} \left (A c + C a\right ) + 2 b^{4} \sqrt{- \frac{1}{\left (4 a c - b^{2}\right )^{3}}} \left (A c + C a\right )}{4 A c^{2} + 4 C a c} \right )} - \frac{- A b c - C a b + x \left (- 2 A c^{2} + 2 C a c - C b^{2}\right )}{4 a^{2} c^{2} - a b^{2} c + x^{2} \left (4 a c^{3} - b^{2} c^{2}\right ) + x \left (4 a b c^{2} - b^{3} c\right )} \end{align*}

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

[In]

integrate((C*x**2+A)/(c*x**2+b*x+a)**2,x)

[Out]

-2*sqrt(-1/(4*a*c - b**2)**3)*(A*c + C*a)*log(x + (2*A*b*c + 2*C*a*b - 32*a**2*c**2*sqrt(-1/(4*a*c - b**2)**3)
*(A*c + C*a) + 16*a*b**2*c*sqrt(-1/(4*a*c - b**2)**3)*(A*c + C*a) - 2*b**4*sqrt(-1/(4*a*c - b**2)**3)*(A*c + C
*a))/(4*A*c**2 + 4*C*a*c)) + 2*sqrt(-1/(4*a*c - b**2)**3)*(A*c + C*a)*log(x + (2*A*b*c + 2*C*a*b + 32*a**2*c**
2*sqrt(-1/(4*a*c - b**2)**3)*(A*c + C*a) - 16*a*b**2*c*sqrt(-1/(4*a*c - b**2)**3)*(A*c + C*a) + 2*b**4*sqrt(-1
/(4*a*c - b**2)**3)*(A*c + C*a))/(4*A*c**2 + 4*C*a*c)) - (-A*b*c - C*a*b + x*(-2*A*c**2 + 2*C*a*c - C*b**2))/(
4*a**2*c**2 - a*b**2*c + x**2*(4*a*c**3 - b**2*c**2) + x*(4*a*b*c**2 - b**3*c))

________________________________________________________________________________________

Giac [A]  time = 1.24393, size = 146, normalized size = 1.46 \begin{align*} -\frac{4 \,{\left (C a + A c\right )} \arctan \left (\frac{2 \, c x + b}{\sqrt{-b^{2} + 4 \, a c}}\right )}{{\left (b^{2} - 4 \, a c\right )} \sqrt{-b^{2} + 4 \, a c}} - \frac{C b^{2} x - 2 \, C a c x + 2 \, A c^{2} x + C a b + A b c}{{\left (b^{2} c - 4 \, a c^{2}\right )}{\left (c x^{2} + b x + a\right )}} \end{align*}

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

[In]

integrate((C*x^2+A)/(c*x^2+b*x+a)^2,x, algorithm="giac")

[Out]

-4*(C*a + A*c)*arctan((2*c*x + b)/sqrt(-b^2 + 4*a*c))/((b^2 - 4*a*c)*sqrt(-b^2 + 4*a*c)) - (C*b^2*x - 2*C*a*c*
x + 2*A*c^2*x + C*a*b + A*b*c)/((b^2*c - 4*a*c^2)*(c*x^2 + b*x + a))