3.47 $$\int \frac{A+B x+C x^2}{(d+e x) (a+c x^2)} \, dx$$

Optimal. Leaf size=133 $\frac{\log \left (a+c x^2\right ) (a C e-A c e+B c d)}{2 c \left (a e^2+c d^2\right )}+\frac{\log (d+e x) \left (A e^2-B d e+C d^2\right )}{e \left (a e^2+c d^2\right )}+\frac{\tan ^{-1}\left (\frac{\sqrt{c} x}{\sqrt{a}}\right ) (a B e-a C d+A c d)}{\sqrt{a} \sqrt{c} \left (a e^2+c d^2\right )}$

[Out]

((A*c*d - a*C*d + a*B*e)*ArcTan[(Sqrt[c]*x)/Sqrt[a]])/(Sqrt[a]*Sqrt[c]*(c*d^2 + a*e^2)) + ((C*d^2 - B*d*e + A*
e^2)*Log[d + e*x])/(e*(c*d^2 + a*e^2)) + ((B*c*d - A*c*e + a*C*e)*Log[a + c*x^2])/(2*c*(c*d^2 + a*e^2))

________________________________________________________________________________________

Rubi [A]  time = 0.162396, antiderivative size = 133, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 4, integrand size = 27, $$\frac{\text{number of rules}}{\text{integrand size}}$$ = 0.148, Rules used = {1629, 635, 205, 260} $\frac{\log \left (a+c x^2\right ) (a C e-A c e+B c d)}{2 c \left (a e^2+c d^2\right )}+\frac{\log (d+e x) \left (A e^2-B d e+C d^2\right )}{e \left (a e^2+c d^2\right )}+\frac{\tan ^{-1}\left (\frac{\sqrt{c} x}{\sqrt{a}}\right ) (a B e-a C d+A c d)}{\sqrt{a} \sqrt{c} \left (a e^2+c d^2\right )}$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

((A*c*d - a*C*d + a*B*e)*ArcTan[(Sqrt[c]*x)/Sqrt[a]])/(Sqrt[a]*Sqrt[c]*(c*d^2 + a*e^2)) + ((C*d^2 - B*d*e + A*
e^2)*Log[d + e*x])/(e*(c*d^2 + a*e^2)) + ((B*c*d - A*c*e + a*C*e)*Log[a + c*x^2])/(2*c*(c*d^2 + a*e^2))

Rule 1629

Int[(Pq_)*((d_) + (e_.)*(x_))^(m_.)*((a_) + (c_.)*(x_)^2)^(p_.), x_Symbol] :> Int[ExpandIntegrand[(d + e*x)^m*
Pq*(a + c*x^2)^p, x], x] /; FreeQ[{a, c, d, e, m}, x] && PolyQ[Pq, x] && IGtQ[p, -2]

Rule 635

Int[((d_) + (e_.)*(x_))/((a_) + (c_.)*(x_)^2), x_Symbol] :> Dist[d, Int[1/(a + c*x^2), x], x] + Dist[e, Int[x/
(a + c*x^2), x], x] /; FreeQ[{a, c, d, e}, x] &&  !NiceSqrtQ[-(a*c)]

Rule 205

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]*ArcTan[x/Rt[a/b, 2]])/a, x] /; FreeQ[{a, b}, x]
&& PosQ[a/b]

Rule 260

Int[(x_)^(m_.)/((a_) + (b_.)*(x_)^(n_)), x_Symbol] :> Simp[Log[RemoveContent[a + b*x^n, x]]/(b*n), x] /; FreeQ
[{a, b, m, n}, x] && EqQ[m, n - 1]

Rubi steps

