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

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

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.434996, antiderivative size = 226, normalized size of antiderivative = 1., number of steps used = 6, number of rules used = 5, integrand size = 27, $$\frac{\text{number of rules}}{\text{integrand size}}$$ = 0.185, Rules used = {1647, 801, 635, 205, 260} $\frac{\tan ^{-1}\left (\frac{\sqrt{c} x}{\sqrt{a}}\right ) \left (A c d \left (3 a e^2+c d^2\right )+a \left (c d^2-a e^2\right ) (C d-B e)\right )}{2 a^{3/2} \sqrt{c} \left (a e^2+c d^2\right )^2}-\frac{a (a C e-A c e+B c d)-c x (a B e-a C d+A c d)}{2 a c \left (a+c x^2\right ) \left (a e^2+c d^2\right )}-\frac{e \log \left (a+c x^2\right ) \left (A e^2-B d e+C d^2\right )}{2 \left (a e^2+c d^2\right )^2}+\frac{e \log (d+e x) \left (A e^2-B d e+C d^2\right )}{\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)*(a + c*x^2)^2),x]

[Out]

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

Rule 1647

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

Rule 801

Int[(((d_.) + (e_.)*(x_))^(m_)*((f_.) + (g_.)*(x_)))/((a_) + (c_.)*(x_)^2), x_Symbol] :> Int[ExpandIntegrand[(
(d + e*x)^m*(f + g*x))/(a + c*x^2), x], x] /; FreeQ[{a, c, d, e, f, g}, x] && NeQ[c*d^2 + a*e^2, 0] && Integer
Q[m]

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 )^2} \, dx &=-\frac{a (B c d-A c e+a C e)-c (A c d-a C d+a B e) x}{2 a c \left (c d^2+a e^2\right ) \left (a+c x^2\right )}-\frac{\int \frac{-\frac{c \left (a d (C d-B e)+A \left (c d^2+2 a e^2\right )\right )}{c d^2+a e^2}-\frac{c e (A c d-a C d+a B e) x}{c d^2+a e^2}}{(d+e x) \left (a+c x^2\right )} \, dx}{2 a c}\\ &=-\frac{a (B c d-A c e+a C e)-c (A c d-a C d+a B e) x}{2 a c \left (c d^2+a e^2\right ) \left (a+c x^2\right )}-\frac{\int \left (-\frac{2 a c e^2 \left (C d^2-B d e+A e^2\right )}{\left (c d^2+a e^2\right )^2 (d+e x)}+\frac{c \left (-a (C d-B e) \left (c d^2-a e^2\right )-A c d \left (c d^2+3 a e^2\right )+2 a c e \left (C d^2-B d e+A e^2\right ) x\right )}{\left (c d^2+a e^2\right )^2 \left (a+c x^2\right )}\right ) \, dx}{2 a c}\\ &=-\frac{a (B c d-A c e+a C e)-c (A c d-a C d+a B e) x}{2 a c \left (c d^2+a e^2\right ) \left (a+c x^2\right )}+\frac{e \left (C d^2-B d e+A e^2\right ) \log (d+e x)}{\left (c d^2+a e^2\right )^2}-\frac{\int \frac{-a (C d-B e) \left (c d^2-a e^2\right )-A c d \left (c d^2+3 a e^2\right )+2 a c e \left (C d^2-B d e+A e^2\right ) x}{a+c x^2} \, dx}{2 a \left (c d^2+a e^2\right )^2}\\ &=-\frac{a (B c d-A c e+a C e)-c (A c d-a C d+a B e) x}{2 a c \left (c d^2+a e^2\right ) \left (a+c x^2\right )}+\frac{e \left (C d^2-B d e+A e^2\right ) \log (d+e x)}{\left (c d^2+a e^2\right )^2}-\frac{\left (c e \left (C d^2-B d e+A 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 d-B e) \left (c d^2-a e^2\right )+A c d \left (c d^2+3 a e^2\right )\right ) \int \frac{1}{a+c x^2} \, dx}{2 a \left (c d^2+a e^2\right )^2}\\ &=-\frac{a (B c d-A c e+a C e)-c (A c d-a C d+a B e) x}{2 a c \left (c d^2+a e^2\right ) \left (a+c x^2\right )}+\frac{\left (a (C d-B e) \left (c d^2-a e^2\right )+A c d \left (c d^2+3 a e^2\right )\right ) \tan ^{-1}\left (\frac{\sqrt{c} x}{\sqrt{a}}\right )}{2 a^{3/2} \sqrt{c} \left (c d^2+a e^2\right )^2}+\frac{e \left (C d^2-B d e+A e^2\right ) \log (d+e x)}{\left (c d^2+a e^2\right )^2}-\frac{e \left (C d^2-B d e+A 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.261031, size = 195, normalized size = 0.86 $\frac{\frac{\left (a e^2+c d^2\right ) \left (a^2 (-C) e+a c (A e-B d+B e x-C d x)+A c^2 d x\right )}{a c \left (a+c x^2\right )}+\frac{\tan ^{-1}\left (\frac{\sqrt{c} x}{\sqrt{a}}\right ) \left (A c d \left (3 a e^2+c d^2\right )+a \left (c d^2-a e^2\right ) (C d-B e)\right )}{a^{3/2} \sqrt{c}}-e \log \left (a+c x^2\right ) \left (e (A e-B d)+C d^2\right )+2 e \log (d+e x) \left (e (A e-B d)+C d^2\right )}{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)*(a + c*x^2)^2),x]

[Out]

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

________________________________________________________________________________________

Maple [B]  time = 0.06, size = 742, normalized size = 3.3 \begin{align*} \text{result too large to display} \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)^2,x)

[Out]

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

[Out]

Timed out

________________________________________________________________________________________

Giac [A]  time = 1.20387, size = 473, normalized size = 2.09 \begin{align*} -\frac{{\left (C d^{2} e - B d e^{2} + A e^{3}\right )} \log \left (c x^{2} + a\right )}{2 \,{\left (c^{2} d^{4} + 2 \, a c d^{2} e^{2} + a^{2} e^{4}\right )}} + \frac{{\left (C d^{2} e^{2} - B d e^{3} + A e^{4}\right )} \log \left ({\left | x e + d \right |}\right )}{c^{2} d^{4} e + 2 \, a c d^{2} e^{3} + a^{2} e^{5}} + \frac{{\left (C a c d^{3} + A c^{2} d^{3} - B a c d^{2} e - C a^{2} d e^{2} + 3 \, A a c d e^{2} + B a^{2} e^{3}\right )} \arctan \left (\frac{c x}{\sqrt{a c}}\right )}{2 \,{\left (a c^{2} d^{4} + 2 \, a^{2} c d^{2} e^{2} + a^{3} e^{4}\right )} \sqrt{a c}} - \frac{B a c^{2} d^{3} + C a^{2} c d^{2} e - A a c^{2} d^{2} e + B a^{2} c d e^{2} + C a^{3} e^{3} - A a^{2} c e^{3} +{\left (C a c^{2} d^{3} - A c^{3} d^{3} - B a c^{2} d^{2} e + C a^{2} c d e^{2} - A a c^{2} d e^{2} - B a^{2} c e^{3}\right )} x}{2 \,{\left (c d^{2} + a e^{2}\right )}^{2}{\left (c x^{2} + a\right )} 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)^2,x, algorithm="giac")

[Out]

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