3.1.5 \(\int \frac {a+b x^2}{c+d x^2} \, dx\) [5]

Optimal. Leaf size=40 \[ \frac {b x}{d}-\frac {(b c-a d) \tan ^{-1}\left (\frac {\sqrt {d} x}{\sqrt {c}}\right )}{\sqrt {c} d^{3/2}} \]

[Out]

b*x/d-(-a*d+b*c)*arctan(x*d^(1/2)/c^(1/2))/d^(3/2)/c^(1/2)

________________________________________________________________________________________

Rubi [A]
time = 0.01, antiderivative size = 40, normalized size of antiderivative = 1.00, 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 = {396, 211} \begin {gather*} \frac {b x}{d}-\frac {(b c-a d) \text {ArcTan}\left (\frac {\sqrt {d} x}{\sqrt {c}}\right )}{\sqrt {c} d^{3/2}} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

Rule 211

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

Rule 396

Int[((a_) + (b_.)*(x_)^(n_))^(p_)*((c_) + (d_.)*(x_)^(n_)), x_Symbol] :> Simp[d*x*((a + b*x^n)^(p + 1)/(b*(n*(
p + 1) + 1))), x] - Dist[(a*d - b*c*(n*(p + 1) + 1))/(b*(n*(p + 1) + 1)), Int[(a + b*x^n)^p, x], x] /; FreeQ[{
a, b, c, d, n}, x] && NeQ[b*c - a*d, 0] && NeQ[n*(p + 1) + 1, 0]

Rubi steps

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

________________________________________________________________________________________

Mathematica [A]
time = 0.02, size = 40, normalized size = 1.00 \begin {gather*} \frac {b x}{d}-\frac {(b c-a d) \tan ^{-1}\left (\frac {\sqrt {d} x}{\sqrt {c}}\right )}{\sqrt {c} d^{3/2}} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [A]
time = 0.08, size = 34, normalized size = 0.85

method result size
default \(\frac {b x}{d}+\frac {\left (a d -b c \right ) \arctan \left (\frac {d x}{\sqrt {c d}}\right )}{d \sqrt {c d}}\) \(34\)
risch \(\frac {b x}{d}-\frac {\ln \left (d x +\sqrt {-c d}\right ) a}{2 \sqrt {-c d}}+\frac {\ln \left (d x +\sqrt {-c d}\right ) b c}{2 d \sqrt {-c d}}+\frac {\ln \left (-d x +\sqrt {-c d}\right ) a}{2 \sqrt {-c d}}-\frac {\ln \left (-d x +\sqrt {-c d}\right ) b c}{2 d \sqrt {-c d}}\) \(98\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((b*x^2+a)/(d*x^2+c),x,method=_RETURNVERBOSE)

[Out]

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

________________________________________________________________________________________

Maxima [A]
time = 0.52, size = 34, normalized size = 0.85 \begin {gather*} \frac {b x}{d} - \frac {{\left (b c - a d\right )} \arctan \left (\frac {d x}{\sqrt {c d}}\right )}{\sqrt {c d} d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

b*x/d - (b*c - a*d)*arctan(d*x/sqrt(c*d))/(sqrt(c*d)*d)

________________________________________________________________________________________

Fricas [A]
time = 0.79, size = 99, normalized size = 2.48 \begin {gather*} \left [\frac {2 \, b c d x + {\left (b c - a d\right )} \sqrt {-c d} \log \left (\frac {d x^{2} - 2 \, \sqrt {-c d} x - c}{d x^{2} + c}\right )}{2 \, c d^{2}}, \frac {b c d x - {\left (b c - a d\right )} \sqrt {c d} \arctan \left (\frac {\sqrt {c d} x}{c}\right )}{c d^{2}}\right ] \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 82 vs. \(2 (34) = 68\).
time = 0.14, size = 82, normalized size = 2.05 \begin {gather*} \frac {b x}{d} - \frac {\sqrt {- \frac {1}{c d^{3}}} \left (a d - b c\right ) \log {\left (- c d \sqrt {- \frac {1}{c d^{3}}} + x \right )}}{2} + \frac {\sqrt {- \frac {1}{c d^{3}}} \left (a d - b c\right ) \log {\left (c d \sqrt {- \frac {1}{c d^{3}}} + x \right )}}{2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Giac [A]
time = 1.18, size = 34, normalized size = 0.85 \begin {gather*} \frac {b x}{d} - \frac {{\left (b c - a d\right )} \arctan \left (\frac {d x}{\sqrt {c d}}\right )}{\sqrt {c d} d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

b*x/d - (b*c - a*d)*arctan(d*x/sqrt(c*d))/(sqrt(c*d)*d)

________________________________________________________________________________________

Mupad [B]
time = 0.06, size = 31, normalized size = 0.78 \begin {gather*} \frac {b\,x}{d}+\frac {\mathrm {atan}\left (\frac {\sqrt {d}\,x}{\sqrt {c}}\right )\,\left (a\,d-b\,c\right )}{\sqrt {c}\,d^{3/2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

(b*x)/d + (atan((d^(1/2)*x)/c^(1/2))*(a*d - b*c))/(c^(1/2)*d^(3/2))

________________________________________________________________________________________