\begin{align*} \int \frac{A+B x+C x^2}{(d+e x) \left (a+c x^2\right )} \, dx &=\int \left (\frac{C d^2-B d e+A e^2}{\left (c d^2+a e^2\right ) (d+e x)}+\frac{A c d-a C d+a B e+(B c d-A c e+a C e) x}{\left (c d^2+a e^2\right ) \left (a+c x^2\right )}\right ) \, dx\\ &=\frac{\left (C d^2-B d e+A e^2\right ) \log (d+e x)}{e \left (c d^2+a e^2\right )}+\frac{\int \frac{A c d-a C d+a B e+(B c d-A c e+a C e) x}{a+c x^2} \, dx}{c d^2+a e^2}\\ &=\frac{\left (C d^2-B d e+A e^2\right ) \log (d+e x)}{e \left (c d^2+a e^2\right )}+\frac{(A c d-a C d+a B e) \int \frac{1}{a+c x^2} \, dx}{c d^2+a e^2}+\frac{(B c d-A c e+a C e) \int \frac{x}{a+c x^2} \, dx}{c d^2+a e^2}\\ &=\frac{(A c d-a C d+a B e) \tan ^{-1}\left (\frac{\sqrt{c} x}{\sqrt{a}}\right )}{\sqrt{a} \sqrt{c} \left (c d^2+a e^2\right )}+\frac{\left (C d^2-B d e+A e^2\right ) \log (d+e x)}{e \left (c d^2+a e^2\right )}+\frac{(B c d-A c e+a C e) \log \left (a+c x^2\right )}{2 c \left (c d^2+a e^2\right )}\\ \end{align*}

Mathematica [A]  time = 0.115492, size = 120, normalized size = 0.9 $\frac{\sqrt{a} \left (e \log \left (a+c x^2\right ) (a C e-A c e+B c d)+2 c \log (d+e x) \left (A e^2-B d e+C d^2\right )\right )+2 \sqrt{c} e \tan ^{-1}\left (\frac{\sqrt{c} x}{\sqrt{a}}\right ) (a B e-a C d+A c d)}{2 \sqrt{a} c e \left (a e^2+c d^2\right )}$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

(2*Sqrt[c]*e*(A*c*d - a*C*d + a*B*e)*ArcTan[(Sqrt[c]*x)/Sqrt[a]] + Sqrt[a]*(2*c*(C*d^2 - B*d*e + A*e^2)*Log[d
+ e*x] + e*(B*c*d - A*c*e + a*C*e)*Log[a + c*x^2]))/(2*Sqrt[a]*c*e*(c*d^2 + a*e^2))

________________________________________________________________________________________

Maple [A]  time = 0.053, size = 247, normalized size = 1.9 \begin{align*} -{\frac{\ln \left ( c{x}^{2}+a \right ) Ae}{2\,a{e}^{2}+2\,c{d}^{2}}}+{\frac{\ln \left ( c{x}^{2}+a \right ) Bd}{2\,a{e}^{2}+2\,c{d}^{2}}}+{\frac{\ln \left ( c{x}^{2}+a \right ) aCe}{ \left ( 2\,a{e}^{2}+2\,c{d}^{2} \right ) c}}+{\frac{Acd}{a{e}^{2}+c{d}^{2}}\arctan \left ({cx{\frac{1}{\sqrt{ac}}}} \right ){\frac{1}{\sqrt{ac}}}}+{\frac{aBe}{a{e}^{2}+c{d}^{2}}\arctan \left ({cx{\frac{1}{\sqrt{ac}}}} \right ){\frac{1}{\sqrt{ac}}}}-{\frac{Cad}{a{e}^{2}+c{d}^{2}}\arctan \left ({cx{\frac{1}{\sqrt{ac}}}} \right ){\frac{1}{\sqrt{ac}}}}+{\frac{e\ln \left ( ex+d \right ) A}{a{e}^{2}+c{d}^{2}}}-{\frac{\ln \left ( ex+d \right ) Bd}{a{e}^{2}+c{d}^{2}}}+{\frac{\ln \left ( ex+d \right ) C{d}^{2}}{ \left ( a{e}^{2}+c{d}^{2} \right ) e}} \end{align*}

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

[In]

int((C*x^2+B*x+A)/(e*x+d)/(c*x^2+a),x)

[Out]

