\(\int \frac {A+B x+C x^2+D x^3}{x^2 \sqrt {a+b x^2}} \, dx\) [95]

Optimal result
Mathematica [A] (verified)
Rubi [A] (verified)
Maple [A] (verified)
Fricas [A] (verification not implemented)
Sympy [A] (verification not implemented)
Maxima [A] (verification not implemented)
Giac [A] (verification not implemented)
Mupad [B] (verification not implemented)
Reduce [B] (verification not implemented)

Optimal result

Integrand size = 30, antiderivative size = 89 \[ \int \frac {A+B x+C x^2+D x^3}{x^2 \sqrt {a+b x^2}} \, dx=\frac {D \sqrt {a+b x^2}}{b}-\frac {A \sqrt {a+b x^2}}{a x}+\frac {C \text {arctanh}\left (\frac {\sqrt {b} x}{\sqrt {a+b x^2}}\right )}{\sqrt {b}}-\frac {B \text {arctanh}\left (\frac {\sqrt {a+b x^2}}{\sqrt {a}}\right )}{\sqrt {a}} \] Output:

D*(b*x^2+a)^(1/2)/b-A*(b*x^2+a)^(1/2)/a/x+C*arctanh(b^(1/2)*x/(b*x^2+a)^(1 
/2))/b^(1/2)-B*arctanh((b*x^2+a)^(1/2)/a^(1/2))/a^(1/2)
 

Mathematica [A] (verified)

Time = 0.51 (sec) , antiderivative size = 96, normalized size of antiderivative = 1.08 \[ \int \frac {A+B x+C x^2+D x^3}{x^2 \sqrt {a+b x^2}} \, dx=\frac {(-A b+a D x) \sqrt {a+b x^2}}{a b x}+\frac {2 B \text {arctanh}\left (\frac {\sqrt {b} x-\sqrt {a+b x^2}}{\sqrt {a}}\right )}{\sqrt {a}}-\frac {C \log \left (-\sqrt {b} x+\sqrt {a+b x^2}\right )}{\sqrt {b}} \] Input:

Integrate[(A + B*x + C*x^2 + D*x^3)/(x^2*Sqrt[a + b*x^2]),x]
 

Output:

((-(A*b) + a*D*x)*Sqrt[a + b*x^2])/(a*b*x) + (2*B*ArcTanh[(Sqrt[b]*x - Sqr 
t[a + b*x^2])/Sqrt[a]])/Sqrt[a] - (C*Log[-(Sqrt[b]*x) + Sqrt[a + b*x^2]])/ 
Sqrt[b]
 

Rubi [A] (verified)

Time = 0.40 (sec) , antiderivative size = 98, normalized size of antiderivative = 1.10, number of steps used = 11, number of rules used = 10, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {2338, 25, 2340, 27, 538, 224, 219, 243, 73, 221}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \frac {A+B x+C x^2+D x^3}{x^2 \sqrt {a+b x^2}} \, dx\)

\(\Big \downarrow \) 2338

\(\displaystyle -\frac {\int -\frac {a D x^2+a C x+a B}{x \sqrt {b x^2+a}}dx}{a}-\frac {A \sqrt {a+b x^2}}{a x}\)

\(\Big \downarrow \) 25

\(\displaystyle \frac {\int \frac {a D x^2+a C x+a B}{x \sqrt {b x^2+a}}dx}{a}-\frac {A \sqrt {a+b x^2}}{a x}\)

\(\Big \downarrow \) 2340

\(\displaystyle \frac {\frac {\int \frac {a b (B+C x)}{x \sqrt {b x^2+a}}dx}{b}+\frac {a D \sqrt {a+b x^2}}{b}}{a}-\frac {A \sqrt {a+b x^2}}{a x}\)

\(\Big \downarrow \) 27

\(\displaystyle \frac {a \int \frac {B+C x}{x \sqrt {b x^2+a}}dx+\frac {a D \sqrt {a+b x^2}}{b}}{a}-\frac {A \sqrt {a+b x^2}}{a x}\)

\(\Big \downarrow \) 538

