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

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

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.355451, antiderivative size = 214, 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 ) \left (-a B e^2+2 a C d e-2 A c d e+B c d^2\right )}{2 \left (a e^2+c d^2\right )^2}-\frac{A e^2-B d e+C d^2}{e (d+e x) \left (a e^2+c d^2\right )}-\frac{\log (d+e x) \left (-a B e^2+2 a C d e-2 A c d e+B c d^2\right )}{\left (a e^2+c d^2\right )^2}+\frac{\tan ^{-1}\left (\frac{\sqrt{c} x}{\sqrt{a}}\right ) \left (A c \left (c d^2-a e^2\right )+a \left (a C e^2-c d (C d-2 B e)\right )\right )}{\sqrt{a} \sqrt{c} \left (a e^2+c d^2\right )^2}$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

-((C*d^2 - B*d*e + A*e^2)/(e*(c*d^2 + a*e^2)*(d + e*x))) + ((A*c*(c*d^2 - a*e^2) + a*(a*C*e^2 - c*d*(C*d - 2*B
*e)))*ArcTan[(Sqrt[c]*x)/Sqrt[a]])/(Sqrt[a]*Sqrt[c]*(c*d^2 + a*e^2)^2) - ((B*c*d^2 - 2*A*c*d*e + 2*a*C*d*e - a
*B*e^2)*Log[d + e*x])/(c*d^2 + a*e^2)^2 + ((B*c*d^2 - 2*A*c*d*e + 2*a*C*d*e - a*B*e^2)*Log[a + c*x^2])/(2*(c*d
^2 + a*e^2)^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)^2 \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)^2}+\frac{e \left (-B c d^2+2 A c d e-2 a C d e+a B e^2\right )}{\left (c d^2+a e^2\right )^2 (d+e x)}+\frac{A c \left (c d^2-a e^2\right )+a \left (a C e^2-c d (C d-2 B e)\right )+c \left (B c d^2-2 A c d e+2 a C d e-a B e^2\right ) x}{\left (c d^2+a e^2\right )^2 \left (a+c x^2\right )}\right ) \, dx\\ &=-\frac{C d^2-B d e+A e^2}{e \left (c d^2+a e^2\right ) (d+e x)}-\frac{\left (B c d^2-2 A c d e+2 a C d e-a B e^2\right ) \log (d+e x)}{\left (c d^2+a e^2\right )^2}+\frac{\int \frac{A c \left (c d^2-a e^2\right )+a \left (a C e^2-c d (C d-2 B e)\right )+c \left (B c d^2-2 A c d e+2 a C d e-a B e^2\right ) x}{a+c x^2} \, dx}{\left (c d^2+a e^2\right )^2}\\ &=-\frac{C d^2-B d e+A e^2}{e \left (c d^2+a e^2\right ) (d+e x)}-\frac{\left (B c d^2-2 A c d e+2 a C d e-a B e^2\right ) \log (d+e x)}{\left (c d^2+a e^2\right )^2}+\frac{\left (c \left (B c d^2-2 A c d e+2 a C d e-a B e^2\right )\right ) \int \frac{x}{a+c x^2} \, dx}{\left (c d^2+a e^2\right )^2}+\frac{\left (A c \left (c d^2-a e^2\right )+a \left (a C e^2-c d (C d-2 B e)\right )\right ) \int \frac{1}{a+c x^2} \, dx}{\left (c d^2+a e^2\right )^2}\\ &=-\frac{C d^2-B d e+A e^2}{e \left (c d^2+a e^2\right ) (d+e x)}+\frac{\left (A c \left (c d^2-a e^2\right )+a \left (a C e^2-c d (C d-2 B e)\right )\right ) \tan ^{-1}\left (\frac{\sqrt{c} x}{\sqrt{a}}\right )}{\sqrt{a} \sqrt{c} \left (c d^2+a e^2\right )^2}-\frac{\left (B c d^2-2 A c d e+2 a C d e-a B e^2\right ) \log (d+e x)}{\left (c d^2+a e^2\right )^2}+\frac{\left (B c d^2-2 A c d e+2 a C d e-a B e^2\right ) \log \left (a+c x^2\right )}{2 \left (c d^2+a e^2\right )^2}\\ \end{align*}

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

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [B]  time = 0.058, size = 462, normalized size = 2.2 \begin{align*} -{\frac{c\ln \left ( c{x}^{2}+a \right ) Ade}{ \left ( a{e}^{2}+c{d}^{2} \right ) ^{2}}}-{\frac{\ln \left ( c{x}^{2}+a \right ) Ba{e}^{2}}{2\, \left ( a{e}^{2}+c{d}^{2} \right ) ^{2}}}+{\frac{c\ln \left ( c{x}^{2}+a \right ) B{d}^{2}}{2\, \left ( a{e}^{2}+c{d}^{2} \right ) ^{2}}}+{\frac{\ln \left ( c{x}^{2}+a \right ) Cade}{ \left ( a{e}^{2}+c{d}^{2} \right ) ^{2}}}-{\frac{aA{e}^{2}c}{ \left ( a{e}^{2}+c{d}^{2} \right ) ^{2}}\arctan \left ({cx{\frac{1}{\sqrt{ac}}}} \right ){\frac{1}{\sqrt{ac}}}}+{\frac{A{c}^{2}{d}^{2}}{ \left ( a{e}^{2}+c{d}^{2} \right ) ^{2}}\arctan \left ({cx{\frac{1}{\sqrt{ac}}}} \right ){\frac{1}{\sqrt{ac}}}}+2\,{\frac{Bacde}{ \left ( a{e}^{2}+c{d}^{2} \right ) ^{2}\sqrt{ac}}\arctan \left ({\frac{cx}{\sqrt{ac}}} \right ) }+{\frac{{a}^{2}C{e}^{2}}{ \left ( a{e}^{2}+c{d}^{2} \right ) ^{2}}\arctan \left ({cx{\frac{1}{\sqrt{ac}}}} \right ){\frac{1}{\sqrt{ac}}}}-{\frac{Cac{d}^{2}}{ \left ( a{e}^{2}+c{d}^{2} \right ) ^{2}}\arctan \left ({cx{\frac{1}{\sqrt{ac}}}} \right ){\frac{1}{\sqrt{ac}}}}-{\frac{Ae}{ \left ( a{e}^{2}+c{d}^{2} \right ) \left ( ex+d \right ) }}+{\frac{Bd}{ \left ( a{e}^{2}+c{d}^{2} \right ) \left ( ex+d \right ) }}-{\frac{C{d}^{2}}{ \left ( a{e}^{2}+c{d}^{2} \right ) e \left ( ex+d \right ) }}+2\,{\frac{\ln \left ( ex+d \right ) Acde}{ \left ( a{e}^{2}+c{d}^{2} \right ) ^{2}}}+{\frac{\ln \left ( ex+d \right ) aB{e}^{2}}{ \left ( a{e}^{2}+c{d}^{2} \right ) ^{2}}}-{\frac{\ln \left ( ex+d \right ) Bc{d}^{2}}{ \left ( a{e}^{2}+c{d}^{2} \right ) ^{2}}}-2\,{\frac{\ln \left ( ex+d \right ) Cade}{ \left ( a{e}^{2}+c{d}^{2} \right ) ^{2}}} \end{align*}

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

[In]

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

[Out]

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

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [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)^2/(c*x^2+a),x, algorithm="fricas")

[Out]

Timed out

________________________________________________________________________________________

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)**2/(c*x**2+a),x)

[Out]

Timed out

________________________________________________________________________________________

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

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

[In]

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

[Out]

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