Optimal. Leaf size=64 \[ \frac {b}{\left (a^2-b^2\right ) (a \cosh (x)+b \sinh (x))}+\frac {a \tan ^{-1}\left (\frac {a \sinh (x)+b \cosh (x)}{\sqrt {a^2-b^2}}\right )}{\left (a^2-b^2\right )^{3/2}} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.06, antiderivative size = 64, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 14, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.214, Rules used = {3155, 3074, 206} \[ \frac {b}{\left (a^2-b^2\right ) (a \cosh (x)+b \sinh (x))}+\frac {a \tan ^{-1}\left (\frac {a \sinh (x)+b \cosh (x)}{\sqrt {a^2-b^2}}\right )}{\left (a^2-b^2\right )^{3/2}} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 206
Rule 3074
Rule 3155
Rubi steps
\begin {align*} \int \frac {\cosh (x)}{(a \cosh (x)+b \sinh (x))^2} \, dx &=\frac {b}{\left (a^2-b^2\right ) (a \cosh (x)+b \sinh (x))}+\frac {a \int \frac {1}{a \cosh (x)+b \sinh (x)} \, dx}{a^2-b^2}\\ &=\frac {b}{\left (a^2-b^2\right ) (a \cosh (x)+b \sinh (x))}+\frac {(i a) \operatorname {Subst}\left (\int \frac {1}{a^2-b^2-x^2} \, dx,x,-i b \cosh (x)-i a \sinh (x)\right )}{a^2-b^2}\\ &=\frac {a \tan ^{-1}\left (\frac {b \cosh (x)+a \sinh (x)}{\sqrt {a^2-b^2}}\right )}{\left (a^2-b^2\right )^{3/2}}+\frac {b}{\left (a^2-b^2\right ) (a \cosh (x)+b \sinh (x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.13, size = 124, normalized size = 1.94 \[ \frac {2 a^2 \sqrt {a+b} \cosh (x) \tan ^{-1}\left (\frac {a \tanh \left (\frac {x}{2}\right )+b}{\sqrt {a-b} \sqrt {a+b}}\right )+2 a b \sqrt {a+b} \sinh (x) \tan ^{-1}\left (\frac {a \tanh \left (\frac {x}{2}\right )+b}{\sqrt {a-b} \sqrt {a+b}}\right )+b \sqrt {a-b} (a+b)}{(a-b)^{3/2} (a+b)^2 (a \cosh (x)+b \sinh (x))} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [B] time = 0.46, size = 596, normalized size = 9.31 \[ \left [\frac {{\left ({\left (a^{2} + a b\right )} \cosh \relax (x)^{2} + 2 \, {\left (a^{2} + a b\right )} \cosh \relax (x) \sinh \relax (x) + {\left (a^{2} + a b\right )} \sinh \relax (x)^{2} + a^{2} - a b\right )} \sqrt {-a^{2} + b^{2}} \log \left (\frac {{\left (a + b\right )} \cosh \relax (x)^{2} + 2 \, {\left (a + b\right )} \cosh \relax (x) \sinh \relax (x) + {\left (a + b\right )} \sinh \relax (x)^{2} + 2 \, \sqrt {-a^{2} + b^{2}} {\left (\cosh \relax (x) + \sinh \relax (x)\right )} - a + b}{{\left (a + b\right )} \cosh \relax (x)^{2} + 2 \, {\left (a + b\right )} \cosh \relax (x) \sinh \relax (x) + {\left (a + b\right )} \sinh \relax (x)^{2} + a - b}\right ) + 2 \, {\left (a^{2} b - b^{3}\right )} \cosh \relax (x) + 2 \, {\left (a^{2} b - b^{3}\right )} \sinh \relax (x)}{a^{5} - a^{4} b - 2 \, a^{3} b^{2} + 2 \, a^{2} b^{3} + a b^{4} - b^{5} + {\left (a^{5} + a^{4} b - 2 \, a^{3} b^{2} - 2 \, a^{2} b^{3} + a b^{4} + b^{5}\right )} \cosh \relax (x)^{2} + 2 \, {\left (a^{5} + a^{4} b - 2 \, a^{3} b^{2} - 2 \, a^{2} b^{3} + a b^{4} + b^{5}\right )} \cosh \relax (x) \sinh \relax (x) + {\left (a^{5} + a^{4} b - 2 \, a^{3} b^{2} - 2 \, a^{2} b^{3} + a b^{4} + b^{5}\right )} \sinh \relax (x)^{2}}, -\frac {2 \, {\left ({\left ({\left (a^{2} + a b\right )} \cosh \relax (x)^{2} + 2 \, {\left (a^{2} + a b\right )} \cosh \relax (x) \sinh \relax (x) + {\left (a^{2} + a b\right )} \sinh \relax (x)^{2} + a^{2} - a b\right )} \sqrt {a^{2} - b^{2}} \arctan \left (\frac {\sqrt {a^{2} - b^{2}}}{{\left (a + b\right )} \cosh \relax (x) + {\left (a + b\right )} \sinh \relax (x)}\right ) - {\left (a^{2} b - b^{3}\right )} \cosh \relax (x) - {\left (a^{2} b - b^{3}\right )} \sinh \relax (x)\right )}}{a^{5} - a^{4} b - 2 \, a^{3} b^{2} + 2 \, a^{2} b^{3} + a b^{4} - b^{5} + {\left (a^{5} + a^{4} b - 2 \, a^{3} b^{2} - 2 \, a^{2} b^{3} + a b^{4} + b^{5}\right )} \cosh \relax (x)^{2} + 2 \, {\left (a^{5} + a^{4} b - 2 \, a^{3} b^{2} - 2 \, a^{2} b^{3} + a b^{4} + b^{5}\right )} \cosh \relax (x) \sinh \relax (x) + {\left (a^{5} + a^{4} b - 2 \, a^{3} b^{2} - 2 \, a^{2} b^{3} + a b^{4} + b^{5}\right )} \sinh \relax (x)^{2}}\right ] \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.13, size = 72, normalized size = 1.12 \[ \frac {2 \, a \arctan \left (\frac {a e^{x} + b e^{x}}{\sqrt {a^{2} - b^{2}}}\right )}{{\left (a^{2} - b^{2}\right )}^{\frac {3}{2}}} + \frac {2 \, b e^{x}}{{\left (a^{2} - b^{2}\right )} {\left (a e^{\left (2 \, x\right )} + b e^{\left (2 \, x\right )} + a - b\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [A] time = 0.30, size = 98, normalized size = 1.53 \[ \frac {\frac {2 b^{2} \tanh \left (\frac {x}{2}\right )}{a \left (a^{2}-b^{2}\right )}+\frac {2 b}{a^{2}-b^{2}}}{a +2 \tanh \left (\frac {x}{2}\right ) b +a \left (\tanh ^{2}\left (\frac {x}{2}\right )\right )}+\frac {2 a \arctan \left (\frac {2 a \tanh \left (\frac {x}{2}\right )+2 b}{2 \sqrt {a^{2}-b^{2}}}\right )}{\left (a^{2}-b^{2}\right )^{\frac {3}{2}}} \]
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 = 1.71, size = 183, normalized size = 2.86 \[ \frac {2\,\mathrm {atan}\left (\frac {{\mathrm {e}}^x\,\left (a^2\,\sqrt {a^6-3\,a^4\,b^2+3\,a^2\,b^4-b^6}+a\,b\,\sqrt {a^6-3\,a^4\,b^2+3\,a^2\,b^4-b^6}\right )}{a^4\,\sqrt {a^2}-2\,b^2\,{\left (a^2\right )}^{3/2}+b^4\,\sqrt {a^2}+a\,b\,{\left (a^2\right )}^{3/2}-a^3\,b\,\sqrt {a^2}}\right )\,\sqrt {a^2}}{\sqrt {a^6-3\,a^4\,b^2+3\,a^2\,b^4-b^6}}+\frac {2\,b\,{\mathrm {e}}^x}{\left (a+b\right )\,\left (a-b\right )\,\left (a-b+{\mathrm {e}}^{2\,x}\,\left (a+b\right )\right )} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F(-1)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________