\(\displaystyle \frac {a \left (B \int \frac {1}{x \sqrt {b x^2+a}}dx+C \int \frac {1}{\sqrt {b x^2+a}}dx\right )+\frac {a D \sqrt {a+b x^2}}{b}}{a}-\frac {A \sqrt {a+b x^2}}{a x}\)

\(\Big \downarrow \) 224

\(\displaystyle \frac {a \left (B \int \frac {1}{x \sqrt {b x^2+a}}dx+C \int \frac {1}{1-\frac {b x^2}{b x^2+a}}d\frac {x}{\sqrt {b x^2+a}}\right )+\frac {a D \sqrt {a+b x^2}}{b}}{a}-\frac {A \sqrt {a+b x^2}}{a x}\)

\(\Big \downarrow \) 219

\(\displaystyle \frac {a \left (B \int \frac {1}{x \sqrt {b x^2+a}}dx+\frac {C \text {arctanh}\left (\frac {\sqrt {b} x}{\sqrt {a+b x^2}}\right )}{\sqrt {b}}\right )+\frac {a D \sqrt {a+b x^2}}{b}}{a}-\frac {A \sqrt {a+b x^2}}{a x}\)

\(\Big \downarrow \) 243

\(\displaystyle \frac {a \left (\frac {1}{2} B \int \frac {1}{x^2 \sqrt {b x^2+a}}dx^2+\frac {C \text {arctanh}\left (\frac {\sqrt {b} x}{\sqrt {a+b x^2}}\right )}{\sqrt {b}}\right )+\frac {a D \sqrt {a+b x^2}}{b}}{a}-\frac {A \sqrt {a+b x^2}}{a x}\)

\(\Big \downarrow \) 73

\(\displaystyle \frac {a \left (\frac {B \int \frac {1}{\frac {x^4}{b}-\frac {a}{b}}d\sqrt {b x^2+a}}{b}+\frac {C \text {arctanh}\left (\frac {\sqrt {b} x}{\sqrt {a+b x^2}}\right )}{\sqrt {b}}\right )+\frac {a D \sqrt {a+b x^2}}{b}}{a}-\frac {A \sqrt {a+b x^2}}{a x}\)

\(\Big \downarrow \) 221

\(\displaystyle \frac {a \left (\frac {C \text {arctanh}\left (\frac {\sqrt {b} x}{\sqrt {a+b x^2}}\right )}{\sqrt {b}}-\frac {B \text {arctanh}\left (\frac {\sqrt {a+b x^2}}{\sqrt {a}}\right )}{\sqrt {a}}\right )+\frac {a D \sqrt {a+b x^2}}{b}}{a}-\frac {A \sqrt {a+b x^2}}{a x}\)

Input:

Int[(A + B*x + C*x^2 + D*x^3)/(x^2*Sqrt[a + b*x^2]),x]
 

Output:

-((A*Sqrt[a + b*x^2])/(a*x)) + ((a*D*Sqrt[a + b*x^2])/b + a*((C*ArcTanh[(S 
qrt[b]*x)/Sqrt[a + b*x^2]])/Sqrt[b] - (B*ArcTanh[Sqrt[a + b*x^2]/Sqrt[a]]) 
/Sqrt[a]))/a
 

Defintions of rubi rules used

rule 25
Int[-(Fx_), x_Symbol] :> Simp[Identity[-1]   Int[Fx, x], x]
 

rule 27
Int[(a_)*(Fx_), x_Symbol] :> Simp[a   Int[Fx, x], x] /; FreeQ[a, x] &&  !Ma 
tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
 

rule 73
Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> With[ 
{p = Denominator[m]}, Simp[p/b   Subst[Int[x^(p*(m + 1) - 1)*(c - a*(d/b) + 
 d*(x^p/b))^n, x], x, (a + b*x)^(1/p)], x]] /; FreeQ[{a, b, c, d}, x] && Lt 
Q[-1, m, 0] && LeQ[-1, n, 0] && LeQ[Denominator[n], Denominator[m]] && IntL 
inearQ[a, b, c, d, m, n, x]
 

