Optimal. Leaf size=51 \[ 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.02, antiderivative size = 51, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 5, integrand size = 29, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.172, Rules used = {399, 223, 209,
385, 212} \begin {gather*} B \text {ArcTan}\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
Rubi steps
\begin {align*} \int \frac {\sqrt {A^2+B^2-B^2 y^2}}{1-y^2} \, dy &=A^2 \int \frac {1}{\left (1-y^2\right ) \sqrt {A^2+B^2-B^2 y^2}} \, dy+B^2 \int \frac {1}{\sqrt {A^2+B^2-B^2 y^2}} \, dy\\ &=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 )+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.13, size = 100, normalized size = 1.96 \begin {gather*} \frac {\sqrt {-B^2} \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 )}{B} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(261\) vs.
\(2(47)=94\).
time = 0.08, size = 262, normalized size = 5.14
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. 114 vs.
\(2 (47) = 94\).
time = 3.24, size = 114, normalized size = 2.24 \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 {A^{2}}{y + 1} + \frac {\sqrt {-B^{2} y^{2} + A^{2} + B^{2}} A}{y + 1}\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. 129 vs.
\(2 (47) = 94\).
time = 0.75, size = 129, normalized size = 2.53 \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}}}{y^{2} - 1}\, dy \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: NotImplementedError} \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]
________________________________________________________________________________________