Optimal. Leaf size=100 \[ \frac {2 \sqrt {-c^2 k^2+k^2+2 k+1} \tan ^{-1}\left (\frac {x \sqrt {-c^2 k^2+k^2+2 k+1}}{c k x+\sqrt {k^2 x^4+\left (-k^2-1\right ) x^2+1}+k x^2+1}\right )}{(c k-k-1) (c k+k+1)} \]
________________________________________________________________________________________
Rubi [C] time = 5.12, antiderivative size = 691, normalized size of antiderivative = 6.91, number of steps used = 16, number of rules used = 8, integrand size = 43, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.186, Rules used = {6719, 6728, 419, 2113, 537, 571, 93, 208} \begin {gather*} -\frac {\sqrt {1-x^2} \sqrt {1-k^2 x^2} \Pi \left (\frac {4 k}{\left (c \sqrt {k}-\sqrt {c^2 k-4}\right )^2};\sin ^{-1}(x)|k^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} \Pi \left (\frac {4 k}{\left (\sqrt {k} c+\sqrt {c^2 k-4}\right )^2};\sin ^{-1}(x)|k^2\right )}{\sqrt {\left (1-x^2\right ) \left (1-k^2 x^2\right )}}+\frac {\sqrt {1-x^2} \left (\sqrt {c^2 k-4}+c \sqrt {k}\right ) \sqrt {1-k^2 x^2} \tanh ^{-1}\left (\frac {\sqrt {k} \sqrt {1-x^2} \sqrt {-c k^{3/2} \sqrt {c^2 k-4}-c^2 k^2+2 k+2}}{\sqrt {c \left (-\sqrt {k}\right ) \sqrt {c^2 k-4}+\left (2-c^2\right ) k+2} \sqrt {1-k^2 x^2}}\right )}{\sqrt {c \left (-\sqrt {k}\right ) \sqrt {c^2 k-4}+\left (2-c^2\right ) k+2} \sqrt {-c k^{3/2} \sqrt {c^2 k-4}-c^2 k^2+2 k+2} \sqrt {\left (1-x^2\right ) \left (1-k^2 x^2\right )}}+\frac {\sqrt {1-x^2} \left (c \sqrt {k}-\sqrt {c^2 k-4}\right ) \sqrt {1-k^2 x^2} \tanh ^{-1}\left (\frac {\sqrt {k} \sqrt {1-x^2} \sqrt {c k^{3/2} \sqrt {c^2 k-4}-c^2 k^2+2 k+2}}{\sqrt {c \sqrt {k} \sqrt {c^2 k-4}+\left (2-c^2\right ) k+2} \sqrt {1-k^2 x^2}}\right )}{\sqrt {c \sqrt {k} \sqrt {c^2 k-4}+\left (2-c^2\right ) k+2} \sqrt {c k^{3/2} \sqrt {c^2 k-4}-c^2 k^2+2 k+2} \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 )}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 93
Rule 208
Rule 419
Rule 537
Rule 571
Rule 2113
Rule 6719
Rule 6728
Rubi steps
\begin {align*} \int \frac {-1+k x^2}{\left (1+c k x+k x^2\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 {-1+k x^2}{\sqrt {1-x^2} \left (1+c k x+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 (\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+c k x}{\sqrt {1-x^2} \left (1+c k x+k x^2\right ) \sqrt {1-k^2 x^2}}\right ) \, 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 {\left (\sqrt {1-x^2} \sqrt {1-k^2 x^2}\right ) \int \frac {2+c k x}{\sqrt {1-x^2} \left (1+c k x+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 {\left (\sqrt {1-x^2} \sqrt {1-k^2 x^2}\right ) \int \left (\frac {c k-\sqrt {k} \sqrt {-4+c^2 k}}{\left (c k-\sqrt {k} \sqrt {-4+c^2 k}+2 k x\right ) \sqrt {1-x^2} \sqrt {1-k^2 x^2}}+\frac {c k+\sqrt {k} \sqrt {-4+c^2 k}}{\left (c k+\sqrt {k} \sqrt {-4+c^2 k}+2 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 {\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 (\sqrt {k} \left (c \sqrt {k}-\sqrt {-4+c^2 k}\right ) \sqrt {1-x^2} \sqrt {1-k^2 x^2}\right ) \int \frac {1}{\left (c k-\sqrt {k} \sqrt {-4+c^2 k}+2 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 {k} \left (c \sqrt {k}+\sqrt {-4+c^2 k}\right ) \sqrt {1-x^2} \sqrt {1-k^2 x^2}\right ) \int \frac {1}{\left (c k+\sqrt {k} \sqrt {-4+c^2 k}+2 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 {\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 k^{3/2} \left (c \sqrt {k}-\sqrt {-4+c^2 k}\right ) \sqrt {1-x^2} \sqrt {1-k^2 x^2}\right ) \int \frac {x}{\sqrt {1-x^2} \left (\left (c k-\sqrt {k} \sqrt {-4+c^2 k}\right )^2-4 k^2 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 (k \left (c \sqrt {k}-\sqrt {-4+c^2 k}\right )^2 \sqrt {1-x^2} \sqrt {1-k^2 x^2}\right ) \int \frac {1}{\sqrt {1-x^2} \left (\left (c k-\sqrt {k} \sqrt {-4+c^2 k}\right )^2-4 k^2 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 k^{3/2} \left (c \sqrt {k}+\sqrt {-4+c^2 k}\right ) \sqrt {1-x^2} \sqrt {1-k^2 x^2}\right ) \int \frac {x}{\sqrt {1-x^2} \left (\left (c k+\sqrt {k} \sqrt {-4+c^2 k}\right )^2-4 k^2 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 (k \left (c \sqrt {k}+\sqrt {-4+c^2 k}\right )^2 \sqrt {1-x^2} \sqrt {1-k^2 x^2}\right ) \int \frac {1}{\sqrt {1-x^2} \left (\left (c k+\sqrt {k} \sqrt {-4+c^2 k}\right )^2-4 k^2 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 {\sqrt {1-x^2} \sqrt {1-k^2 x^2} \Pi \left (\frac {4 k}{\left (c \sqrt {k}-\sqrt {-4+c^2 k}\right )^2};\sin ^{-1}(x)|k^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} \Pi \left (\frac {4 k}{\left (c \sqrt {k}+\sqrt {-4+c^2 k}\right )^2};\sin ^{-1}(x)|k^2\right )}{\sqrt {\left (1-x^2\right ) \left (1-k^2 x^2\right )}}+\frac {\left (k^{3/2} \left (c \sqrt {k}-\sqrt {-4+c^2 k}\right ) \sqrt {1-x^2} \sqrt {1-k^2 x^2}\right ) \operatorname {Subst}\left (\int \frac {1}{\sqrt {1-x} \left (\left (c k-\sqrt {k} \sqrt {-4+c^2 k}\right )^2-4 k^2 x\right ) \sqrt {1-k^2 x}} \, dx,x,x^2\right )}{\sqrt {\left (1-x^2\right ) \left (1-k^2 x^2\right )}}+\frac {\left (k^{3/2} \left (c \sqrt {k}+\sqrt {-4+c^2 k}\right ) \sqrt {1-x^2} \sqrt {1-k^2 x^2}\right ) \operatorname {Subst}\left (\int \frac {1}{\sqrt {1-x} \left (\left (c k+\sqrt {k} \sqrt {-4+c^2 k}\right )^2-4 k^2 x\right ) \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 {\sqrt {1-x^2} \sqrt {1-k^2 x^2} \Pi \left (\frac {4 k}{\left (c \sqrt {k}-\sqrt {-4+c^2 k}\right )^2};\sin ^{-1}(x)|k^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} \Pi \left (\frac {4 k}{\left (c \sqrt {k}+\sqrt {-4+c^2 k}\right )^2};\sin ^{-1}(x)|k^2\right )}{\sqrt {\left (1-x^2\right ) \left (1-k^2 x^2\right )}}+\frac {\left (2 k^{3/2} \left (c \sqrt {k}-\sqrt {-4+c^2 k}\right ) \sqrt {1-x^2} \sqrt {1-k^2 x^2}\right ) \operatorname {Subst}\left (\int \frac {1}{4 k^2-\left (c k-\sqrt {k} \sqrt {-4+c^2 k}\right )^2-\left (4 k^2-k^2 \left (c k-\sqrt {k} \sqrt {-4+c^2 k}\right )^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 {\left (2 k^{3/2} \left (c \sqrt {k}+\sqrt {-4+c^2 k}\right ) \sqrt {1-x^2} \sqrt {1-k^2 x^2}\right ) \operatorname {Subst}\left (\int \frac {1}{4 k^2-\left (c k+\sqrt {k} \sqrt {-4+c^2 k}\right )^2-\left (4 k^2-k^2 \left (c k+\sqrt {k} \sqrt {-4+c^2 k}\right )^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 {\left (c \sqrt {k}+\sqrt {-4+c^2 k}\right ) \sqrt {1-x^2} \sqrt {1-k^2 x^2} \tanh ^{-1}\left (\frac {\sqrt {k} \sqrt {2+2 k-c^2 k^2-c k^{3/2} \sqrt {-4+c^2 k}} \sqrt {1-x^2}}{\sqrt {2+\left (2-c^2\right ) k-c \sqrt {k} \sqrt {-4+c^2 k}} \sqrt {1-k^2 x^2}}\right )}{\sqrt {2+\left (2-c^2\right ) k-c \sqrt {k} \sqrt {-4+c^2 k}} \sqrt {2+2 k-c^2 k^2-c k^{3/2} \sqrt {-4+c^2 k}} \sqrt {\left (1-x^2\right ) \left (1-k^2 x^2\right )}}+\frac {\left (c \sqrt {k}-\sqrt {-4+c^2 k}\right ) \sqrt {1-x^2} \sqrt {1-k^2 x^2} \tanh ^{-1}\left (\frac {\sqrt {k} \sqrt {2+2 k-c^2 k^2+c k^{3/2} \sqrt {-4+c^2 k}} \sqrt {1-x^2}}{\sqrt {2+\left (2-c^2\right ) k+c \sqrt {k} \sqrt {-4+c^2 k}} \sqrt {1-k^2 x^2}}\right )}{\sqrt {2+\left (2-c^2\right ) k+c \sqrt {k} \sqrt {-4+c^2 k}} \sqrt {2+2 k-c^2 k^2+c k^{3/2} \sqrt {-4+c^2 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 {\sqrt {1-x^2} \sqrt {1-k^2 x^2} \Pi \left (\frac {4 k}{\left (c \sqrt {k}-\sqrt {-4+c^2 k}\right )^2};\sin ^{-1}(x)|k^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} \Pi \left (\frac {4 k}{\left (c \sqrt {k}+\sqrt {-4+c^2 k}\right )^2};\sin ^{-1}(x)|k^2\right )}{\sqrt {\left (1-x^2\right ) \left (1-k^2 x^2\right )}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] time = 8.33, size = 2156, normalized size = 21.56 \begin {gather*} \text {Result too large to show} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
IntegrateAlgebraic [A] time = 3.72, size = 100, normalized size = 1.00 \begin {gather*} \frac {2 \sqrt {-c^2 k^2+k^2+2 k+1} \tan ^{-1}\left (\frac {x \sqrt {-c^2 k^2+k^2+2 k+1}}{c k x+\sqrt {k^2 x^4+\left (-k^2-1\right ) x^2+1}+k x^2+1}\right )}{(c k-k-1) (c k+k+1)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.91, size = 342, normalized size = 3.42 \begin {gather*} \left [\frac {\log \left (-\frac {{\left ({\left (2 \, c^{2} - 1\right )} k^{4} - 2 \, k^{3} - k^{2}\right )} x^{4} + 2 \, {\left (c k^{4} + 2 \, c k^{3} + c k^{2}\right )} x^{3} + {\left (2 \, c^{2} - 1\right )} k^{2} - {\left ({\left (c^{2} - 2\right )} k^{4} - 2 \, {\left (c^{2} + 3\right )} k^{3} + {\left (c^{2} - 8\right )} k^{2} - 6 \, k - 2\right )} x^{2} + 2 \, \sqrt {k^{2} x^{4} - {\left (k^{2} + 1\right )} x^{2} + 1} {\left (c k^{2} x^{2} + c k + {\left (k^{2} + 2 \, k + 1\right )} x\right )} \sqrt {{\left (c^{2} - 1\right )} k^{2} - 2 \, k - 1} + 2 \, {\left (c k^{3} + 2 \, c k^{2} + c k\right )} x - 2 \, k - 1}{2 \, c k^{2} x^{3} + k^{2} x^{4} + 2 \, c k x + {\left (c^{2} k^{2} + 2 \, k\right )} x^{2} + 1}\right )}{2 \, \sqrt {{\left (c^{2} - 1\right )} k^{2} - 2 \, k - 1}}, -\frac {\sqrt {-{\left (c^{2} - 1\right )} k^{2} + 2 \, k + 1} \arctan \left (\frac {\sqrt {k^{2} x^{4} - {\left (k^{2} + 1\right )} x^{2} + 1} \sqrt {-{\left (c^{2} - 1\right )} k^{2} + 2 \, k + 1}}{c k^{2} x^{2} + c k + {\left (k^{2} + 2 \, k + 1\right )} x}\right )}{{\left (c^{2} - 1\right )} k^{2} - 2 \, k - 1}\right ] \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*} \int \frac {k x^{2} - 1}{{\left (c k x + k x^{2} + 1\right )} \sqrt {{\left (k^{2} x^{2} - 1\right )} {\left (x^{2} - 1\right )}}}\,{d x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [C] time = 0.09, size = 11374, normalized size = 113.74 \begin {gather*} \text {output too large to display} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F(-2)] time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: ValueError} \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 {k\,x^2-1}{\sqrt {\left (x^2-1\right )\,\left (k^2\,x^2-1\right )}\,\left (k\,x^2+c\,k\,x+1\right )} \,d x \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 {k x^{2} - 1}{\sqrt {\left (x - 1\right ) \left (x + 1\right ) \left (k x - 1\right ) \left (k x + 1\right )} \left (c k x + k x^{2} + 1\right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________