\(\int \frac {(-b+a x^2) \sqrt [4]{-b x^2+a x^4}}{x^2} \, dx\) [1421]

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

Optimal result

Integrand size = 29, antiderivative size = 101 \[ \int \frac {\left (-b+a x^2\right ) \sqrt [4]{-b x^2+a x^4}}{x^2} \, dx=\frac {\left (4 b+a x^2\right ) \sqrt [4]{-b x^2+a x^4}}{2 x}+\frac {5}{4} \sqrt [4]{a} b \arctan \left (\frac {\sqrt [4]{a} x}{\sqrt [4]{-b x^2+a x^4}}\right )-\frac {5}{4} \sqrt [4]{a} b \text {arctanh}\left (\frac {\sqrt [4]{a} x}{\sqrt [4]{-b x^2+a x^4}}\right ) \]

[Out]

1/2*(a*x^2+4*b)*(a*x^4-b*x^2)^(1/4)/x+5/4*a^(1/4)*b*arctan(a^(1/4)*x/(a*x^4-b*x^2)^(1/4))-5/4*a^(1/4)*b*arctan
h(a^(1/4)*x/(a*x^4-b*x^2)^(1/4))

Rubi [A] (verified)

Time = 0.26 (sec) , antiderivative size = 183, normalized size of antiderivative = 1.81, number of steps used = 16, number of rules used = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.310, Rules used = {2077, 2029, 2057, 335, 338, 304, 209, 212, 2045} \[ \int \frac {\left (-b+a x^2\right ) \sqrt [4]{-b x^2+a x^4}}{x^2} \, dx=\frac {5 \sqrt [4]{a} b x^{3/2} \left (a x^2-b\right )^{3/4} \arctan \left (\frac {\sqrt [4]{a} \sqrt {x}}{\sqrt [4]{a x^2-b}}\right )}{4 \left (a x^4-b x^2\right )^{3/4}}-\frac {5 \sqrt [4]{a} b x^{3/2} \left (a x^2-b\right )^{3/4} \text {arctanh}\left (\frac {\sqrt [4]{a} \sqrt {x}}{\sqrt [4]{a x^2-b}}\right )}{4 \left (a x^4-b x^2\right )^{3/4}}+\frac {1}{2} a x \sqrt [4]{a x^4-b x^2}+\frac {2 b \sqrt [4]{a x^4-b x^2}}{x} \]

[In]

Int[((-b + a*x^2)*(-(b*x^2) + a*x^4)^(1/4))/x^2,x]

[Out]

(2*b*(-(b*x^2) + a*x^4)^(1/4))/x + (a*x*(-(b*x^2) + a*x^4)^(1/4))/2 + (5*a^(1/4)*b*x^(3/2)*(-b + a*x^2)^(3/4)*
ArcTan[(a^(1/4)*Sqrt[x])/(-b + a*x^2)^(1/4)])/(4*(-(b*x^2) + a*x^4)^(3/4)) - (5*a^(1/4)*b*x^(3/2)*(-b + a*x^2)
^(3/4)*ArcTanh[(a^(1/4)*Sqrt[x])/(-b + a*x^2)^(1/4)])/(4*(-(b*x^2) + a*x^4)^(3/4))

Rule 209

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

Rule 212

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] && (GtQ[a, 0] || LtQ[b, 0])

Rule 304

Int[(x_)^2/((a_) + (b_.)*(x_)^4), x_Symbol] :> With[{r = Numerator[Rt[-a/b, 2]], s = Denominator[Rt[-a/b, 2]]}
, Dist[s/(2*b), Int[1/(r + s*x^2), x], x] - Dist[s/(2*b), Int[1/(r - s*x^2), x], x]] /; FreeQ[{a, b}, x] &&  !
GtQ[a/b, 0]

Rule 335

