Optimal. Leaf size=53 \[ -B \tan ^{-1}\left (\frac {B y}{\sqrt {A^2+B^2-B^2 y^2}}\right )-A \tanh ^{-1}\left (\frac {A y}{\sqrt {A^2+B^2-B^2 y^2}}\right ) \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.04, antiderivative size = 53, normalized size of antiderivative = 1.00, number of steps
used = 6, number of rules used = 6, integrand size = 30, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.200, Rules used = {1999, 399, 223,
209, 385, 212} \begin {gather*} -B \tan ^{-1}\left (\frac {B y}{\sqrt {A^2-B^2 y^2+B^2}}\right )-A \tanh ^{-1}\left (\frac {A y}{\sqrt {A^2-B^2 y^2+B^2}}\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 209
Rule 212
Rule 223
Rule 385
Rule 399
Rule 1999
Rubi steps
\begin {align*} \int -\frac {\sqrt {A^2+B^2 \left (1-y^2\right )}}{1-y^2} \, dy &=-\int \frac {\sqrt {A^2+B^2-B^2 y^2}}{1-y^2} \, dy\\ &=-\left (A^2 \int \frac {1}{\left (1-y^2\right ) \sqrt {A^2+B^2-B^2 y^2}} \, dy\right )-B^2 \int \frac {1}{\sqrt {A^2+B^2-B^2 y^2}} \, dy\\ &=-\left (A^2 \text {Subst}\left (\int \frac {1}{1-A^2 y^2} \, dy,y,\frac {y}{\sqrt {A^2+B^2-B^2 y^2}}\right )\right )-B^2 \text {Subst}\left (\int \frac {1}{1+B^2 y^2} \, dy,y,\frac {y}{\sqrt {A^2+B^2-B^2 y^2}}\right )\\ &=-B \tan ^{-1}\left (\frac {B y}{\sqrt {A^2+B^2-B^2 y^2}}\right )-A \tanh ^{-1}\left (\frac {A y}{\sqrt {A^2+B^2-B^2 y^2}}\right )\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.08, size = 98, normalized size = 1.85 \begin {gather*} \frac {B \left (-A \tan ^{-1}\left (\frac {B^2 \left (-1+y^2\right )+\sqrt {-B^2} y \sqrt {A^2+B^2-B^2 y^2}}{A B}\right )+B \log \left (-\sqrt {-B^2} y+\sqrt {A^2+B^2-B^2 y^2}\right )\right )}{\sqrt {-B^2}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Mathics [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {cought exception: maximum recursion depth exceeded while calling a Python object} \end {gather*}
Warning: Unable to verify antiderivative.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(261\) vs.
\(2(49)=98\).
time = 0.05, size = 262, normalized size = 4.94
method | result | size |
default | \(\frac {\sqrt {-B^{2} \left (y -1\right )^{2}-2 B^{2} \left (y -1\right )+A^{2}}}{2}-\frac {B^{2} \arctan \left (\frac {\sqrt {B^{2}}\, y}{\sqrt {-B^{2} \left (y -1\right )^{2}-2 B^{2} \left (y -1\right )+A^{2}}}\right )}{2 \sqrt {B^{2}}}-\frac {A^{2} \ln \left (\frac {2 A^{2}-2 B^{2} \left (y -1\right )+2 \sqrt {A^{2}}\, \sqrt {-B^{2} \left (y -1\right )^{2}-2 B^{2} \left (y -1\right )+A^{2}}}{y -1}\right )}{2 \sqrt {A^{2}}}-\frac {\sqrt {-B^{2} \left (1+y \right )^{2}+2 B^{2} \left (1+y \right )+A^{2}}}{2}-\frac {B^{2} \arctan \left (\frac {\sqrt {B^{2}}\, y}{\sqrt {-B^{2} \left (1+y \right )^{2}+2 B^{2} \left (1+y \right )+A^{2}}}\right )}{2 \sqrt {B^{2}}}+\frac {A^{2} \ln \left (\frac {2 A^{2}+2 B^{2} \left (1+y \right )+2 \sqrt {A^{2}}\, \sqrt {-B^{2} \left (1+y \right )^{2}+2 B^{2} \left (1+y \right )+A^{2}}}{1+y}\right )}{2 \sqrt {A^{2}}}\) | \(262\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 123 vs.
\(2 (49) = 98\).
time = 0.35, size = 123, normalized size = 2.32 \begin {gather*} -B \arcsin \left (\frac {B^{2} y}{\sqrt {A^{2} B^{2} + B^{4}}}\right ) + \frac {1}{2} \, A \log \left (B^{2} + \frac {2 \, A^{2}}{{\left | 2 \, y + 2 \right |}} + \frac {2 \, \sqrt {-B^{2} y^{2} + A^{2} + B^{2}} A}{{\left | 2 \, y + 2 \right |}}\right ) - \frac {1}{2} \, A \log \left (-B^{2} + \frac {2 \, A^{2}}{{\left | 2 \, y - 2 \right |}} + \frac {2 \, \sqrt {-B^{2} y^{2} + A^{2} + B^{2}} A}{{\left | 2 \, y - 2 \right |}}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 128 vs.
\(2 (49) = 98\).
time = 0.34, size = 128, normalized size = 2.42 \begin {gather*} B \arctan \left (\frac {\sqrt {-B^{2} y^{2} + A^{2} + B^{2}}}{B y}\right ) - \frac {1}{4} \, A \log \left (-\frac {{\left (A^{2} - B^{2}\right )} y^{2} + 2 \, \sqrt {-B^{2} y^{2} + A^{2} + B^{2}} A y + A^{2} + B^{2}}{y^{2}}\right ) + \frac {1}{4} \, A \log \left (-\frac {{\left (A^{2} - B^{2}\right )} y^{2} - 2 \, \sqrt {-B^{2} y^{2} + A^{2} + B^{2}} A y + A^{2} + B^{2}}{y^{2}}\right ) \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 {A^{2} - B^{2} y^{2} + B^{2}}}{\left (y - 1\right ) \left (y + 1\right )}\, dy \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 295 vs.
\(2 (49) = 98\).
time = 0.02, size = 355, normalized size = 6.70 \begin {gather*} \frac {B^{2} \left (\frac {1}{2} \pi \mathrm {sign}\left (y\right )-\arctan \left (\frac {B^{2} y \left (\left (-\frac {-2 B \sqrt {A^{2}+B^{2}}-2 \sqrt {-B^{2} y^{2}+A^{2}+B^{2}} \left |B\right |}{2 \left (B^{2} y\right )}\right )^{2}-1\right )}{-2 B \sqrt {A^{2}+B^{2}}-2 \sqrt {-B^{2} y^{2}+A^{2}+B^{2}} \left |B\right |}\right )\right )}{\left |B\right |}-\frac {A B^{2} \ln \left |B \left (-\frac {-2 B \sqrt {A^{2}+B^{2}}-2 \sqrt {-B^{2} y^{2}+A^{2}+B^{2}} \left |B\right |}{2 \left (B^{2} y\right )}+\frac {2 B^{2} y}{-2 B \sqrt {A^{2}+B^{2}}-2 \sqrt {-B^{2} y^{2}+A^{2}+B^{2}} \left |B\right |}\right )+2 A\right |}{2 \left (B \left |B\right |\right )}+\frac {A B^{2} \ln \left |B \left (-\frac {-2 B \sqrt {A^{2}+B^{2}}-2 \sqrt {-B^{2} y^{2}+A^{2}+B^{2}} \left |B\right |}{2 \left (B^{2} y\right )}+\frac {2 B^{2} y}{-2 B \sqrt {A^{2}+B^{2}}-2 \sqrt {-B^{2} y^{2}+A^{2}+B^{2}} \left |B\right |}\right )-2 A\right |}{2 \left (B \left |B\right |\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.02 \begin {gather*} \left \{\begin {array}{cl} \int \frac {\sqrt {-B^2\,y^2}}{y^2-1} \,d y & \text {\ if\ \ }A^2+B^2=0\\ \ln \left (2\,y\,\sqrt {-B^2}+2\,\sqrt {A^2-B^2\,y^2+B^2}\right )\,\sqrt {-B^2}+\mathrm {atan}\left (\frac {y\,\sqrt {A^2}\,1{}\mathrm {i}}{\sqrt {A^2-B^2\,y^2+B^2}}\right )\,\sqrt {A^2}\,1{}\mathrm {i} & \text {\ if\ \ }A^2+B^2\neq 0 \end {array}\right . \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________