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

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

[Out]

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

________________________________________________________________________________________

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

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

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

Antiderivative was successfully verified.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [A]
time = 0.07, size = 34, normalized size = 0.87

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

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

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________