rule 219
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))* 
ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x] /; FreeQ[{a, b}, x] && NegQ[a/b] && (Gt 
Q[a, 0] || LtQ[b, 0])
 

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

rule 224
Int[1/Sqrt[(a_) + (b_.)*(x_)^2], x_Symbol] :> Subst[Int[1/(1 - b*x^2), x], 
x, x/Sqrt[a + b*x^2]] /; FreeQ[{a, b}, x] &&  !GtQ[a, 0]
 

rule 243
Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^2)^(p_), x_Symbol] :> Simp[1/2   Subst[In 
t[x^((m - 1)/2)*(a + b*x)^p, x], x, x^2], x] /; FreeQ[{a, b, m, p}, x] && I 
ntegerQ[(m - 1)/2]
 

rule 538
Int[((c_) + (d_.)*(x_))/((x_)*Sqrt[(a_) + (b_.)*(x_)^2]), x_Symbol] :> Simp 
[c   Int[1/(x*Sqrt[a + b*x^2]), x], x] + Simp[d   Int[1/Sqrt[a + b*x^2], x] 
, x] /; FreeQ[{a, b, c, d}, x]
 

rule 2338
Int[(Pq_)*((c_.)*(x_))^(m_)*((a_) + (b_.)*(x_)^2)^(p_), x_Symbol] :> With[{ 
Q = PolynomialQuotient[Pq, c*x, x], R = PolynomialRemainder[Pq, c*x, x]}, S 
imp[R*(c*x)^(m + 1)*((a + b*x^2)^(p + 1)/(a*c*(m + 1))), x] + Simp[1/(a*c*( 
m + 1))   Int[(c*x)^(m + 1)*(a + b*x^2)^p*ExpandToSum[a*c*(m + 1)*Q - b*R*( 
m + 2*p + 3)*x, x], x], x]] /; FreeQ[{a, b, c, p}, x] && PolyQ[Pq, x] && Lt 
Q[m, -1] && (IntegerQ[2*p] || NeQ[Expon[Pq, x], 1])
 