-1/2/(a*e^2+c*d^2)*ln(c*x^2+a)*A*e+1/2/(a*e^2+c*d^2)*ln(c*x^2+a)*B*d+1/2/(a*e^2+c*d^2)/c*ln(c*x^2+a)*a*C*e+1/(
a*e^2+c*d^2)/(a*c)^(1/2)*arctan(x*c/(a*c)^(1/2))*A*c*d+1/(a*e^2+c*d^2)/(a*c)^(1/2)*arctan(x*c/(a*c)^(1/2))*a*B
*e-1/(a*e^2+c*d^2)/(a*c)^(1/2)*arctan(x*c/(a*c)^(1/2))*C*a*d+1/(a*e^2+c*d^2)*e*ln(e*x+d)*A-1/(a*e^2+c*d^2)*ln(
e*x+d)*B*d+1/(a*e^2+c*d^2)/e*ln(e*x+d)*C*d^2

________________________________________________________________________________________

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

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [A]  time = 47.1002, size = 575, normalized size = 4.32 \begin{align*} \left [-\frac{{\left (B a e^{2} -{\left (C a - A c\right )} d e\right )} \sqrt{-a c} \log \left (\frac{c x^{2} - 2 \, \sqrt{-a c} x - a}{c x^{2} + a}\right ) -{\left (B a c d e +{\left (C a^{2} - A a c\right )} e^{2}\right )} \log \left (c x^{2} + a\right ) - 2 \,{\left (C a c d^{2} - B a c d e + A a c e^{2}\right )} \log \left (e x + d\right )}{2 \,{\left (a c^{2} d^{2} e + a^{2} c e^{3}\right )}}, \frac{2 \,{\left (B a e^{2} -{\left (C a - A c\right )} d e\right )} \sqrt{a c} \arctan \left (\frac{\sqrt{a c} x}{a}\right ) +{\left (B a c d e +{\left (C a^{2} - A a c\right )} e^{2}\right )} \log \left (c x^{2} + a\right ) + 2 \,{\left (C a c d^{2} - B a c d e + A a c e^{2}\right )} \log \left (e x + d\right )}{2 \,{\left (a c^{2} d^{2} e + a^{2} c e^{3}\right )}}\right ] \end{align*}

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

[In]

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

[Out]

[-1/2*((B*a*e^2 - (C*a - A*c)*d*e)*sqrt(-a*c)*log((c*x^2 - 2*sqrt(-a*c)*x - a)/(c*x^2 + a)) - (B*a*c*d*e + (C*
a^2 - A*a*c)*e^2)*log(c*x^2 + a) - 2*(C*a*c*d^2 - B*a*c*d*e + A*a*c*e^2)*log(e*x + d))/(a*c^2*d^2*e + a^2*c*e^
3), 1/2*(2*(B*a*e^2 - (C*a - A*c)*d*e)*sqrt(a*c)*arctan(sqrt(a*c)*x/a) + (B*a*c*d*e + (C*a^2 - A*a*c)*e^2)*log
(c*x^2 + a) + 2*(C*a*c*d^2 - B*a*c*d*e + A*a*c*e^2)*log(e*x + d))/(a*c^2*d^2*e + a^2*c*e^3)]

________________________________________________________________________________________

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

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

[In]

integrate((C*x**2+B*x+A)/(e*x+d)/(c*x**2+a),x)

[Out]

Timed out

________________________________________________________________________________________

Giac [A]  time = 1.13254, size = 169, normalized size = 1.27 \begin{align*} \frac{{\left (B c d + C a e - A c e\right )} \log \left (c x^{2} + a\right )}{2 \,{\left (c^{2} d^{2} + a c e^{2}\right )}} + \frac{{\left (C d^{2} - B d e + A e^{2}\right )} \log \left ({\left | x e + d \right |}\right )}{c d^{2} e + a e^{3}} - \frac{{\left (C a d - A c d - B a e\right )} \arctan \left (\frac{c x}{\sqrt{a c}}\right )}{{\left (c d^{2} + a e^{2}\right )} \sqrt{a c}} \end{align*}

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

[In]

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

[Out]

1/2*(B*c*d + C*a*e - A*c*e)*log(c*x^2 + a)/(c^2*d^2 + a*c*e^2) + (C*d^2 - B*d*e + A*e^2)*log(abs(x*e + d))/(c*
d^2*e + a*e^3) - (C*a*d - A*c*d - B*a*e)*arctan(c*x/sqrt(a*c))/((c*d^2 + a*e^2)*sqrt(a*c))