### 3.508 $$\int \frac{(d+e x)^2}{(a+c x^2)^2} \, dx$$

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

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.0210555, antiderivative size = 72, normalized size of antiderivative = 1., number of steps used = 2, number of rules used = 2, integrand size = 17, $$\frac{\text{number of rules}}{\text{integrand size}}$$ = 0.118, Rules used = {723, 205} $\frac{\left (a e^2+c d^2\right ) \tan ^{-1}\left (\frac{\sqrt{c} x}{\sqrt{a}}\right )}{2 a^{3/2} c^{3/2}}-\frac{(d+e x) (a e-c d x)}{2 a c \left (a+c x^2\right )}$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

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

Rule 723

Int[((d_) + (e_.)*(x_))^(m_)*((a_) + (c_.)*(x_)^2)^(p_), x_Symbol] :> Simp[((d + e*x)^(m - 1)*(a*e - c*d*x)*(a
+ c*x^2)^(p + 1))/(2*a*c*(p + 1)), x] + Dist[((2*p + 3)*(c*d^2 + a*e^2))/(2*a*c*(p + 1)), Int[(d + e*x)^(m -
2)*(a + c*x^2)^(p + 1), x], x] /; FreeQ[{a, c, d, e}, x] && NeQ[c*d^2 + a*e^2, 0] && EqQ[m + 2*p + 2, 0] && Lt
Q[p, -1]

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]

Rubi steps

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

Mathematica [A]  time = 0.0579996, size = 77, normalized size = 1.07 $\frac{\left (a e^2+c d^2\right ) \tan ^{-1}\left (\frac{\sqrt{c} x}{\sqrt{a}}\right )}{2 a^{3/2} c^{3/2}}+\frac{-2 a d e-a e^2 x+c d^2 x}{2 a c \left (a+c x^2\right )}$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [A]  time = 0.05, size = 85, normalized size = 1.2 \begin{align*}{\frac{1}{c{x}^{2}+a} \left ( -{\frac{ \left ( a{e}^{2}-c{d}^{2} \right ) x}{2\,ac}}-{\frac{de}{c}} \right ) }+{\frac{{e}^{2}}{2\,c}\arctan \left ({cx{\frac{1}{\sqrt{ac}}}} \right ){\frac{1}{\sqrt{ac}}}}+{\frac{{d}^{2}}{2\,a}\arctan \left ({cx{\frac{1}{\sqrt{ac}}}} \right ){\frac{1}{\sqrt{ac}}}} \end{align*}

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

[In]

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

[Out]

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

[Out]

Exception raised: ValueError

________________________________________________________________________________________

Fricas [A]  time = 1.88351, size = 452, normalized size = 6.28 \begin{align*} \left [-\frac{4 \, a^{2} c d e +{\left (a c d^{2} + a^{2} e^{2} +{\left (c^{2} d^{2} + a c e^{2}\right )} x^{2}\right )} \sqrt{-a c} \log \left (\frac{c x^{2} - 2 \, \sqrt{-a c} x - a}{c x^{2} + a}\right ) - 2 \,{\left (a c^{2} d^{2} - a^{2} c e^{2}\right )} x}{4 \,{\left (a^{2} c^{3} x^{2} + a^{3} c^{2}\right )}}, -\frac{2 \, a^{2} c d e -{\left (a c d^{2} + a^{2} e^{2} +{\left (c^{2} d^{2} + a c e^{2}\right )} x^{2}\right )} \sqrt{a c} \arctan \left (\frac{\sqrt{a c} x}{a}\right ) -{\left (a c^{2} d^{2} - a^{2} c e^{2}\right )} x}{2 \,{\left (a^{2} c^{3} x^{2} + a^{3} c^{2}\right )}}\right ] \end{align*}

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

[In]

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

[Out]

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

________________________________________________________________________________________

Sympy [B]  time = 0.722852, size = 129, normalized size = 1.79 \begin{align*} - \frac{\sqrt{- \frac{1}{a^{3} c^{3}}} \left (a e^{2} + c d^{2}\right ) \log{\left (- a^{2} c \sqrt{- \frac{1}{a^{3} c^{3}}} + x \right )}}{4} + \frac{\sqrt{- \frac{1}{a^{3} c^{3}}} \left (a e^{2} + c d^{2}\right ) \log{\left (a^{2} c \sqrt{- \frac{1}{a^{3} c^{3}}} + x \right )}}{4} - \frac{2 a d e + x \left (a e^{2} - c d^{2}\right )}{2 a^{2} c + 2 a c^{2} x^{2}} \end{align*}

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

[In]

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

[Out]

-sqrt(-1/(a**3*c**3))*(a*e**2 + c*d**2)*log(-a**2*c*sqrt(-1/(a**3*c**3)) + x)/4 + sqrt(-1/(a**3*c**3))*(a*e**2
+ c*d**2)*log(a**2*c*sqrt(-1/(a**3*c**3)) + x)/4 - (2*a*d*e + x*(a*e**2 - c*d**2))/(2*a**2*c + 2*a*c**2*x**2)

________________________________________________________________________________________

Giac [A]  time = 1.31404, size = 93, normalized size = 1.29 \begin{align*} \frac{{\left (c d^{2} + a e^{2}\right )} \arctan \left (\frac{c x}{\sqrt{a c}}\right )}{2 \, \sqrt{a c} a c} + \frac{c d^{2} x - a x e^{2} - 2 \, a d e}{2 \,{\left (c x^{2} + a\right )} a c} \end{align*}

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

[In]

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

[Out]

1/2*(c*d^2 + a*e^2)*arctan(c*x/sqrt(a*c))/(sqrt(a*c)*a*c) + 1/2*(c*d^2*x - a*x*e^2 - 2*a*d*e)/((c*x^2 + a)*a*c
)