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

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

Optimal result

Integrand size = 43, antiderivative size = 64 \[ \int \frac {-b x^2+a x^3}{\left (b x^2+a x^3\right ) \sqrt {b^2 x+a^2 x^3}} \, dx=-\frac {\sqrt {2} \arctan \left (\frac {\sqrt {2} \sqrt {a} \sqrt {b} \sqrt {b^2 x+a^2 x^3}}{b^2+a^2 x^2}\right )}{\sqrt {a} \sqrt {b}} \]

[Out]

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

Rubi [A] (verified)

Time = 0.58 (sec) , antiderivative size = 91, normalized size of antiderivative = 1.42, number of steps used = 6, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.140, Rules used = {1607, 1598, 2081, 6865, 1713, 211} \[ \int \frac {-b x^2+a x^3}{\left (b x^2+a x^3\right ) \sqrt {b^2 x+a^2 x^3}} \, dx=-\frac {\sqrt {2} \sqrt {x} \sqrt {a^2 x^2+b^2} \arctan \left (\frac {\sqrt {2} \sqrt {a} \sqrt {b} \sqrt {x}}{\sqrt {a^2 x^2+b^2}}\right )}{\sqrt {a} \sqrt {b} \sqrt {a^2 x^3+b^2 x}} \]

[In]

Int[(-(b*x^2) + a*x^3)/((b*x^2 + a*x^3)*Sqrt[b^2*x + a^2*x^3]),x]

[Out]

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

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 1598

Int[(u_.)*(x_)^(m_.)*((a_.)*(x_)^(p_.) + (b_.)*(x_)^(q_.))^(n_.), x_Symbol] :> Int[u*x^(m + n*p)*(a + b*x^(q -
 p))^n, x] /; FreeQ[{a, b, m, p, q}, x] && IntegerQ[n] && PosQ[q - p]

Rule 1607

Int[(u_.)*((a_.)*(x_)^(p_.) + (b_.)*(x_)^(q_.))^(n_.), x_Symbol] :> Int[u*x^(n*p)*(a + b*x^(q - p))^n, x] /; F
reeQ[{a, b, p, q}, x] && IntegerQ[n] && PosQ[q - p]

Rule 1713

Int[((A_) + (B_.)*(x_)^2)/(((d_) + (e_.)*(x_)^2)*Sqrt[(a_) + (c_.)*(x_)^4]), x_Symbol] :> Dist[A, Subst[Int[1/
(d + 2*a*e*x^2), x], x, x/Sqrt[a + c*x^4]], x] /; FreeQ[{a, c, d, e, A, B}, x] && NeQ[c*d^2 + a*e^2, 0] && EqQ
[c*d^2 - a*e^2, 0] && EqQ[B*d + A*e, 0]

Rule 2081

