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

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

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.100283, antiderivative size = 81, 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 = {1657, 634, 618, 206, 628} $-\frac{\left (C \left (b^2-2 a c\right )+2 A c^2\right ) \tanh ^{-1}\left (\frac{b+2 c x}{\sqrt{b^2-4 a c}}\right )}{c^2 \sqrt{b^2-4 a c}}-\frac{b C \log \left (a+b x+c x^2\right )}{2 c^2}+\frac{C x}{c}$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

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

Rule 1657

Int[(Pq_)*((a_) + (b_.)*(x_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIntegrand[Pq*(a + b*x + c*x^2)^p, x
], x] /; FreeQ[{a, b, c}, x] && PolyQ[Pq, x] && IGtQ[p, -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{A+C x^2}{a+b x+c x^2} \, dx &=\int \left (\frac{C}{c}+\frac{A c-a C-b C x}{c \left (a+b x+c x^2\right )}\right ) \, dx\\ &=\frac{C x}{c}+\frac{\int \frac{A c-a C-b C x}{a+b x+c x^2} \, dx}{c}\\ &=\frac{C x}{c}-\frac{(b C) \int \frac{b+2 c x}{a+b x+c x^2} \, dx}{2 c^2}+\frac{1}{2} \left (2 A+\frac{\left (b^2-2 a c\right ) C}{c^2}\right ) \int \frac{1}{a+b x+c x^2} \, dx\\ &=\frac{C x}{c}-\frac{b C \log \left (a+b x+c x^2\right )}{2 c^2}+\left (-2 A-\frac{\left (b^2-2 a c\right ) C}{c^2}\right ) \operatorname{Subst}\left (\int \frac{1}{b^2-4 a c-x^2} \, dx,x,b+2 c x\right )\\ &=\frac{C x}{c}-\frac{\left (2 A+\frac{\left (b^2-2 a c\right ) C}{c^2}\right ) \tanh ^{-1}\left (\frac{b+2 c x}{\sqrt{b^2-4 a c}}\right )}{\sqrt{b^2-4 a c}}-\frac{b C \log \left (a+b x+c x^2\right )}{2 c^2}\\ \end{align*}

Mathematica [A]  time = 0.092001, size = 84, normalized size = 1.04 $\frac{\left (-2 a c C+2 A c^2+b^2 C\right ) \tan ^{-1}\left (\frac{b+2 c x}{\sqrt{4 a c-b^2}}\right )}{c^2 \sqrt{4 a c-b^2}}-\frac{b C \log \left (a+b x+c x^2\right )}{2 c^2}+\frac{C x}{c}$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [A]  time = 0.184, size = 140, normalized size = 1.7 \begin{align*}{\frac{Cx}{c}}-{\frac{Cb\ln \left ( c{x}^{2}+bx+a \right ) }{2\,{c}^{2}}}+2\,{\frac{A}{\sqrt{4\,ac-{b}^{2}}}\arctan \left ({\frac{2\,cx+b}{\sqrt{4\,ac-{b}^{2}}}} \right ) }-2\,{\frac{aC}{c\sqrt{4\,ac-{b}^{2}}}\arctan \left ({\frac{2\,cx+b}{\sqrt{4\,ac-{b}^{2}}}} \right ) }+{\frac{C{b}^{2}}{{c}^{2}}\arctan \left ({(2\,cx+b){\frac{1}{\sqrt{4\,ac-{b}^{2}}}}} \right ){\frac{1}{\sqrt{4\,ac-{b}^{2}}}}} \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),x)

[Out]

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

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

[In]

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

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [A]  time = 1.57218, size = 595, normalized size = 7.35 \begin{align*} \left [\frac{{\left (C b^{2} - 2 \, C a c + 2 \, A c^{2}\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 (C b^{2} c - 4 \, C a c^{2}\right )} x -{\left (C b^{3} - 4 \, C a b c\right )} \log \left (c x^{2} + b x + a\right )}{2 \,{\left (b^{2} c^{2} - 4 \, a c^{3}\right )}}, -\frac{2 \,{\left (C b^{2} - 2 \, C a c + 2 \, A c^{2}\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 (C b^{2} c - 4 \, C a c^{2}\right )} x +{\left (C b^{3} - 4 \, C a b c\right )} \log \left (c x^{2} + b x + a\right )}{2 \,{\left (b^{2} c^{2} - 4 \, a c^{3}\right )}}\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),x, algorithm="fricas")

[Out]

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

________________________________________________________________________________________

Sympy [B]  time = 1.22134, size = 413, normalized size = 5.1 \begin{align*} \frac{C x}{c} + \left (- \frac{C b}{2 c^{2}} - \frac{\sqrt{- 4 a c + b^{2}} \left (- 2 A c^{2} + 2 C a c - C b^{2}\right )}{2 c^{2} \left (4 a c - b^{2}\right )}\right ) \log{\left (x + \frac{- A b c - C a b - 4 a c^{2} \left (- \frac{C b}{2 c^{2}} - \frac{\sqrt{- 4 a c + b^{2}} \left (- 2 A c^{2} + 2 C a c - C b^{2}\right )}{2 c^{2} \left (4 a c - b^{2}\right )}\right ) + b^{2} c \left (- \frac{C b}{2 c^{2}} - \frac{\sqrt{- 4 a c + b^{2}} \left (- 2 A c^{2} + 2 C a c - C b^{2}\right )}{2 c^{2} \left (4 a c - b^{2}\right )}\right )}{- 2 A c^{2} + 2 C a c - C b^{2}} \right )} + \left (- \frac{C b}{2 c^{2}} + \frac{\sqrt{- 4 a c + b^{2}} \left (- 2 A c^{2} + 2 C a c - C b^{2}\right )}{2 c^{2} \left (4 a c - b^{2}\right )}\right ) \log{\left (x + \frac{- A b c - C a b - 4 a c^{2} \left (- \frac{C b}{2 c^{2}} + \frac{\sqrt{- 4 a c + b^{2}} \left (- 2 A c^{2} + 2 C a c - C b^{2}\right )}{2 c^{2} \left (4 a c - b^{2}\right )}\right ) + b^{2} c \left (- \frac{C b}{2 c^{2}} + \frac{\sqrt{- 4 a c + b^{2}} \left (- 2 A c^{2} + 2 C a c - C b^{2}\right )}{2 c^{2} \left (4 a c - b^{2}\right )}\right )}{- 2 A c^{2} + 2 C a c - C b^{2}} \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),x)

[Out]

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

________________________________________________________________________________________

Giac [A]  time = 1.31595, size = 105, normalized size = 1.3 \begin{align*} \frac{C x}{c} - \frac{C b \log \left (c x^{2} + b x + a\right )}{2 \, c^{2}} + \frac{{\left (C b^{2} - 2 \, C a c + 2 \, A c^{2}\right )} \arctan \left (\frac{2 \, c x + b}{\sqrt{-b^{2} + 4 \, a c}}\right )}{\sqrt{-b^{2} + 4 \, a c} c^{2}} \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),x, algorithm="giac")

[Out]

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