3.81 \(\int \frac {a+x}{(-a+x) \sqrt {a^2 x-(1+a^2) x^2+x^3}} \, dx\)

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

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.87, antiderivative size = 87, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 34, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.118, Rules used = {2056, 6733, 1698, 205} \[ -\frac {2 \sqrt {x} \sqrt {-\left (a^2+1\right ) x+a^2+x^2} \tan ^{-1}\left (\frac {(1-a) \sqrt {x}}{\sqrt {-\left (a^2+1\right ) x+a^2+x^2}}\right )}{(1-a) \sqrt {-\left (a^2+1\right ) x^2+a^2 x+x^3}} \]

Antiderivative was successfully verified.

[In]

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

[Out]

(-2*Sqrt[x]*Sqrt[a^2 - (1 + a^2)*x + x^2]*ArcTan[((1 - a)*Sqrt[x])/Sqrt[a^2 - (1 + a^2)*x + x^2]])/((1 - a)*Sq
rt[a^2*x - (1 + a^2)*x^2 + x^3])

Rule 205

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

Rule 1698

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

Rule 2056

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 6733

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*} \int \frac {a+x}{(-a+x) \sqrt {a^2 x-\left (1+a^2\right ) x^2+x^3}} \, dx &=\frac {\left (\sqrt {x} \sqrt {a^2-\left (1+a^2\right ) x+x^2}\right ) \int \frac {a+x}{\sqrt {x} (-a+x) \sqrt {a^2-\left (1+a^2\right ) x+x^2}} \, dx}{\sqrt {a^2 x-\left (1+a^2\right ) x^2+x^3}}\\ &=\frac {\left (2 \sqrt {x} \sqrt {a^2-\left (1+a^2\right ) x+x^2}\right ) \operatorname {Subst}\left (\int \frac {a+x^2}{\left (-a+x^2\right ) \sqrt {a^2+\left (-1-a^2\right ) x^2+x^4}} \, dx,x,\sqrt {x}\right )}{\sqrt {a^2 x-\left (1+a^2\right ) x^2+x^3}}\\ &=\frac {\left (2 a \sqrt {x} \sqrt {a^2-\left (1+a^2\right ) x+x^2}\right ) \operatorname {Subst}\left (\int \frac {1}{-a-\left (-2 a^2-a \left (-1-a^2\right )\right ) x^2} \, dx,x,\frac {\sqrt {x}}{\sqrt {a^2-\left (1+a^2\right ) x+x^2}}\right )}{\sqrt {a^2 x-\left (1+a^2\right ) x^2+x^3}}\\ &=-\frac {2 \sqrt {x} \sqrt {a^2-\left (1+a^2\right ) x+x^2} \tan ^{-1}\left (\frac {(1-a) \sqrt {x}}{\sqrt {a^2-\left (1+a^2\right ) x+x^2}}\right )}{(1-a) \sqrt {a^2 x-\left (1+a^2\right ) x^2+x^3}}\\ \end {align*}

________________________________________________________________________________________

Mathematica [C]  time = 0.93, size = 159, normalized size = 1.83 \[ -\frac {2 i \left (a^2-x\right )^{3/2} \sqrt {\frac {x-1}{x-a^2}} \sqrt {\frac {x}{x-a^2}} \left ((a+1) \operatorname {EllipticF}\left (i \sinh ^{-1}\left (\frac {\sqrt {-a^2}}{\sqrt {a^2-x}}\right ),1-\frac {1}{a^2}\right )-2 \Pi \left (\frac {a-1}{a};i \sinh ^{-1}\left (\frac {\sqrt {-a^2}}{\sqrt {a^2-x}}\right )|1-\frac {1}{a^2}\right )\right )}{(a-1) \sqrt {-a^2} \sqrt {(x-1) x \left (x-a^2\right )}} \]

Antiderivative was successfully verified.

[In]

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

[Out]

((-2*I)*(a^2 - x)^(3/2)*Sqrt[(-1 + x)/(-a^2 + x)]*Sqrt[x/(-a^2 + x)]*((1 + a)*EllipticF[I*ArcSinh[Sqrt[-a^2]/S
qrt[a^2 - x]], 1 - a^(-2)] - 2*EllipticPi[(-1 + a)/a, I*ArcSinh[Sqrt[-a^2]/Sqrt[a^2 - x]], 1 - a^(-2)]))/((-1
+ a)*Sqrt[-a^2]*Sqrt[(-1 + x)*x*(-a^2 + x)])

________________________________________________________________________________________