rule 2340
Int[(Pq_)*((c_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^2)^(p_), x_Symbol] :> With[ 
{q = Expon[Pq, x], f = Coeff[Pq, x, Expon[Pq, x]]}, Simp[f*(c*x)^(m + q - 1 
)*((a + b*x^2)^(p + 1)/(b*c^(q - 1)*(m + q + 2*p + 1))), x] + Simp[1/(b*(m 
+ q + 2*p + 1))   Int[(c*x)^m*(a + b*x^2)^p*ExpandToSum[b*(m + q + 2*p + 1) 
*Pq - b*f*(m + q + 2*p + 1)*x^q - a*f*(m + q - 1)*x^(q - 2), x], x], x] /; 
GtQ[q, 1] && NeQ[m + q + 2*p + 1, 0]] /; FreeQ[{a, b, c, m, p}, x] && PolyQ 
[Pq, x] && ( !IGtQ[m, 0] || IGtQ[p + 1/2, -1])
 
Maple [A] (verified)

Time = 0.52 (sec) , antiderivative size = 84, normalized size of antiderivative = 0.94

method result size
default \(\frac {C \ln \left (\sqrt {b}\, x +\sqrt {b \,x^{2}+a}\right )}{\sqrt {b}}-\frac {A \sqrt {b \,x^{2}+a}}{a x}-\frac {B \ln \left (\frac {2 a +2 \sqrt {a}\, \sqrt {b \,x^{2}+a}}{x}\right )}{\sqrt {a}}+\frac {D \sqrt {b \,x^{2}+a}}{b}\) \(84\)

Input:

int((D*x^3+C*x^2+B*x+A)/x^2/(b*x^2+a)^(1/2),x,method=_RETURNVERBOSE)
 

Output:

C*ln(b^(1/2)*x+(b*x^2+a)^(1/2))/b^(1/2)-A*(b*x^2+a)^(1/2)/a/x-B/a^(1/2)*ln 
((2*a+2*a^(1/2)*(b*x^2+a)^(1/2))/x)+D*(b*x^2+a)^(1/2)/b
 

Fricas [A] (verification not implemented)

Time = 0.10 (sec) , antiderivative size = 379, normalized size of antiderivative = 4.26 \[ \int \frac {A+B x+C x^2+D x^3}{x^2 \sqrt {a+b x^2}} \, dx=\left [\frac {C a \sqrt {b} x \log \left (-2 \, b x^{2} - 2 \, \sqrt {b x^{2} + a} \sqrt {b} x - a\right ) + B \sqrt {a} b x \log \left (-\frac {b x^{2} - 2 \, \sqrt {b x^{2} + a} \sqrt {a} + 2 \, a}{x^{2}}\right ) + 2 \, {\left (D a x - A b\right )} \sqrt {b x^{2} + a}}{2 \, a b x}, -\frac {2 \, C a \sqrt {-b} x \arctan \left (\frac {\sqrt {-b} x}{\sqrt {b x^{2} + a}}\right ) - B \sqrt {a} b x \log \left (-\frac {b x^{2} - 2 \, \sqrt {b x^{2} + a} \sqrt {a} + 2 \, a}{x^{2}}\right ) - 2 \, {\left (D a x - A b\right )} \sqrt {b x^{2} + a}}{2 \, a b x}, \frac {2 \, B \sqrt {-a} b x \arctan \left (\frac {\sqrt {b x^{2} + a} \sqrt {-a}}{a}\right ) + C a \sqrt {b} x \log \left (-2 \, b x^{2} - 2 \, \sqrt {b x^{2} + a} \sqrt {b} x - a\right ) + 2 \, {\left (D a x - A b\right )} \sqrt {b x^{2} + a}}{2 \, a b x}, -\frac {C a \sqrt {-b} x \arctan \left (\frac {\sqrt {-b} x}{\sqrt {b x^{2} + a}}\right ) - B \sqrt {-a} b x \arctan \left (\frac {\sqrt {b x^{2} + a} \sqrt {-a}}{a}\right ) - {\left (D a x - A b\right )} \sqrt {b x^{2} + a}}{a b x}\right ] \] Input:

integrate((D*x^3+C*x^2+B*x+A)/x^2/(b*x^2+a)^(1/2),x, algorithm="fricas")
 

Output:

[1/2*(C*a*sqrt(b)*x*log(-2*b*x^2 - 2*sqrt(b*x^2 + a)*sqrt(b)*x - a) + B*sq 
rt(a)*b*x*log(-(b*x^2 - 2*sqrt(b*x^2 + a)*sqrt(a) + 2*a)/x^2) + 2*(D*a*x - 
 A*b)*sqrt(b*x^2 + a))/(a*b*x), -1/2*(2*C*a*sqrt(-b)*x*arctan(sqrt(-b)*x/s 
qrt(b*x^2 + a)) - B*sqrt(a)*b*x*log(-(b*x^2 - 2*sqrt(b*x^2 + a)*sqrt(a) + 
2*a)/x^2) - 2*(D*a*x - A*b)*sqrt(b*x^2 + a))/(a*b*x), 1/2*(2*B*sqrt(-a)*b* 
x*arctan(sqrt(b*x^2 + a)*sqrt(-a)/a) + C*a*sqrt(b)*x*log(-2*b*x^2 - 2*sqrt 
(b*x^2 + a)*sqrt(b)*x - a) + 2*(D*a*x - A*b)*sqrt(b*x^2 + a))/(a*b*x), -(C 
*a*sqrt(-b)*x*arctan(sqrt(-b)*x/sqrt(b*x^2 + a)) - B*sqrt(-a)*b*x*arctan(s 
qrt(b*x^2 + a)*sqrt(-a)/a) - (D*a*x - A*b)*sqrt(b*x^2 + a))/(a*b*x)]
 

Sympy [A] (verification not implemented)

Time = 1.40 (sec) , antiderivative size = 114, normalized size of antiderivative = 1.28 \[ \int \frac {A+B x+C x^2+D x^3}{x^2 \sqrt {a+b x^2}} \, dx=- \frac {A \sqrt {b} \sqrt {\frac {a}{b x^{2}} + 1}}{a} - \frac {B \operatorname {asinh}{\left (\frac {\sqrt {a}}{\sqrt {b} x} \right )}}{\sqrt {a}} + C \left (\begin {cases} \frac {\log {\left (2 \sqrt {b} \sqrt {a + b x^{2}} + 2 b x \right )}}{\sqrt {b}} & \text {for}\: a \neq 0 \wedge b \neq 0 \\\frac {x \log {\left (x \right )}}{\sqrt {b x^{2}}} & \text {for}\: b \neq 0 \\\frac {x}{\sqrt {a}} & \text {otherwise} \end {cases}\right ) + D \left (\begin {cases} \frac {\sqrt {a + b x^{2}}}{b} & \text {for}\: b \neq 0 \\\frac {x^{2}}{2 \sqrt {a}} & \text {otherwise} \end {cases}\right ) \] Input:

integrate((D*x**3+C*x**2+B*x+A)/x**2/(b*x**2+a)**(1/2),x)
 

Output:

-A*sqrt(b)*sqrt(a/(b*x**2) + 1)/a - B*asinh(sqrt(a)/(sqrt(b)*x))/sqrt(a) + 
 C*Piecewise((log(2*sqrt(b)*sqrt(a + b*x**2) + 2*b*x)/sqrt(b), Ne(a, 0) & 
Ne(b, 0)), (x*log(x)/sqrt(b*x**2), Ne(b, 0)), (x/sqrt(a), True)) + D*Piece 
wise((sqrt(a + b*x**2)/b, Ne(b, 0)), (x**2/(2*sqrt(a)), True))
 

Maxima [A] (verification not implemented)

Time = 0.03 (sec) , antiderivative size = 65, normalized size of antiderivative = 0.73 \[ \int \frac {A+B x+C x^2+D x^3}{x^2 \sqrt {a+b x^2}} \, dx=\frac {C \operatorname {arsinh}\left (\frac {b x}{\sqrt {a b}}\right )}{\sqrt {b}} - \frac {B \operatorname {arsinh}\left (\frac {a}{\sqrt {a b} {\left | x \right |}}\right )}{\sqrt {a}} + \frac {\sqrt {b x^{2} + a} D}{b} - \frac {\sqrt {b x^{2} + a} A}{a x} \] Input:

integrate((D*x^3+C*x^2+B*x+A)/x^2/(b*x^2+a)^(1/2),x, algorithm="maxima")
 

Output:

C*arcsinh(b*x/sqrt(a*b))/sqrt(b) - B*arcsinh(a/(sqrt(a*b)*abs(x)))/sqrt(a) 
 + sqrt(b*x^2 + a)*D/b - sqrt(b*x^2 + a)*A/(a*x)
 

Giac [A] (verification not implemented)

Time = 0.14 (sec) , antiderivative size = 103, normalized size of antiderivative = 1.16 \[ \int \frac {A+B x+C x^2+D x^3}{x^2 \sqrt {a+b x^2}} \, dx=\frac {2 \, B \arctan \left (-\frac {\sqrt {b} x - \sqrt {b x^{2} + a}}{\sqrt {-a}}\right )}{\sqrt {-a}} - \frac {C \log \left ({\left | -\sqrt {b} x + \sqrt {b x^{2} + a} \right |}\right )}{\sqrt {b}} + \frac {\sqrt {b x^{2} + a} D}{b} + \frac {2 \, A \sqrt {b}}{{\left (\sqrt {b} x - \sqrt {b x^{2} + a}\right )}^{2} - a} \] Input:

integrate((D*x^3+C*x^2+B*x+A)/x^2/(b*x^2+a)^(1/2),x, algorithm="giac")
 

Output:

2*B*arctan(-(sqrt(b)*x - sqrt(b*x^2 + a))/sqrt(-a))/sqrt(-a) - C*log(abs(- 
sqrt(b)*x + sqrt(b*x^2 + a)))/sqrt(b) + sqrt(b*x^2 + a)*D/b + 2*A*sqrt(b)/ 
((sqrt(b)*x - sqrt(b*x^2 + a))^2 - a)
                                                                                    
                                                                                    
 

Mupad [B] (verification not implemented)

Time = 2.56 (sec) , antiderivative size = 103, normalized size of antiderivative = 1.16 \[ \int \frac {A+B x+C x^2+D x^3}{x^2 \sqrt {a+b x^2}} \, dx=\frac {C\,\ln \left (\sqrt {b}\,x+\sqrt {b\,x^2+a}\right )}{\sqrt {b}}-\frac {B\,\mathrm {atanh}\left (\frac {\sqrt {b\,x^2+a}}{\sqrt {a}}\right )}{\sqrt {a}}+\frac {a\,\left (\frac {b\,x^2}{a}+1\right )\,D-a\,\sqrt {\frac {b\,x^2}{a}+1}\,D}{b\,\sqrt {b\,x^2+a}}-\frac {A\,\sqrt {b\,x^2+a}}{a\,x} \] Input:

int((A + B*x + C*x^2 + x^3*D)/(x^2*(a + b*x^2)^(1/2)),x)
 

Output:

(C*log(b^(1/2)*x + (a + b*x^2)^(1/2)))/b^(1/2) - (B*atanh((a + b*x^2)^(1/2 
)/a^(1/2)))/a^(1/2) + (a*((b*x^2)/a + 1)*D - a*((b*x^2)/a + 1)^(1/2)*D)/(b 
*(a + b*x^2)^(1/2)) - (A*(a + b*x^2)^(1/2))/(a*x)
 

Reduce [B] (verification not implemented)

Time = 0.15 (sec) , antiderivative size = 203, normalized size of antiderivative = 2.28 \[ \int \frac {A+B x+C x^2+D x^3}{x^2 \sqrt {a+b x^2}} \, dx=\frac {-2 \sqrt {b \,x^{2}+a}\, a b +2 \sqrt {b \,x^{2}+a}\, a d x +\sqrt {a}\, \mathrm {log}\left (\frac {-\sqrt {a}\, \sqrt {b \,x^{2}+a}+\sqrt {b}\, \sqrt {b \,x^{2}+a}\, x -\sqrt {b}\, \sqrt {a}\, x +a +b \,x^{2}}{\sqrt {a}\, \sqrt {b \,x^{2}+a}+\sqrt {b}\, \sqrt {a}\, x}\right ) b^{2} x -\sqrt {a}\, \mathrm {log}\left (\frac {\sqrt {a}\, \sqrt {b \,x^{2}+a}+\sqrt {b}\, \sqrt {b \,x^{2}+a}\, x +\sqrt {b}\, \sqrt {a}\, x +a +b \,x^{2}}{\sqrt {a}\, \sqrt {b \,x^{2}+a}+\sqrt {b}\, \sqrt {a}\, x}\right ) b^{2} x +2 \sqrt {b}\, \mathrm {log}\left (\frac {\sqrt {b \,x^{2}+a}+\sqrt {b}\, x}{\sqrt {a}}\right ) a c x -2 \sqrt {b}\, a b x}{2 a b x} \] Input:

int((D*x^3+C*x^2+B*x+A)/x^2/(b*x^2+a)^(1/2),x)
 

Output:

( - 2*sqrt(a + b*x**2)*a*b + 2*sqrt(a + b*x**2)*a*d*x + sqrt(a)*log(( - sq 
rt(a)*sqrt(a + b*x**2) + sqrt(b)*sqrt(a + b*x**2)*x - sqrt(b)*sqrt(a)*x + 
a + b*x**2)/(sqrt(a)*sqrt(a + b*x**2) + sqrt(b)*sqrt(a)*x))*b**2*x - sqrt( 
a)*log((sqrt(a)*sqrt(a + b*x**2) + sqrt(b)*sqrt(a + b*x**2)*x + sqrt(b)*sq 
rt(a)*x + a + b*x**2)/(sqrt(a)*sqrt(a + b*x**2) + sqrt(b)*sqrt(a)*x))*b**2 
*x + 2*sqrt(b)*log((sqrt(a + b*x**2) + sqrt(b)*x)/sqrt(a))*a*c*x - 2*sqrt( 
b)*a*b*x)/(2*a*b*x)