Integrand size = 15, antiderivative size = 62 \[ \int \frac {a+b \text {sech}(x)}{c+d \cosh (x)} \, dx=\frac {b \arctan (\sinh (x))}{c}+\frac {2 (a c-b d) \text {arctanh}\left (\frac {\sqrt {c-d} \tanh \left (\frac {x}{2}\right )}{\sqrt {c+d}}\right )}{c \sqrt {c-d} \sqrt {c+d}} \]
[Out]
Time = 0.13 (sec) , antiderivative size = 62, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {2907, 3080, 3855, 2738, 214} \[ \int \frac {a+b \text {sech}(x)}{c+d \cosh (x)} \, dx=\frac {2 (a c-b d) \text {arctanh}\left (\frac {\sqrt {c-d} \tanh \left (\frac {x}{2}\right )}{\sqrt {c+d}}\right )}{c \sqrt {c-d} \sqrt {c+d}}+\frac {b \arctan (\sinh (x))}{c} \]
[In]
[Out]
Rule 214
Rule 2738
Rule 2907
Rule 3080
Rule 3855
Rubi steps \begin{align*} \text {integral}& = \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 \arctan (\sinh (x))}{c}+\frac {(2 (a c-b d)) \text {Subst}\left (\int \frac {1}{c+d-(c-d) x^2} \, dx,x,\tanh \left (\frac {x}{2}\right )\right )}{c} \\ & = \frac {b \arctan (\sinh (x))}{c}+\frac {2 (a c-b d) \text {arctanh}\left (\frac {\sqrt {c-d} \tanh \left (\frac {x}{2}\right )}{\sqrt {c+d}}\right )}{c \sqrt {c-d} \sqrt {c+d}} \\ \end{align*}
Time = 0.21 (sec) , antiderivative size = 63, normalized size of antiderivative = 1.02 \[ \int \frac {a+b \text {sech}(x)}{c+d \cosh (x)} \, dx=\frac {2 \left (b \arctan \left (\tanh \left (\frac {x}{2}\right )\right )+\frac {(-a c+b d) \arctan \left (\frac {(c-d) \tanh \left (\frac {x}{2}\right )}{\sqrt {-c^2+d^2}}\right )}{\sqrt {-c^2+d^2}}\right )}{c} \]
[In]
[Out]
Time = 0.51 (sec) , antiderivative size = 59, normalized size of antiderivative = 0.95
method | result | size |
default | \(\frac {2 b \arctan \left (\tanh \left (\frac {x}{2}\right )\right )}{c}-\frac {2 \left (-a c +b d \right ) \operatorname {arctanh}\left (\frac {\left (c -d \right ) \tanh \left (\frac {x}{2}\right )}{\sqrt {\left (c +d \right ) \left (c -d \right )}}\right )}{c \sqrt {\left (c +d \right ) \left (c -d \right )}}\) | \(59\) |
risch | \(\frac {i b \ln \left ({\mathrm e}^{x}+i\right )}{c}-\frac {i b \ln \left ({\mathrm e}^{x}-i\right )}{c}+\frac {\ln \left ({\mathrm e}^{x}+\frac {\sqrt {c^{2}-d^{2}}\, c -c^{2}+d^{2}}{\sqrt {c^{2}-d^{2}}\, d}\right ) a}{\sqrt {c^{2}-d^{2}}}-\frac {\ln \left ({\mathrm e}^{x}+\frac {\sqrt {c^{2}-d^{2}}\, c -c^{2}+d^{2}}{\sqrt {c^{2}-d^{2}}\, d}\right ) b d}{\sqrt {c^{2}-d^{2}}\, c}-\frac {\ln \left ({\mathrm e}^{x}+\frac {\sqrt {c^{2}-d^{2}}\, c +c^{2}-d^{2}}{\sqrt {c^{2}-d^{2}}\, d}\right ) a}{\sqrt {c^{2}-d^{2}}}+\frac {\ln \left ({\mathrm e}^{x}+\frac {\sqrt {c^{2}-d^{2}}\, c +c^{2}-d^{2}}{\sqrt {c^{2}-d^{2}}\, d}\right ) b d}{\sqrt {c^{2}-d^{2}}\, c}\) | \(254\) |
[In]
[Out]
none
Time = 0.48 (sec) , antiderivative size = 249, normalized size of antiderivative = 4.02 \[ \int \frac {a+b \text {sech}(x)}{c+d \cosh (x)} \, dx=\left [-\frac {{\left (a c - b d\right )} \sqrt {c^{2} - d^{2}} \log \left (\frac {d^{2} \cosh \left (x\right )^{2} + d^{2} \sinh \left (x\right )^{2} + 2 \, c d \cosh \left (x\right ) + 2 \, c^{2} - d^{2} + 2 \, {\left (d^{2} \cosh \left (x\right ) + c d\right )} \sinh \left (x\right ) + 2 \, \sqrt {c^{2} - d^{2}} {\left (d \cosh \left (x\right ) + d \sinh \left (x\right ) + c\right )}}{d \cosh \left (x\right )^{2} + d \sinh \left (x\right )^{2} + 2 \, c \cosh \left (x\right ) + 2 \, {\left (d \cosh \left (x\right ) + c\right )} \sinh \left (x\right ) + d}\right ) - 2 \, {\left (b c^{2} - b d^{2}\right )} \arctan \left (\cosh \left (x\right ) + \sinh \left (x\right )\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 \left (x\right ) + d \sinh \left (x\right ) + c\right )}}{c^{2} - d^{2}}\right ) - {\left (b c^{2} - b d^{2}\right )} \arctan \left (\cosh \left (x\right ) + \sinh \left (x\right )\right )\right )}}{c^{3} - c d^{2}}\right ] \]
[In]
[Out]
\[ \int \frac {a+b \text {sech}(x)}{c+d \cosh (x)} \, dx=\int \frac {a + b \operatorname {sech}{\left (x \right )}}{c + d \cosh {\left (x \right )}}\, dx \]
[In]
[Out]
Exception generated. \[ \int \frac {a+b \text {sech}(x)}{c+d \cosh (x)} \, dx=\text {Exception raised: ValueError} \]
[In]
[Out]
none
Time = 0.27 (sec) , antiderivative size = 53, normalized size of antiderivative = 0.85 \[ \int \frac {a+b \text {sech}(x)}{c+d \cosh (x)} \, dx=\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} \]
[In]
[Out]
Time = 7.58 (sec) , antiderivative size = 636, normalized size of antiderivative = 10.26 \[ \int \frac {a+b \text {sech}(x)}{c+d \cosh (x)} \, dx=\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} \]
[In]
[Out]