Int[(u_.)*(P_)^(p_.), x_Symbol] :> With[{m = MinimumMonomialExponent[P, x]}, Dist[P^FracPart[p]/(x^(m*FracPart
[p])*Distrib[1/x^m, P]^FracPart[p]), Int[u*x^(m*p)*Distrib[1/x^m, P]^p, x], x]] /; FreeQ[p, x] &&  !IntegerQ[p
] && SumQ[P] && EveryQ[BinomialQ[#1, x] & , P] &&  !PolyQ[P, x, 2]

Rule 6865

Int[(u_)*(x_)^(m_), x_Symbol] :> With[{k = Denominator[m]}, Dist[k, Subst[Int[x^(k*(m + 1) - 1)*(u /. x -> x^k
), x], x, x^(1/k)], x]] /; FractionQ[m]

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

Mathematica [A] (verified)

Time = 0.00 (sec) , antiderivative size = 91, normalized size of antiderivative = 1.42 \[ \int \frac {-b x^2+a x^3}{\left (b x^2+a x^3\right ) \sqrt {b^2 x+a^2 x^3}} \, dx=-\frac {\sqrt {2} \sqrt {x} \sqrt {b^2+a^2 x^2} \arctan \left (\frac {\sqrt {2} \sqrt {a} \sqrt {b} \sqrt {x}}{\sqrt {b^2+a^2 x^2}}\right )}{\sqrt {a} \sqrt {b} \sqrt {x \left (b^2+a^2 x^2\right )}} \]

[In]

Integrate[(-(b*x^2) + a*x^3)/((b*x^2 + a*x^3)*Sqrt[b^2*x + a^2*x^3]),x]

[Out]

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

Maple [A] (verified)

Time = 1.17 (sec) , antiderivative size = 39, normalized size of antiderivative = 0.61

method result size
default \(\frac {\sqrt {2}\, \arctan \left (\frac {\sqrt {x \left (a^{2} x^{2}+b^{2}\right )}\, \sqrt {2}}{2 x \sqrt {a b}}\right )}{\sqrt {a b}}\) \(39\)
pseudoelliptic \(\frac {\sqrt {2}\, \arctan \left (\frac {\sqrt {x \left (a^{2} x^{2}+b^{2}\right )}\, \sqrt {2}}{2 x \sqrt {a b}}\right )}{\sqrt {a b}}\) \(39\)
elliptic \(\frac {i b \sqrt {-\frac {i \left (x +\frac {i b}{a}\right ) a}{b}}\, \sqrt {2}\, \sqrt {\frac {i \left (x -\frac {i b}{a}\right ) a}{b}}\, \sqrt {\frac {i a x}{b}}\, \operatorname {EllipticF}\left (\sqrt {-\frac {i \left (x +\frac {i b}{a}\right ) a}{b}}, \frac {\sqrt {2}}{2}\right )}{a \sqrt {a^{2} x^{3}+b^{2} x}}-\frac {2 i b^{2} \sqrt {-\frac {i \left (x +\frac {i b}{a}\right ) a}{b}}\, \sqrt {2}\, \sqrt {\frac {i \left (x -\frac {i b}{a}\right ) a}{b}}\, \sqrt {\frac {i a x}{b}}\, \operatorname {EllipticPi}\left (\sqrt {-\frac {i \left (x +\frac {i b}{a}\right ) a}{b}}, -\frac {i b}{a \left (-\frac {i b}{a}+\frac {b}{a}\right )}, \frac {\sqrt {2}}{2}\right )}{a^{2} \sqrt {a^{2} x^{3}+b^{2} x}\, \left (-\frac {i b}{a}+\frac {b}{a}\right )}\) \(231\)

[In]

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

[Out]

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

Fricas [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 213, normalized size of antiderivative = 3.33 \[ \int \frac {-b x^2+a x^3}{\left (b x^2+a x^3\right ) \sqrt {b^2 x+a^2 x^3}} \, dx=\left [\frac {1}{4} \, \sqrt {2} \sqrt {-\frac {1}{a b}} \log \left (\frac {a^{4} x^{4} - 12 \, a^{3} b x^{3} + 6 \, a^{2} b^{2} x^{2} - 12 \, a b^{3} x + b^{4} + 4 \, \sqrt {2} {\left (a^{3} b x^{2} - 2 \, a^{2} b^{2} x + a b^{3}\right )} \sqrt {a^{2} x^{3} + b^{2} x} \sqrt {-\frac {1}{a b}}}{a^{4} x^{4} + 4 \, a^{3} b x^{3} + 6 \, a^{2} b^{2} x^{2} + 4 \, a b^{3} x + b^{4}}\right ), -\frac {1}{2} \, \sqrt {2} \sqrt {\frac {1}{a b}} \arctan \left (\frac {2 \, \sqrt {2} \sqrt {a^{2} x^{3} + b^{2} x} a b \sqrt {\frac {1}{a b}}}{a^{2} x^{2} - 2 \, a b x + b^{2}}\right )\right ] \]

[In]

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

[Out]

[1/4*sqrt(2)*sqrt(-1/(a*b))*log((a^4*x^4 - 12*a^3*b*x^3 + 6*a^2*b^2*x^2 - 12*a*b^3*x + b^4 + 4*sqrt(2)*(a^3*b*
x^2 - 2*a^2*b^2*x + a*b^3)*sqrt(a^2*x^3 + b^2*x)*sqrt(-1/(a*b)))/(a^4*x^4 + 4*a^3*b*x^3 + 6*a^2*b^2*x^2 + 4*a*
b^3*x + b^4)), -1/2*sqrt(2)*sqrt(1/(a*b))*arctan(2*sqrt(2)*sqrt(a^2*x^3 + b^2*x)*a*b*sqrt(1/(a*b))/(a^2*x^2 -
2*a*b*x + b^2))]

Sympy [F]

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

[In]

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

[Out]

Integral((a*x - b)/(sqrt(x*(a**2*x**2 + b**2))*(a*x + b)), x)

Maxima [F]

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

[In]

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

[Out]

integrate((a*x^3 - b*x^2)/(sqrt(a^2*x^3 + b^2*x)*(a*x^3 + b*x^2)), x)

Giac [F]

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

[In]

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

[Out]

integrate((a*x^3 - b*x^2)/(sqrt(a^2*x^3 + b^2*x)*(a*x^3 + b*x^2)), x)

Mupad [F(-1)]

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

[In]

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

[Out]

\text{Hanged}