Optimal. Leaf size=187 \[ \frac {\text {ArcTan}\left (\frac {\left (-1-2 \sqrt {k}-k\right ) x}{-1+k x^2+\sqrt {1+\left (-1-k^2\right ) x^2+k^2 x^4}}\right )}{1+k}+\frac {\text {ArcTan}\left (\frac {\left (-1+2 \sqrt {k}-k\right ) x}{-1+k x^2+\sqrt {1+\left (-1-k^2\right ) x^2+k^2 x^4}}\right )}{1+k}+\frac {i \tanh ^{-1}\left (\frac {\left (2 \sqrt {k}+2 k^{3/2}\right ) x^2}{1+2 k x^2+k^2 x^4+\left (-1+k x^2\right ) \sqrt {1+\left (-1-k^2\right ) x^2+k^2 x^4}}\right )}{1+k} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.22, antiderivative size = 92, normalized size of antiderivative = 0.49, number of steps
used = 8, number of rules used = 8, integrand size = 47, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.170, Rules used = {1976, 1755, 12,
1261, 738, 212, 1712, 210} \begin {gather*} -\frac {\text {ArcTan}\left (\frac {(k+1) x}{\sqrt {k^2 x^4+\left (-k^2-1\right ) x^2+1}}\right )}{k+1}+\frac {i \tanh ^{-1}\left (\frac {-k (k+1) x^2+k+1}{2 \sqrt {k} \sqrt {k^2 x^4-\left (k^2+1\right ) x^2+1}}\right )}{k+1} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 210
Rule 212
Rule 738
Rule 1261
Rule 1712
Rule 1755
Rule 1976
Rubi steps
\begin {align*} \int \frac {-i+\sqrt {k} x}{\left (i+\sqrt {k} x\right ) \sqrt {\left (1-x^2\right ) \left (1-k^2 x^2\right )}} \, dx &=\frac {\left (\sqrt {1-x^2} \sqrt {1-k^2 x^2}\right ) \int \frac {-i+\sqrt {k} x}{\left (i+\sqrt {k} x\right ) \sqrt {1-x^2} \sqrt {1-k^2 x^2}} \, dx}{\sqrt {\left (1-x^2\right ) \left (1-k^2 x^2\right )}}\\ &=\frac {\left (\sqrt {1-x^2} \sqrt {1-k^2 x^2}\right ) \int \left (\frac {1}{\sqrt {1-x^2} \sqrt {1-k^2 x^2}}-\frac {2 i}{\left (i+\sqrt {k} x\right ) \sqrt {1-x^2} \sqrt {1-k^2 x^2}}\right ) \, dx}{\sqrt {\left (1-x^2\right ) \left (1-k^2 x^2\right )}}\\ &=-\frac {\left (2 i \sqrt {1-x^2} \sqrt {1-k^2 x^2}\right ) \int \frac {1}{\left (i+\sqrt {k} x\right ) \sqrt {1-x^2} \sqrt {1-k^2 x^2}} \, dx}{\sqrt {\left (1-x^2\right ) \left (1-k^2 x^2\right )}}+\frac {\left (\sqrt {1-x^2} \sqrt {1-k^2 x^2}\right ) \int \frac {1}{\sqrt {1-x^2} \sqrt {1-k^2 x^2}} \, dx}{\sqrt {\left (1-x^2\right ) \left (1-k^2 x^2\right )}}\\ &=\frac {\sqrt {1-x^2} \sqrt {1-k^2 x^2} F\left (\sin ^{-1}(x)|k^2\right )}{\sqrt {\left (1-x^2\right ) \left (1-k^2 x^2\right )}}+\frac {\left (2 \sqrt {1-x^2} \sqrt {1-k^2 x^2}\right ) \int \frac {1}{\sqrt {1-x^2} \left (-1-k x^2\right ) \sqrt {1-k^2 x^2}} \, dx}{\sqrt {\left (1-x^2\right ) \left (1-k^2 x^2\right )}}+\frac {\left (2 i \sqrt {k} \sqrt {1-x^2} \sqrt {1-k^2 x^2}\right ) \int \frac {x}{\sqrt {1-x^2} \left (-1-k x^2\right ) \sqrt {1-k^2 x^2}} \, dx}{\sqrt {\left (1-x^2\right ) \left (1-k^2 x^2\right )}}\\ &=\frac {\sqrt {1-x^2} \sqrt {1-k^2 x^2} F\left (\sin ^{-1}(x)|k^2\right )}{\sqrt {\left (1-x^2\right ) \left (1-k^2 x^2\right )}}-\frac {2 \sqrt {1-x^2} \sqrt {1-k^2 x^2} \Pi \left (-k;\sin ^{-1}(x)|k^2\right )}{\sqrt {\left (1-x^2\right ) \left (1-k^2 x^2\right )}}+\frac {\left (i \sqrt {k} \sqrt {1-x^2} \sqrt {1-k^2 x^2}\right ) \text {Subst}\left (\int \frac {1}{\sqrt {1-x} (-1-k x) \sqrt {1-k^2 x}} \, dx,x,x^2\right )}{\sqrt {\left (1-x^2\right ) \left (1-k^2 x^2\right )}}\\ &=\frac {\sqrt {1-x^2} \sqrt {1-k^2 x^2} F\left (\sin ^{-1}(x)|k^2\right )}{\sqrt {\left (1-x^2\right ) \left (1-k^2 x^2\right )}}-\frac {2 \sqrt {1-x^2} \sqrt {1-k^2 x^2} \Pi \left (-k;\sin ^{-1}(x)|k^2\right )}{\sqrt {\left (1-x^2\right ) \left (1-k^2 x^2\right )}}+\frac {\left (2 i \sqrt {k} \sqrt {1-x^2} \sqrt {1-k^2 x^2}\right ) \text {Subst}\left (\int \frac {1}{1+k-\left (k+k^2\right ) x^2} \, dx,x,\frac {\sqrt {1-x^2}}{\sqrt {1-k^2 x^2}}\right )}{\sqrt {\left (1-x^2\right ) \left (1-k^2 x^2\right )}}\\ &=\frac {2 i \sqrt {1-x^2} \sqrt {1-k^2 x^2} \tanh ^{-1}\left (\frac {\sqrt {k} \sqrt {1-x^2}}{\sqrt {1-k^2 x^2}}\right )}{(1+k) \sqrt {\left (1-x^2\right ) \left (1-k^2 x^2\right )}}+\frac {\sqrt {1-x^2} \sqrt {1-k^2 x^2} F\left (\sin ^{-1}(x)|k^2\right )}{\sqrt {\left (1-x^2\right ) \left (1-k^2 x^2\right )}}-\frac {2 \sqrt {1-x^2} \sqrt {1-k^2 x^2} \Pi \left (-k;\sin ^{-1}(x)|k^2\right )}{\sqrt {\left (1-x^2\right ) \left (1-k^2 x^2\right )}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] Result contains higher order function than in optimal. Order 4 vs. order 3 in
optimal.
time = 3.00, size = 155, normalized size = 0.83 \begin {gather*} \frac {-2 i \sqrt {-1+x^2} \sqrt {-1+k^2 x^2} \tanh ^{-1}\left (\frac {\sqrt {-1+k^2 x^2}}{\sqrt {k} \sqrt {-1+x^2}}\right )+(1+k) \sqrt {1-x^2} \sqrt {1-k^2 x^2} F\left (\text {ArcSin}(x)\left |k^2\right .\right )-2 (1+k) \sqrt {1-x^2} \sqrt {1-k^2 x^2} \Pi \left (-k;\text {ArcSin}(x)\left |k^2\right .\right )}{(1+k) \sqrt {\left (-1+x^2\right ) \left (-1+k^2 x^2\right )}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [C] Result contains higher order function than in optimal. Order 4 vs. order
3.
time = 0.27, size = 295, normalized size = 1.58
method | result | size |
elliptic | \(-\frac {\left (-\sqrt {k}\, x +i\right ) \left (k \,x^{2}+1\right ) \sqrt {\left (x^{2}-1\right ) \left (k^{2} x^{2}-1\right ) k}\, \left (\frac {i \ln \left (\frac {2 k^{2}+4 k +2+\left (-k^{3}-2 k^{2}-k \right ) \left (x^{2}+\frac {1}{k}\right )+2 \sqrt {\left (1+k \right )^{2}}\, \sqrt {k^{3} \left (x^{2}+\frac {1}{k}\right )^{2}+\left (-k^{3}-2 k^{2}-k \right ) \left (x^{2}+\frac {1}{k}\right )+k^{2}+2 k +1}}{x^{2}+\frac {1}{k}}\right )}{\sqrt {\left (1+k \right )^{2}}}+\frac {\arctan \left (\frac {\sqrt {\left (-x^{2}+1\right ) \left (-k^{2} x^{2}+1\right )}}{x \left (1+k \right )}\right )}{1+k}\right )}{\left (i+\sqrt {k}\, x \right ) \left (\sqrt {\left (x^{2}-1\right ) \left (k^{2} x^{2}-1\right ) k}\, k \,x^{2}-2 i x k \sqrt {\left (x^{2}-1\right ) \left (k^{2} x^{2}-1\right )}-\sqrt {\left (x^{2}-1\right ) \left (k^{2} x^{2}-1\right ) k}\right )}\) | \(259\) |
default | \(\frac {\sqrt {-x^{2}+1}\, \sqrt {-k^{2} x^{2}+1}\, \EllipticF \left (x , k\right )}{\sqrt {k^{2} x^{4}-k^{2} x^{2}-x^{2}+1}}+\frac {2 i \left (k \,x^{2}+1\right ) \sqrt {\left (x^{2}-1\right ) \left (k^{2} x^{2}-1\right ) k}\, \left (-\frac {i \sqrt {-x^{2}+1}\, \sqrt {-k^{2} x^{2}+1}\, \EllipticPi \left (x , -k , k\right )}{\sqrt {k^{2} x^{4}-k^{2} x^{2}-x^{2}+1}}-\frac {\ln \left (\frac {2 k^{2}+4 k +2+\left (-k^{3}-2 k^{2}-k \right ) \left (x^{2}+\frac {1}{k}\right )+2 \sqrt {\left (1+k \right )^{2}}\, \sqrt {k^{3} \left (x^{2}+\frac {1}{k}\right )^{2}+\left (-k^{3}-2 k^{2}-k \right ) \left (x^{2}+\frac {1}{k}\right )+k^{2}+2 k +1}}{x^{2}+\frac {1}{k}}\right )}{2 \sqrt {\left (1+k \right )^{2}}}\right )}{\left (i+\sqrt {k}\, x \right ) \left (-k x \sqrt {\left (x^{2}-1\right ) \left (k^{2} x^{2}-1\right )}+i \sqrt {\left (x^{2}-1\right ) \left (k^{2} x^{2}-1\right ) k}\right )}\) | \(295\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.68, size = 250, normalized size = 1.34 \begin {gather*} \frac {i \, \log \left (\frac {{\left (-i \, k^{6} - 5 i \, k^{5} - 10 i \, k^{4} - 10 i \, k^{3} - 5 i \, k^{2} - i \, k\right )} x^{3} + {\left (i \, k^{5} + 5 i \, k^{4} + 10 i \, k^{3} + 10 i \, k^{2} + 5 i \, k + i\right )} x + \sqrt {k^{2} x^{4} - {\left (k^{2} + 1\right )} x^{2} + 1} {\left (k^{4} + 4 \, k^{3} - {\left (k^{5} + 4 \, k^{4} + 6 \, k^{3} + 4 \, k^{2} + k\right )} x^{2} - 2 \, {\left (-i \, k^{4} - 4 i \, k^{3} - 6 i \, k^{2} - 4 i \, k - i\right )} \sqrt {k} x + 6 \, k^{2} + 4 \, k + 1\right )} + 2 \, {\left ({\left (k^{5} + 3 \, k^{4} + 3 \, k^{3} + k^{2}\right )} x^{4} + k^{3} - {\left (k^{5} + 3 \, k^{4} + 4 \, k^{3} + 4 \, k^{2} + 3 \, k + 1\right )} x^{2} + 3 \, k^{2} + 3 \, k + 1\right )} \sqrt {k}}{4 \, {\left (k^{5} x^{4} + 2 \, k^{4} x^{2} + k^{3}\right )}}\right )}{k + 1} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\sqrt {k} x - i}{\sqrt {\left (x - 1\right ) \left (x + 1\right ) \left (k x - 1\right ) \left (k x + 1\right )} \left (\sqrt {k} x + i\right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {\sqrt {k}\,x-\mathrm {i}}{\left (\sqrt {k}\,x+1{}\mathrm {i}\right )\,\sqrt {\left (x^2-1\right )\,\left (k^2\,x^2-1\right )}} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________