Optimal. Leaf size=16 \[ -B z-A \tanh ^{-1}\left (\frac {A \tan (z)}{B}\right ) \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.06, antiderivative size = 16, normalized size of antiderivative = 1.00, number of steps
used = 5, number of rules used = 5, integrand size = 39, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.128, Rules used = {12, 3270, 400,
209, 212} \begin {gather*} -A \tanh ^{-1}\left (\frac {A \tan (z)}{B}\right )-B z \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 209
Rule 212
Rule 400
Rule 3270
Rubi steps
\begin {align*} \int \frac {\left (-A^2-B^2\right ) \cos ^2(z)}{B \left (1-\frac {\left (A^2+B^2\right ) \sin ^2(z)}{B^2}\right )} \, dz &=-\frac {\left (A^2+B^2\right ) \int \frac {\cos ^2(z)}{1-\frac {\left (A^2+B^2\right ) \sin ^2(z)}{B^2}} \, dz}{B}\\ &=-\frac {\left (A^2+B^2\right ) \text {Subst}\left (\int \frac {1}{\left (1+z^2\right ) \left (1+\left (1-\frac {A^2+B^2}{B^2}\right ) z^2\right )} \, dz,z,\tan (z)\right )}{B}\\ &=-\frac {A^2 \text {Subst}\left (\int \frac {1}{1+\left (1-\frac {A^2+B^2}{B^2}\right ) z^2} \, dz,z,\tan (z)\right )}{B}-B \text {Subst}\left (\int \frac {1}{1+z^2} \, dz,z,\tan (z)\right )\\ &=-B z-A \tanh ^{-1}\left (\frac {A \tan (z)}{B}\right )\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(35\) vs. \(2(16)=32\).
time = 0.07, size = 35, normalized size = 2.19 \begin {gather*} -\frac {B \left (A^2+B^2\right ) \left (B z+A \tanh ^{-1}\left (\frac {A \tan (z)}{B}\right )\right )}{A^2 B+B^3} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(73\) vs.
\(2(16)=32\).
time = 0.12, size = 74, normalized size = 4.62
method | result | size |
default | \(\left (-A^{2}-B^{2}\right ) B \left (\frac {A \ln \left (A \tan \left (z \right )+B \right )}{2 B \left (A^{2}+B^{2}\right )}-\frac {A \ln \left (A \tan \left (z \right )-B \right )}{2 B \left (A^{2}+B^{2}\right )}+\frac {\arctan \left (\tan \left (z \right )\right )}{A^{2}+B^{2}}\right )\) | \(74\) |
norman | \(\frac {-B z -2 B z \left (\tan ^{2}\left (\frac {z}{2}\right )\right )-B z \left (\tan ^{4}\left (\frac {z}{2}\right )\right )}{\left (1+\tan ^{2}\left (\frac {z}{2}\right )\right )^{2}}-\frac {A \ln \left (-B \left (\tan ^{2}\left (\frac {z}{2}\right )\right )+2 A \tan \left (\frac {z}{2}\right )+B \right )}{2}+\frac {A \ln \left (B \left (\tan ^{2}\left (\frac {z}{2}\right )\right )+2 A \tan \left (\frac {z}{2}\right )-B \right )}{2}\) | \(83\) |
risch | \(-\frac {B z \,A^{2}}{A^{2}+B^{2}}-\frac {B^{3} z}{A^{2}+B^{2}}+\frac {A^{3} \ln \left ({\mathrm e}^{2 i z}-\frac {i B +A}{-i B +A}\right )}{2 A^{2}+2 B^{2}}+\frac {A \ln \left ({\mathrm e}^{2 i z}-\frac {i B +A}{-i B +A}\right ) B^{2}}{2 A^{2}+2 B^{2}}-\frac {A^{3} \ln \left ({\mathrm e}^{2 i z}-\frac {-i B +A}{i B +A}\right )}{2 \left (A^{2}+B^{2}\right )}-\frac {A \ln \left ({\mathrm e}^{2 i z}-\frac {-i B +A}{i B +A}\right ) B^{2}}{2 \left (A^{2}+B^{2}\right )}\) | \(183\) |
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. 69 vs.
\(2 (16) = 32\).
time = 2.29, size = 69, normalized size = 4.31 \begin {gather*} -\frac {{\left (A^{2} + B^{2}\right )} {\left (\frac {2 \, B^{2} z}{A^{2} + B^{2}} + \frac {A B \log \left (A \tan \left (z\right ) + B\right )}{A^{2} + B^{2}} - \frac {A B \log \left (A \tan \left (z\right ) - B\right )}{A^{2} + B^{2}}\right )}}{2 \, B} \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. 67 vs.
\(2 (16) = 32\).
time = 1.85, size = 67, normalized size = 4.19 \begin {gather*} -B z - \frac {1}{4} \, A \log \left (2 \, A B \cos \left (z\right ) \sin \left (z\right ) - {\left (A^{2} - B^{2}\right )} \cos \left (z\right )^{2} + A^{2}\right ) + \frac {1}{4} \, A \log \left (-2 \, A B \cos \left (z\right ) \sin \left (z\right ) - {\left (A^{2} - B^{2}\right )} \cos \left (z\right )^{2} + A^{2}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 112.06, size = 202, normalized size = 12.62 \begin {gather*} \frac {\left (- A^{2} - B^{2}\right ) \left (\begin {cases} z & \text {for}\: A = 0 \wedge B = 0 \\\frac {z \sin ^{2}{\left (z \right )}}{2} + \frac {z \cos ^{2}{\left (z \right )}}{2} + \frac {\sin {\left (z \right )} \cos {\left (z \right )}}{2} & \text {for}\: A = - i B \vee A = i B \\\frac {A B \log {\left (- \frac {A}{B} + \tan {\left (\frac {z}{2} \right )} - \frac {\sqrt {A^{2} + B^{2}}}{B} \right )}}{2 A^{2} + 2 B^{2}} + \frac {A B \log {\left (- \frac {A}{B} + \tan {\left (\frac {z}{2} \right )} + \frac {\sqrt {A^{2} + B^{2}}}{B} \right )}}{2 A^{2} + 2 B^{2}} - \frac {A B \log {\left (\frac {A}{B} + \tan {\left (\frac {z}{2} \right )} - \frac {\sqrt {A^{2} + B^{2}}}{B} \right )}}{2 A^{2} + 2 B^{2}} - \frac {A B \log {\left (\frac {A}{B} + \tan {\left (\frac {z}{2} \right )} + \frac {\sqrt {A^{2} + B^{2}}}{B} \right )}}{2 A^{2} + 2 B^{2}} + \frac {2 B^{2} z}{2 A^{2} + 2 B^{2}} & \text {otherwise} \end {cases}\right )}{B} \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. 83 vs.
\(2 (16) = 32\).
time = 0.49, size = 83, normalized size = 5.19 \begin {gather*} -\frac {{\left (\frac {A^{3} B \log \left ({\left | A \tan \left (z\right ) + B \right |}\right )}{A^{4} + A^{2} B^{2}} - \frac {A^{3} B \log \left ({\left | A \tan \left (z\right ) - B \right |}\right )}{A^{4} + A^{2} B^{2}} + \frac {2 \, B^{2} z}{A^{2} + B^{2}}\right )} {\left (A^{2} + B^{2}\right )}}{2 \, B} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.50, size = 360, normalized size = 22.50 \begin {gather*} -A\,\mathrm {atanh}\left (\frac {2\,A^{13}\,\mathrm {tan}\left (z\right )}{2\,A^{12}\,B+6\,A^{10}\,B^3+6\,A^8\,B^5+2\,A^6\,B^7}+\frac {2\,A^7\,B^6\,\mathrm {tan}\left (z\right )}{2\,A^{12}\,B+6\,A^{10}\,B^3+6\,A^8\,B^5+2\,A^6\,B^7}+\frac {6\,A^9\,B^4\,\mathrm {tan}\left (z\right )}{2\,A^{12}\,B+6\,A^{10}\,B^3+6\,A^8\,B^5+2\,A^6\,B^7}+\frac {6\,A^{11}\,B^2\,\mathrm {tan}\left (z\right )}{2\,A^{12}\,B+6\,A^{10}\,B^3+6\,A^8\,B^5+2\,A^6\,B^7}\right )-B\,\mathrm {atan}\left (\frac {2\,A^4\,B^9\,\mathrm {tan}\left (z\right )}{2\,A^{10}\,B^3+6\,A^8\,B^5+6\,A^6\,B^7+2\,A^4\,B^9}+\frac {6\,A^6\,B^7\,\mathrm {tan}\left (z\right )}{2\,A^{10}\,B^3+6\,A^8\,B^5+6\,A^6\,B^7+2\,A^4\,B^9}+\frac {6\,A^8\,B^5\,\mathrm {tan}\left (z\right )}{2\,A^{10}\,B^3+6\,A^8\,B^5+6\,A^6\,B^7+2\,A^4\,B^9}+\frac {2\,A^{10}\,B^3\,\mathrm {tan}\left (z\right )}{2\,A^{10}\,B^3+6\,A^8\,B^5+6\,A^6\,B^7+2\,A^4\,B^9}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________