Optimal. Leaf size=16 \[ -B \tan ^{-1}(w)-A \tanh ^{-1}\left (\frac {A w}{B}\right ) \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.09, antiderivative size = 16, normalized size of antiderivative = 1.00, number of steps
used = 6, number of rules used = 5, integrand size = 48, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.104, Rules used = {12, 6820, 400,
209, 214} \begin {gather*} -A \tanh ^{-1}\left (\frac {A w}{B}\right )-B \text {ArcTan}(w) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 209
Rule 214
Rule 400
Rule 6820
Rubi steps
\begin {align*} \int -\frac {A^2+B^2}{B \left (1+w^2\right )^2 \left (1-\frac {\left (A^2+B^2\right ) w^2}{B^2 \left (1+w^2\right )}\right )} \, dw &=-\frac {\left (A^2+B^2\right ) \int \frac {1}{\left (1+w^2\right )^2 \left (1-\frac {\left (A^2+B^2\right ) w^2}{B^2 \left (1+w^2\right )}\right )} \, dw}{B}\\ &=-\frac {\left (A^2+B^2\right ) \int \frac {B^2}{\left (1+w^2\right ) \left (B^2-A^2 w^2\right )} \, dw}{B}\\ &=-\left (\left (B \left (A^2+B^2\right )\right ) \int \frac {1}{\left (1+w^2\right ) \left (B^2-A^2 w^2\right )} \, dw\right )\\ &=-\left (B \int \frac {1}{1+w^2} \, dw\right )-\left (A^2 B\right ) \int \frac {1}{B^2-A^2 w^2} \, dw\\ &=-B \tan ^{-1}(w)-A \tanh ^{-1}\left (\frac {A w}{B}\right )\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(35\) vs. \(2(16)=32\).
time = 0.01, size = 35, normalized size = 2.19 \begin {gather*} -\frac {B \left (A^2+B^2\right ) \left (B \tan ^{-1}(w)+A \tanh ^{-1}\left (\frac {A w}{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. \(70\) vs.
\(2(16)=32\).
time = 0.06, size = 71, normalized size = 4.44
method | result | size |
default | \(\left (-A^{2}-B^{2}\right ) B \left (\frac {\arctan \left (w \right )}{A^{2}+B^{2}}-\frac {A \ln \left (A w -B \right )}{2 B \left (A^{2}+B^{2}\right )}+\frac {A \ln \left (A w +B \right )}{2 B \left (A^{2}+B^{2}\right )}\right )\) | \(71\) |
risch | \(-\frac {A^{3} \ln \left (-A w -B \right )}{2 \left (A^{2}+B^{2}\right )}-\frac {A \ln \left (-A w -B \right ) B^{2}}{2 \left (A^{2}+B^{2}\right )}+\frac {A^{3} \ln \left (-A w +B \right )}{2 A^{2}+2 B^{2}}+\frac {A \ln \left (-A w +B \right ) B^{2}}{2 A^{2}+2 B^{2}}-\frac {\left (\munderset {\textit {\_R} =\RootOf \left (\left (A^{4}+2 A^{2} B^{2}+B^{4}\right ) \textit {\_Z}^{2}+B^{4}\right )}{\sum }\textit {\_R} \ln \left (\left (\left (-A^{6}-B^{2} A^{4}+A^{2} B^{4}+B^{6}\right ) \textit {\_R}^{2}-2 A^{2} B^{4}\right ) w +\left (-B^{2} A^{4}-2 A^{2} B^{4}-B^{6}\right ) \textit {\_R} \right )\right ) A^{2}}{2 B}-\frac {B \left (\munderset {\textit {\_R} =\RootOf \left (\left (A^{4}+2 A^{2} B^{2}+B^{4}\right ) \textit {\_Z}^{2}+B^{4}\right )}{\sum }\textit {\_R} \ln \left (\left (\left (-A^{6}-B^{2} A^{4}+A^{2} B^{4}+B^{6}\right ) \textit {\_R}^{2}-2 A^{2} B^{4}\right ) w +\left (-B^{2} A^{4}-2 A^{2} B^{4}-B^{6}\right ) \textit {\_R} \right )\right )}{2}\) | \(291\) |
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. 68 vs.
\(2 (16) = 32\).
time = 1.25, size = 68, normalized size = 4.25 \begin {gather*} -\frac {{\left (A^{2} + B^{2}\right )} {\left (\frac {2 \, B^{2} \arctan \left (w\right )}{A^{2} + B^{2}} + \frac {A B \log \left (A w + B\right )}{A^{2} + B^{2}} - \frac {A B \log \left (A w - B\right )}{A^{2} + B^{2}}\right )}}{2 \, B} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 1.10, size = 26, normalized size = 1.62 \begin {gather*} -B \arctan \left (w\right ) - \frac {1}{2} \, A \log \left (A w + B\right ) + \frac {1}{2} \, A \log \left (A w - B\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [C] Result contains complex when optimal does not.
time = 1.06, size = 422, normalized size = 26.38 \begin {gather*} \left (A^{2} B + B^{3}\right ) \left (- \frac {A \log {\left (w + \frac {- \frac {A^{9}}{B \left (A^{2} + B^{2}\right )^{3}} - \frac {A^{7} B}{\left (A^{2} + B^{2}\right )^{3}} + \frac {A^{5} B^{3}}{\left (A^{2} + B^{2}\right )^{3}} + \frac {A^{5}}{B \left (A^{2} + B^{2}\right )} + \frac {A^{3} B^{5}}{\left (A^{2} + B^{2}\right )^{3}} + \frac {A B^{3}}{A^{2} + B^{2}}}{A^{2}} \right )}}{2 B \left (A^{2} + B^{2}\right )} + \frac {A \log {\left (w + \frac {\frac {A^{9}}{B \left (A^{2} + B^{2}\right )^{3}} + \frac {A^{7} B}{\left (A^{2} + B^{2}\right )^{3}} - \frac {A^{5} B^{3}}{\left (A^{2} + B^{2}\right )^{3}} - \frac {A^{5}}{B \left (A^{2} + B^{2}\right )} - \frac {A^{3} B^{5}}{\left (A^{2} + B^{2}\right )^{3}} - \frac {A B^{3}}{A^{2} + B^{2}}}{A^{2}} \right )}}{2 B \left (A^{2} + B^{2}\right )} + \frac {i \log {\left (w + \frac {- \frac {i A^{6} B^{2}}{\left (A^{2} + B^{2}\right )^{3}} - \frac {i A^{4} B^{4}}{\left (A^{2} + B^{2}\right )^{3}} - \frac {i A^{4}}{A^{2} + B^{2}} + \frac {i A^{2} B^{6}}{\left (A^{2} + B^{2}\right )^{3}} + \frac {i B^{8}}{\left (A^{2} + B^{2}\right )^{3}} - \frac {i B^{4}}{A^{2} + B^{2}}}{A^{2}} \right )}}{2 \left (A^{2} + B^{2}\right )} - \frac {i \log {\left (w + \frac {\frac {i A^{6} B^{2}}{\left (A^{2} + B^{2}\right )^{3}} + \frac {i A^{4} B^{4}}{\left (A^{2} + B^{2}\right )^{3}} + \frac {i A^{4}}{A^{2} + B^{2}} - \frac {i A^{2} B^{6}}{\left (A^{2} + B^{2}\right )^{3}} - \frac {i B^{8}}{\left (A^{2} + B^{2}\right )^{3}} + \frac {i B^{4}}{A^{2} + B^{2}}}{A^{2}} \right )}}{2 \left (A^{2} + B^{2}\right )}\right ) \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. 82 vs.
\(2 (16) = 32\).
time = 0.44, size = 82, normalized size = 5.12 \begin {gather*} -\frac {{\left (\frac {A^{3} B \log \left ({\left | A w + B \right |}\right )}{A^{4} + A^{2} B^{2}} - \frac {A^{3} B \log \left ({\left | A w - B \right |}\right )}{A^{4} + A^{2} B^{2}} + \frac {2 \, B^{2} \arctan \left (w\right )}{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.24, size = 352, normalized size = 22.00 \begin {gather*} -A\,\mathrm {atanh}\left (\frac {2\,A^{13}\,w}{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\,w}{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\,w}{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\,w}{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\,w}{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\,w}{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\,w}{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\,w}{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]
________________________________________________________________________________________