Optimal. Leaf size=62 \[ \frac {2 (a c-b d) \tanh ^{-1}\left (\frac {\sqrt {c-d} \tanh \left (\frac {x}{2}\right )}{\sqrt {c+d}}\right )}{c \sqrt {c-d} \sqrt {c+d}}+\frac {b \tan ^{-1}(\sinh (x))}{c} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.16, antiderivative size = 62, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, integrand size = 15, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {2828, 3001, 3770, 2659, 208} \[ \frac {2 (a c-b d) \tanh ^{-1}\left (\frac {\sqrt {c-d} \tanh \left (\frac {x}{2}\right )}{\sqrt {c+d}}\right )}{c \sqrt {c-d} \sqrt {c+d}}+\frac {b \tan ^{-1}(\sinh (x))}{c} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 208
Rule 2659
Rule 2828
Rule 3001
Rule 3770
Rubi steps
\begin {align*} \int \frac {a+b \text {sech}(x)}{c+d \cosh (x)} \, dx &=\int \frac {(b+a \cosh (x)) \text {sech}(x)}{c+d \cosh (x)} \, dx\\ &=\frac {b \int \text {sech}(x) \, dx}{c}+\frac {(a c-b d) \int \frac {1}{c+d \cosh (x)} \, dx}{c}\\ &=\frac {b \tan ^{-1}(\sinh (x))}{c}+\frac {(2 (a c-b d)) \operatorname {Subst}\left (\int \frac {1}{c+d-(c-d) x^2} \, dx,x,\tanh \left (\frac {x}{2}\right )\right )}{c}\\ &=\frac {b \tan ^{-1}(\sinh (x))}{c}+\frac {2 (a c-b d) \tanh ^{-1}\left (\frac {\sqrt {c-d} \tanh \left (\frac {x}{2}\right )}{\sqrt {c+d}}\right )}{c \sqrt {c-d} \sqrt {c+d}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.13, size = 63, normalized size = 1.02 \[ \frac {2 \left (\frac {(b d-a c) \tan ^{-1}\left (\frac {(c-d) \tanh \left (\frac {x}{2}\right )}{\sqrt {d^2-c^2}}\right )}{\sqrt {d^2-c^2}}+b \tan ^{-1}\left (\tanh \left (\frac {x}{2}\right )\right )\right )}{c} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [A] time = 0.77, size = 249, normalized size = 4.02 \[ \left [-\frac {{\left (a c - b d\right )} \sqrt {c^{2} - d^{2}} \log \left (\frac {d^{2} \cosh \relax (x)^{2} + d^{2} \sinh \relax (x)^{2} + 2 \, c d \cosh \relax (x) + 2 \, c^{2} - d^{2} + 2 \, {\left (d^{2} \cosh \relax (x) + c d\right )} \sinh \relax (x) + 2 \, \sqrt {c^{2} - d^{2}} {\left (d \cosh \relax (x) + d \sinh \relax (x) + c\right )}}{d \cosh \relax (x)^{2} + d \sinh \relax (x)^{2} + 2 \, c \cosh \relax (x) + 2 \, {\left (d \cosh \relax (x) + c\right )} \sinh \relax (x) + d}\right ) - 2 \, {\left (b c^{2} - b d^{2}\right )} \arctan \left (\cosh \relax (x) + \sinh \relax (x)\right )}{c^{3} - c d^{2}}, -\frac {2 \, {\left ({\left (a c - b d\right )} \sqrt {-c^{2} + d^{2}} \arctan \left (-\frac {\sqrt {-c^{2} + d^{2}} {\left (d \cosh \relax (x) + d \sinh \relax (x) + c\right )}}{c^{2} - d^{2}}\right ) - {\left (b c^{2} - b d^{2}\right )} \arctan \left (\cosh \relax (x) + \sinh \relax (x)\right )\right )}}{c^{3} - c d^{2}}\right ] \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.14, size = 53, normalized size = 0.85 \[ \frac {2 \, b \arctan \left (e^{x}\right )}{c} + \frac {2 \, {\left (a c - b d\right )} \arctan \left (\frac {d e^{x} + c}{\sqrt {-c^{2} + d^{2}}}\right )}{\sqrt {-c^{2} + d^{2}} c} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.19, size = 89, normalized size = 1.44 \[ \frac {2 \arctanh \left (\frac {\left (c -d \right ) \tanh \left (\frac {x}{2}\right )}{\sqrt {\left (c +d \right ) \left (c -d \right )}}\right ) a}{\sqrt {\left (c +d \right ) \left (c -d \right )}}-\frac {2 \arctanh \left (\frac {\left (c -d \right ) \tanh \left (\frac {x}{2}\right )}{\sqrt {\left (c +d \right ) \left (c -d \right )}}\right ) b d}{c \sqrt {\left (c +d \right ) \left (c -d \right )}}+\frac {2 b \arctan \left (\tanh \left (\frac {x}{2}\right )\right )}{c} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F(-2)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: ValueError} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 6.35, size = 636, normalized size = 10.26 \[ \frac {\ln \left (\frac {\sqrt {\left (c+d\right )\,\left (c-d\right )}\,\left (a\,c-b\,d\right )\,\left (\frac {32\,\left (a^2\,c^2\,d-2\,a\,b\,c\,d^2-4\,{\mathrm {e}}^x\,b^2\,c^3-2\,b^2\,c^2\,d+3\,{\mathrm {e}}^x\,b^2\,c\,d^2+2\,b^2\,d^3\right )}{d^5}+\frac {\sqrt {\left (c+d\right )\,\left (c-d\right )}\,\left (\frac {32\,c^2\,\left (2\,b\,d^2-4\,a\,c^2\,{\mathrm {e}}^x+a\,d^2\,{\mathrm {e}}^x-2\,a\,c\,d+3\,b\,c\,d\,{\mathrm {e}}^x\right )}{d^5}-\frac {32\,c^2\,\sqrt {\left (c+d\right )\,\left (c-d\right )}\,\left (a\,c-b\,d\right )\,\left (4\,{\mathrm {e}}^x\,c^3+3\,c^2\,d-3\,{\mathrm {e}}^x\,c\,d^2-2\,d^3\right )}{d^5\,\left (c\,d^2-c^3\right )}\right )\,\left (a\,c-b\,d\right )}{c\,d^2-c^3}\right )}{c\,d^2-c^3}-\frac {32\,b\,\left (a\,c-b\,d\right )\,\left (2\,b\,d-a\,d\,{\mathrm {e}}^x+4\,b\,c\,{\mathrm {e}}^x\right )}{d^5}\right )\,\sqrt {\left (c+d\right )\,\left (c-d\right )}\,\left (a\,c-b\,d\right )}{c\,d^2-c^3}-\frac {\ln \left (-\frac {32\,b\,\left (a\,c-b\,d\right )\,\left (2\,b\,d-a\,d\,{\mathrm {e}}^x+4\,b\,c\,{\mathrm {e}}^x\right )}{d^5}-\frac {\sqrt {\left (c+d\right )\,\left (c-d\right )}\,\left (a\,c-b\,d\right )\,\left (\frac {32\,\left (a^2\,c^2\,d-2\,a\,b\,c\,d^2-4\,{\mathrm {e}}^x\,b^2\,c^3-2\,b^2\,c^2\,d+3\,{\mathrm {e}}^x\,b^2\,c\,d^2+2\,b^2\,d^3\right )}{d^5}-\frac {\sqrt {\left (c+d\right )\,\left (c-d\right )}\,\left (\frac {32\,c^2\,\left (2\,b\,d^2-4\,a\,c^2\,{\mathrm {e}}^x+a\,d^2\,{\mathrm {e}}^x-2\,a\,c\,d+3\,b\,c\,d\,{\mathrm {e}}^x\right )}{d^5}+\frac {32\,c^2\,\sqrt {\left (c+d\right )\,\left (c-d\right )}\,\left (a\,c-b\,d\right )\,\left (4\,{\mathrm {e}}^x\,c^3+3\,c^2\,d-3\,{\mathrm {e}}^x\,c\,d^2-2\,d^3\right )}{d^5\,\left (c\,d^2-c^3\right )}\right )\,\left (a\,c-b\,d\right )}{c\,d^2-c^3}\right )}{c\,d^2-c^3}\right )\,\sqrt {\left (c+d\right )\,\left (c-d\right )}\,\left (a\,c-b\,d\right )}{c\,d^2-c^3}-\frac {b\,\ln \left ({\mathrm {e}}^x-\mathrm {i}\right )\,1{}\mathrm {i}}{c}+\frac {b\,\ln \left ({\mathrm {e}}^x+1{}\mathrm {i}\right )\,1{}\mathrm {i}}{c} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {a + b \operatorname {sech}{\relax (x )}}{c + d \cosh {\relax (x )}}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________