fricas [A]  time = 0.70, size = 85, normalized size = 0.98 \[ \frac {\arctan \left (\frac {\sqrt {a^{2} x - {\left (a^{2} + 1\right )} x^{2} + x^{3}} {\left (a^{2} - 2 \, {\left (a^{2} - a + 1\right )} x + x^{2}\right )}}{2 \, {\left ({\left (a - 1\right )} x^{3} - {\left (a^{3} - a^{2} + a - 1\right )} x^{2} + {\left (a^{3} - a^{2}\right )} x\right )}}\right )}{a - 1} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

giac [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int -\frac {a + x}{\sqrt {a^{2} x - {\left (a^{2} + 1\right )} x^{2} + x^{3}} {\left (a - x\right )}}\,{d x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maple [C]  time = 0.04, size = 206, normalized size = 2.37 \[ -\frac {4 \sqrt {-\frac {-a^{2}+x}{a^{2}}}\, \sqrt {\frac {x -1}{a^{2}-1}}\, \sqrt {\frac {x}{a^{2}}}\, a^{3} \EllipticPi \left (\sqrt {-\frac {-a^{2}+x}{a^{2}}}, \frac {a^{2}}{a^{2}-a}, \sqrt {\frac {a^{2}}{a^{2}-1}}\right )}{\sqrt {-a^{2} x^{2}+a^{2} x +x^{3}-x^{2}}\, \left (a^{2}-a \right )}-\frac {2 \sqrt {-\frac {-a^{2}+x}{a^{2}}}\, \sqrt {\frac {x -1}{a^{2}-1}}\, \sqrt {\frac {x}{a^{2}}}\, a^{2} \EllipticF \left (\sqrt {-\frac {-a^{2}+x}{a^{2}}}, \sqrt {\frac {a^{2}}{a^{2}-1}}\right )}{\sqrt {-a^{2} x^{2}+a^{2} x +x^{3}-x^{2}}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-2*a^2*(-(-a^2+x)/a^2)^(1/2)*((x-1)/(a^2-1))^(1/2)*(x/a^2)^(1/2)/(-a^2*x^2+a^2*x+x^3-x^2)^(1/2)*EllipticF((-(-
a^2+x)/a^2)^(1/2),(a^2/(a^2-1))^(1/2))-4*a^3*(-(-a^2+x)/a^2)^(1/2)*((x-1)/(a^2-1))^(1/2)*(x/a^2)^(1/2)/(-a^2*x
^2+a^2*x+x^3-x^2)^(1/2)/(a^2-a)*EllipticPi((-(-a^2+x)/a^2)^(1/2),a^2/(a^2-a),(a^2/(a^2-1))^(1/2))

________________________________________________________________________________________

maxima [F]  time = 0.00, size = 0, normalized size = 0.00 \[ -\int \frac {a + x}{\sqrt {a^{2} x - {\left (a^{2} + 1\right )} x^{2} + x^{3}} {\left (a - x\right )}}\,{d x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

mupad [B]  time = 0.17, size = 217, normalized size = 2.49 \[ \frac {4\,a\,\left (a^2-1\right )\,\sqrt {\frac {x}{a^2}}\,\sqrt {\frac {x-1}{a^2-1}}\,\sqrt {-\frac {x-a^2}{a^2-1}}\,\Pi \left (-\frac {a^2-1}{a-a^2};\mathrm {asin}\left (\sqrt {-\frac {x-a^2}{a^2-1}}\right )\middle |\frac {a^2-1}{a^2}\right )}{\left (a-a^2\right )\,\sqrt {a^2\,x-x^2\,\left (a^2+1\right )+x^3}}-\frac {2\,\left (a^2-1\right )\,\mathrm {F}\left (\mathrm {asin}\left (\sqrt {-\frac {x-a^2}{a^2-1}}\right )\middle |\frac {a^2-1}{a^2}\right )\,\sqrt {\frac {x}{a^2}}\,\sqrt {\frac {x-1}{a^2-1}}\,\sqrt {-\frac {x-a^2}{a^2-1}}}{\sqrt {a^2\,x-x^2\,\left (a^2+1\right )+x^3}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

(4*a*(a^2 - 1)*(x/a^2)^(1/2)*((x - 1)/(a^2 - 1))^(1/2)*(-(x - a^2)/(a^2 - 1))^(1/2)*ellipticPi(-(a^2 - 1)/(a -
 a^2), asin((-(x - a^2)/(a^2 - 1))^(1/2)), (a^2 - 1)/a^2))/((a - a^2)*(a^2*x - x^2*(a^2 + 1) + x^3)^(1/2)) - (
2*(a^2 - 1)*ellipticF(asin((-(x - a^2)/(a^2 - 1))^(1/2)), (a^2 - 1)/a^2)*(x/a^2)^(1/2)*((x - 1)/(a^2 - 1))^(1/
2)*(-(x - a^2)/(a^2 - 1))^(1/2))/(a^2*x - x^2*(a^2 + 1) + x^3)^(1/2)

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {a + x}{\sqrt {x \left (- a^{2} + x\right ) \left (x - 1\right )} \left (- a + x\right )}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________