Int[((c_.)*(x_))^(m_)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> With[{k = Denominator[m]}, Dist[k/c, Subst[I
nt[x^(k*(m + 1) - 1)*(a + b*(x^(k*n)/c^n))^p, x], x, (c*x)^(1/k)], x]] /; FreeQ[{a, b, c, p}, x] && IGtQ[n, 0]
 && FractionQ[m] && IntBinomialQ[a, b, c, n, m, p, x]

Rule 338

Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Dist[a^(p + (m + 1)/n), Subst[Int[x^m/(1 - b*x^n)^(
p + (m + 1)/n + 1), x], x, x/(a + b*x^n)^(1/n)], x] /; FreeQ[{a, b}, x] && IGtQ[n, 0] && LtQ[-1, p, 0] && NeQ[
p, -2^(-1)] && IntegersQ[m, p + (m + 1)/n]

Rule 2029

Int[((a_.)*(x_)^(j_.) + (b_.)*(x_)^(n_.))^(p_), x_Symbol] :> Simp[x*((a*x^j + b*x^n)^p/(n*p + 1)), x] + Dist[a
*(n - j)*(p/(n*p + 1)), Int[x^j*(a*x^j + b*x^n)^(p - 1), x], x] /; FreeQ[{a, b}, x] &&  !IntegerQ[p] && LtQ[0,
 j, n] && GtQ[p, 0] && NeQ[n*p + 1, 0]

Rule 2045

Int[((c_.)*(x_))^(m_)*((a_.)*(x_)^(j_.) + (b_.)*(x_)^(n_.))^(p_), x_Symbol] :> Simp[(c*x)^(m + 1)*((a*x^j + b*
x^n)^p/(c*(m + j*p + 1))), x] - Dist[b*p*((n - j)/(c^n*(m + j*p + 1))), Int[(c*x)^(m + n)*(a*x^j + b*x^n)^(p -
 1), x], x] /; FreeQ[{a, b, c}, x] &&  !IntegerQ[p] && LtQ[0, j, n] && (IntegersQ[j, n] || GtQ[c, 0]) && GtQ[p
, 0] && LtQ[m + j*p + 1, 0]

Rule 2057

Int[((c_.)*(x_))^(m_.)*((a_.)*(x_)^(j_.) + (b_.)*(x_)^(n_.))^(p_), x_Symbol] :> Dist[c^IntPart[m]*(c*x)^FracPa
rt[m]*((a*x^j + b*x^n)^FracPart[p]/(x^(FracPart[m] + j*FracPart[p])*(a + b*x^(n - j))^FracPart[p])), Int[x^(m
+ j*p)*(a + b*x^(n - j))^p, x], x] /; FreeQ[{a, b, c, j, m, n, p}, x] &&  !IntegerQ[p] && NeQ[n, j] && PosQ[n
- j]

Rule 2077

Int[(Pq_)*((c_.)*(x_))^(m_.)*((a_.)*(x_)^(j_.) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Int[ExpandIntegrand[(c*x)
^m*Pq*(a*x^j + b*x^n)^p, x], x] /; FreeQ[{a, b, c, j, m, n, p}, x] && (PolyQ[Pq, x] || PolyQ[Pq, x^n]) &&  !In
tegerQ[p] && NeQ[n, j]

Rubi steps \begin{align*} \text {integral}& = \int \left (a \sqrt [4]{-b x^2+a x^4}-\frac {b \sqrt [4]{-b x^2+a x^4}}{x^2}\right ) \, dx \\ & = a \int \sqrt [4]{-b x^2+a x^4} \, dx-b \int \frac {\sqrt [4]{-b x^2+a x^4}}{x^2} \, dx \\ & = \frac {2 b \sqrt [4]{-b x^2+a x^4}}{x}+\frac {1}{2} a x \sqrt [4]{-b x^2+a x^4}-\frac {1}{4} (a b) \int \frac {x^2}{\left (-b x^2+a x^4\right )^{3/4}} \, dx-(a b) \int \frac {x^2}{\left (-b x^2+a x^4\right )^{3/4}} \, dx \\ & = \frac {2 b \sqrt [4]{-b x^2+a x^4}}{x}+\frac {1}{2} a x \sqrt [4]{-b x^2+a x^4}-\frac {\left (a b x^{3/2} \left (-b+a x^2\right )^{3/4}\right ) \int \frac {\sqrt {x}}{\left (-b+a x^2\right )^{3/4}} \, dx}{4 \left (-b x^2+a x^4\right )^{3/4}}-\frac {\left (a b x^{3/2} \left (-b+a x^2\right )^{3/4}\right ) \int \frac {\sqrt {x}}{\left (-b+a x^2\right )^{3/4}} \, dx}{\left (-b x^2+a x^4\right )^{3/4}} \\ & = \frac {2 b \sqrt [4]{-b x^2+a x^4}}{x}+\frac {1}{2} a x \sqrt [4]{-b x^2+a x^4}-\frac {\left (a b x^{3/2} \left (-b+a x^2\right )^{3/4}\right ) \text {Subst}\left (\int \frac {x^2}{\left (-b+a x^4\right )^{3/4}} \, dx,x,\sqrt {x}\right )}{2 \left (-b x^2+a x^4\right )^{3/4}}-\frac {\left (2 a b x^{3/2} \left (-b+a x^2\right )^{3/4}\right ) \text {Subst}\left (\int \frac {x^2}{\left (-b+a x^4\right )^{3/4}} \, dx,x,\sqrt {x}\right )}{\left (-b x^2+a x^4\right )^{3/4}} \\ & = \frac {2 b \sqrt [4]{-b x^2+a x^4}}{x}+\frac {1}{2} a x \sqrt [4]{-b x^2+a x^4}-\frac {\left (a b x^{3/2} \left (-b+a x^2\right )^{3/4}\right ) \text {Subst}\left (\int \frac {x^2}{1-a x^4} \, dx,x,\frac {\sqrt {x}}{\sqrt [4]{-b+a x^2}}\right )}{2 \left (-b x^2+a x^4\right )^{3/4}}-\frac {\left (2 a b x^{3/2} \left (-b+a x^2\right )^{3/4}\right ) \text {Subst}\left (\int \frac {x^2}{1-a x^4} \, dx,x,\frac {\sqrt {x}}{\sqrt [4]{-b+a x^2}}\right )}{\left (-b x^2+a x^4\right )^{3/4}} \\ & = \frac {2 b \sqrt [4]{-b x^2+a x^4}}{x}+\frac {1}{2} a x \sqrt [4]{-b x^2+a x^4}-\frac {\left (\sqrt {a} b x^{3/2} \left (-b+a x^2\right )^{3/4}\right ) \text {Subst}\left (\int \frac {1}{1-\sqrt {a} x^2} \, dx,x,\frac {\sqrt {x}}{\sqrt [4]{-b+a x^2}}\right )}{4 \left (-b x^2+a x^4\right )^{3/4}}+\frac {\left (\sqrt {a} b x^{3/2} \left (-b+a x^2\right )^{3/4}\right ) \text {Subst}\left (\int \frac {1}{1+\sqrt {a} x^2} \, dx,x,\frac {\sqrt {x}}{\sqrt [4]{-b+a x^2}}\right )}{4 \left (-b x^2+a x^4\right )^{3/4}}-\frac {\left (\sqrt {a} b x^{3/2} \left (-b+a x^2\right )^{3/4}\right ) \text {Subst}\left (\int \frac {1}{1-\sqrt {a} x^2} \, dx,x,\frac {\sqrt {x}}{\sqrt [4]{-b+a x^2}}\right )}{\left (-b x^2+a x^4\right )^{3/4}}+\frac {\left (\sqrt {a} b x^{3/2} \left (-b+a x^2\right )^{3/4}\right ) \text {Subst}\left (\int \frac {1}{1+\sqrt {a} x^2} \, dx,x,\frac {\sqrt {x}}{\sqrt [4]{-b+a x^2}}\right )}{\left (-b x^2+a x^4\right )^{3/4}} \\ & = \frac {2 b \sqrt [4]{-b x^2+a x^4}}{x}+\frac {1}{2} a x \sqrt [4]{-b x^2+a x^4}+\frac {5 \sqrt [4]{a} b x^{3/2} \left (-b+a x^2\right )^{3/4} \arctan \left (\frac {\sqrt [4]{a} \sqrt {x}}{\sqrt [4]{-b+a x^2}}\right )}{4 \left (-b x^2+a x^4\right )^{3/4}}-\frac {5 \sqrt [4]{a} b x^{3/2} \left (-b+a x^2\right )^{3/4} \text {arctanh}\left (\frac {\sqrt [4]{a} \sqrt {x}}{\sqrt [4]{-b+a x^2}}\right )}{4 \left (-b x^2+a x^4\right )^{3/4}} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.40 (sec) , antiderivative size = 137, normalized size of antiderivative = 1.36 \[ \int \frac {\left (-b+a x^2\right ) \sqrt [4]{-b x^2+a x^4}}{x^2} \, dx=\frac {\sqrt [4]{-b x^2+a x^4} \left (2 \sqrt [4]{-b+a x^2} \left (4 b+a x^2\right )+5 \sqrt [4]{a} b \sqrt {x} \arctan \left (\frac {\sqrt [4]{a} \sqrt {x}}{\sqrt [4]{-b+a x^2}}\right )-5 \sqrt [4]{a} b \sqrt {x} \text {arctanh}\left (\frac {\sqrt [4]{a} \sqrt {x}}{\sqrt [4]{-b+a x^2}}\right )\right )}{4 x \sqrt [4]{-b+a x^2}} \]

[In]

Integrate[((-b + a*x^2)*(-(b*x^2) + a*x^4)^(1/4))/x^2,x]

[Out]

((-(b*x^2) + a*x^4)^(1/4)*(2*(-b + a*x^2)^(1/4)*(4*b + a*x^2) + 5*a^(1/4)*b*Sqrt[x]*ArcTan[(a^(1/4)*Sqrt[x])/(
-b + a*x^2)^(1/4)] - 5*a^(1/4)*b*Sqrt[x]*ArcTanh[(a^(1/4)*Sqrt[x])/(-b + a*x^2)^(1/4)]))/(4*x*(-b + a*x^2)^(1/
4))

Maple [A] (verified)

Time = 0.36 (sec) , antiderivative size = 117, normalized size of antiderivative = 1.16

method result size
pseudoelliptic \(\frac {-5 b x \left (\ln \left (\frac {-a^{\frac {1}{4}} x -\left (x^{2} \left (a \,x^{2}-b \right )\right )^{\frac {1}{4}}}{a^{\frac {1}{4}} x -\left (x^{2} \left (a \,x^{2}-b \right )\right )^{\frac {1}{4}}}\right )+2 \arctan \left (\frac {\left (x^{2} \left (a \,x^{2}-b \right )\right )^{\frac {1}{4}}}{a^{\frac {1}{4}} x}\right )\right ) a^{\frac {1}{4}}+4 \left (x^{2} \left (a \,x^{2}-b \right )\right )^{\frac {1}{4}} \left (a \,x^{2}+4 b \right )}{8 x}\) \(117\)

[In]

int((a*x^2-b)*(a*x^4-b*x^2)^(1/4)/x^2,x,method=_RETURNVERBOSE)

[Out]

1/8*(-5*b*x*(ln((-a^(1/4)*x-(x^2*(a*x^2-b))^(1/4))/(a^(1/4)*x-(x^2*(a*x^2-b))^(1/4)))+2*arctan(1/a^(1/4)/x*(x^
2*(a*x^2-b))^(1/4)))*a^(1/4)+4*(x^2*(a*x^2-b))^(1/4)*(a*x^2+4*b))/x

Fricas [F(-1)]

Timed out. \[ \int \frac {\left (-b+a x^2\right ) \sqrt [4]{-b x^2+a x^4}}{x^2} \, dx=\text {Timed out} \]

[In]

integrate((a*x^2-b)*(a*x^4-b*x^2)^(1/4)/x^2,x, algorithm="fricas")

[Out]

Timed out

Sympy [F]

\[ \int \frac {\left (-b+a x^2\right ) \sqrt [4]{-b x^2+a x^4}}{x^2} \, dx=\int \frac {\sqrt [4]{x^{2} \left (a x^{2} - b\right )} \left (a x^{2} - b\right )}{x^{2}}\, dx \]

[In]

integrate((a*x**2-b)*(a*x**4-b*x**2)**(1/4)/x**2,x)

[Out]

Integral((x**2*(a*x**2 - b))**(1/4)*(a*x**2 - b)/x**2, x)

Maxima [F]

\[ \int \frac {\left (-b+a x^2\right ) \sqrt [4]{-b x^2+a x^4}}{x^2} \, dx=\int { \frac {{\left (a x^{4} - b x^{2}\right )}^{\frac {1}{4}} {\left (a x^{2} - b\right )}}{x^{2}} \,d x } \]

[In]

integrate((a*x^2-b)*(a*x^4-b*x^2)^(1/4)/x^2,x, algorithm="maxima")

[Out]

integrate((a*x^4 - b*x^2)^(1/4)*(a*x^2 - b)/x^2, x)

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 229 vs. \(2 (81) = 162\).

Time = 0.29 (sec) , antiderivative size = 229, normalized size of antiderivative = 2.27 \[ \int \frac {\left (-b+a x^2\right ) \sqrt [4]{-b x^2+a x^4}}{x^2} \, dx=\frac {8 \, {\left (a - \frac {b}{x^{2}}\right )}^{\frac {1}{4}} a b x^{2} - 10 \, \sqrt {2} \left (-a\right )^{\frac {1}{4}} b^{2} \arctan \left (\frac {\sqrt {2} {\left (\sqrt {2} \left (-a\right )^{\frac {1}{4}} + 2 \, {\left (a - \frac {b}{x^{2}}\right )}^{\frac {1}{4}}\right )}}{2 \, \left (-a\right )^{\frac {1}{4}}}\right ) - 10 \, \sqrt {2} \left (-a\right )^{\frac {1}{4}} b^{2} \arctan \left (-\frac {\sqrt {2} {\left (\sqrt {2} \left (-a\right )^{\frac {1}{4}} - 2 \, {\left (a - \frac {b}{x^{2}}\right )}^{\frac {1}{4}}\right )}}{2 \, \left (-a\right )^{\frac {1}{4}}}\right ) - 5 \, \sqrt {2} \left (-a\right )^{\frac {1}{4}} b^{2} \log \left (\sqrt {2} \left (-a\right )^{\frac {1}{4}} {\left (a - \frac {b}{x^{2}}\right )}^{\frac {1}{4}} + \sqrt {-a} + \sqrt {a - \frac {b}{x^{2}}}\right ) + 5 \, \sqrt {2} \left (-a\right )^{\frac {1}{4}} b^{2} \log \left (-\sqrt {2} \left (-a\right )^{\frac {1}{4}} {\left (a - \frac {b}{x^{2}}\right )}^{\frac {1}{4}} + \sqrt {-a} + \sqrt {a - \frac {b}{x^{2}}}\right ) + 32 \, {\left (a - \frac {b}{x^{2}}\right )}^{\frac {1}{4}} b^{2}}{16 \, b} \]

[In]

integrate((a*x^2-b)*(a*x^4-b*x^2)^(1/4)/x^2,x, algorithm="giac")

[Out]

1/16*(8*(a - b/x^2)^(1/4)*a*b*x^2 - 10*sqrt(2)*(-a)^(1/4)*b^2*arctan(1/2*sqrt(2)*(sqrt(2)*(-a)^(1/4) + 2*(a -
b/x^2)^(1/4))/(-a)^(1/4)) - 10*sqrt(2)*(-a)^(1/4)*b^2*arctan(-1/2*sqrt(2)*(sqrt(2)*(-a)^(1/4) - 2*(a - b/x^2)^
(1/4))/(-a)^(1/4)) - 5*sqrt(2)*(-a)^(1/4)*b^2*log(sqrt(2)*(-a)^(1/4)*(a - b/x^2)^(1/4) + sqrt(-a) + sqrt(a - b
/x^2)) + 5*sqrt(2)*(-a)^(1/4)*b^2*log(-sqrt(2)*(-a)^(1/4)*(a - b/x^2)^(1/4) + sqrt(-a) + sqrt(a - b/x^2)) + 32
*(a - b/x^2)^(1/4)*b^2)/b

Mupad [B] (verification not implemented)

Time = 6.97 (sec) , antiderivative size = 91, normalized size of antiderivative = 0.90 \[ \int \frac {\left (-b+a x^2\right ) \sqrt [4]{-b x^2+a x^4}}{x^2} \, dx=\frac {2\,a\,x\,{\left (a\,x^4-b\,x^2\right )}^{1/4}\,{{}}_2{\mathrm {F}}_1\left (-\frac {1}{4},\frac {3}{4};\ \frac {7}{4};\ \frac {a\,x^2}{b}\right )}{3\,{\left (1-\frac {a\,x^2}{b}\right )}^{1/4}}+\frac {2\,b\,{\left (a\,x^4-b\,x^2\right )}^{1/4}\,{{}}_2{\mathrm {F}}_1\left (-\frac {1}{4},-\frac {1}{4};\ \frac {3}{4};\ \frac {a\,x^2}{b}\right )}{x\,{\left (1-\frac {a\,x^2}{b}\right )}^{1/4}} \]

[In]

int(-((b - a*x^2)*(a*x^4 - b*x^2)^(1/4))/x^2,x)

[Out]

(2*a*x*(a*x^4 - b*x^2)^(1/4)*hypergeom([-1/4, 3/4], 7/4, (a*x^2)/b))/(3*(1 - (a*x^2)/b)^(1/4)) + (2*b*(a*x^4 -
 b*x^2)^(1/4)*hypergeom([-1/4, -1/4], 3/4, (a*x^2)/b))/(x*(1 - (a*x^2)/b)^(1/4))