Integrand size = 17, antiderivative size = 74 \[ \int \frac {a+b \text {sech}^2(x)}{c+d \cosh (x)} \, dx=-\frac {b d \arctan (\sinh (x))}{c^2}+\frac {2 \left (a c^2+b d^2\right ) \text {arctanh}\left (\frac {\sqrt {c-d} \tanh \left (\frac {x}{2}\right )}{\sqrt {c+d}}\right )}{c^2 \sqrt {c-d} \sqrt {c+d}}+\frac {b \tanh (x)}{c} \]
[Out]
Time = 0.19 (sec) , antiderivative size = 74, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.353, Rules used = {4319, 3135, 3080, 3855, 2738, 214} \[ \int \frac {a+b \text {sech}^2(x)}{c+d \cosh (x)} \, dx=\frac {2 \left (a c^2+b d^2\right ) \text {arctanh}\left (\frac {\sqrt {c-d} \tanh \left (\frac {x}{2}\right )}{\sqrt {c+d}}\right )}{c^2 \sqrt {c-d} \sqrt {c+d}}-\frac {b d \arctan (\sinh (x))}{c^2}+\frac {b \tanh (x)}{c} \]
[In]
[Out]
Rule 214
Rule 2738
Rule 3080
Rule 3135
Rule 3855
Rule 4319
Rubi steps \begin{align*} \text {integral}& = \int \frac {\left (b+a \cosh ^2(x)\right ) \text {sech}^2(x)}{c+d \cosh (x)} \, dx \\ & = \frac {b \tanh (x)}{c}+\frac {\int \frac {(-b d+a c \cosh (x)) \text {sech}(x)}{c+d \cosh (x)} \, dx}{c} \\ & = \frac {b \tanh (x)}{c}-\frac {(b d) \int \text {sech}(x) \, dx}{c^2}+\left (a+\frac {b d^2}{c^2}\right ) \int \frac {1}{c+d \cosh (x)} \, dx \\ & = -\frac {b d \arctan (\sinh (x))}{c^2}+\frac {b \tanh (x)}{c}+\left (2 \left (a+\frac {b d^2}{c^2}\right )\right ) \text {Subst}\left (\int \frac {1}{c+d-(c-d) x^2} \, dx,x,\tanh \left (\frac {x}{2}\right )\right ) \\ & = -\frac {b d \arctan (\sinh (x))}{c^2}+\frac {2 \left (a+\frac {b d^2}{c^2}\right ) \text {arctanh}\left (\frac {\sqrt {c-d} \tanh \left (\frac {x}{2}\right )}{\sqrt {c+d}}\right )}{\sqrt {c-d} \sqrt {c+d}}+\frac {b \tanh (x)}{c} \\ \end{align*}
Time = 0.63 (sec) , antiderivative size = 127, normalized size of antiderivative = 1.72 \[ \int \frac {a+b \text {sech}^2(x)}{c+d \cosh (x)} \, dx=-\frac {2 \left (b+a \cosh ^2(x)\right ) \text {sech}(x) \left (2 \left (b d \sqrt {-c^2+d^2} \arctan \left (\tanh \left (\frac {x}{2}\right )\right )+\left (a c^2+b d^2\right ) \arctan \left (\frac {(c-d) \tanh \left (\frac {x}{2}\right )}{\sqrt {-c^2+d^2}}\right )\right ) \cosh (x)-b c \sqrt {-c^2+d^2} \sinh (x)\right )}{c^2 \sqrt {-c^2+d^2} (a+2 b+a \cosh (2 x))} \]
[In]
[Out]
Time = 0.60 (sec) , antiderivative size = 84, normalized size of antiderivative = 1.14
method | result | size |
default | \(-\frac {2 \left (-a \,c^{2}-b \,d^{2}\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^{2} \sqrt {\left (c +d \right ) \left (c -d \right )}}-\frac {2 b \left (-\frac {c \tanh \left (\frac {x}{2}\right )}{1+\tanh \left (\frac {x}{2}\right )^{2}}+d \arctan \left (\tanh \left (\frac {x}{2}\right )\right )\right )}{c^{2}}\) | \(84\) |
risch | \(-\frac {2 b}{c \left (1+{\mathrm e}^{2 x}\right )}+\frac {i b d \ln \left ({\mathrm e}^{x}-i\right )}{c^{2}}-\frac {i b d \ln \left ({\mathrm e}^{x}+i\right )}{c^{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 ) 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^{2}}{\sqrt {c^{2}-d^{2}}\, c^{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 ) 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^{2}}{\sqrt {c^{2}-d^{2}}\, c^{2}}\) | \(274\) |
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 263 vs. \(2 (64) = 128\).
Time = 0.48 (sec) , antiderivative size = 598, normalized size of antiderivative = 8.08 \[ \int \frac {a+b \text {sech}^2(x)}{c+d \cosh (x)} \, dx=\left [-\frac {2 \, b c^{3} - 2 \, b c d^{2} - {\left (a c^{2} + b d^{2} + {\left (a c^{2} + b d^{2}\right )} \cosh \left (x\right )^{2} + 2 \, {\left (a c^{2} + b d^{2}\right )} \cosh \left (x\right ) \sinh \left (x\right ) + {\left (a c^{2} + b d^{2}\right )} \sinh \left (x\right )^{2}\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} d - b d^{3} + {\left (b c^{2} d - b d^{3}\right )} \cosh \left (x\right )^{2} + 2 \, {\left (b c^{2} d - b d^{3}\right )} \cosh \left (x\right ) \sinh \left (x\right ) + {\left (b c^{2} d - b d^{3}\right )} \sinh \left (x\right )^{2}\right )} \arctan \left (\cosh \left (x\right ) + \sinh \left (x\right )\right )}{c^{4} - c^{2} d^{2} + {\left (c^{4} - c^{2} d^{2}\right )} \cosh \left (x\right )^{2} + 2 \, {\left (c^{4} - c^{2} d^{2}\right )} \cosh \left (x\right ) \sinh \left (x\right ) + {\left (c^{4} - c^{2} d^{2}\right )} \sinh \left (x\right )^{2}}, -\frac {2 \, {\left (b c^{3} - b c d^{2} + {\left (a c^{2} + b d^{2} + {\left (a c^{2} + b d^{2}\right )} \cosh \left (x\right )^{2} + 2 \, {\left (a c^{2} + b d^{2}\right )} \cosh \left (x\right ) \sinh \left (x\right ) + {\left (a c^{2} + b d^{2}\right )} \sinh \left (x\right )^{2}\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} d - b d^{3} + {\left (b c^{2} d - b d^{3}\right )} \cosh \left (x\right )^{2} + 2 \, {\left (b c^{2} d - b d^{3}\right )} \cosh \left (x\right ) \sinh \left (x\right ) + {\left (b c^{2} d - b d^{3}\right )} \sinh \left (x\right )^{2}\right )} \arctan \left (\cosh \left (x\right ) + \sinh \left (x\right )\right )\right )}}{c^{4} - c^{2} d^{2} + {\left (c^{4} - c^{2} d^{2}\right )} \cosh \left (x\right )^{2} + 2 \, {\left (c^{4} - c^{2} d^{2}\right )} \cosh \left (x\right ) \sinh \left (x\right ) + {\left (c^{4} - c^{2} d^{2}\right )} \sinh \left (x\right )^{2}}\right ] \]
[In]
[Out]
\[ \int \frac {a+b \text {sech}^2(x)}{c+d \cosh (x)} \, dx=\int \frac {a + b \operatorname {sech}^{2}{\left (x \right )}}{c + d \cosh {\left (x \right )}}\, dx \]
[In]
[Out]
Exception generated. \[ \int \frac {a+b \text {sech}^2(x)}{c+d \cosh (x)} \, dx=\text {Exception raised: ValueError} \]
[In]
[Out]
none
Time = 0.26 (sec) , antiderivative size = 71, normalized size of antiderivative = 0.96 \[ \int \frac {a+b \text {sech}^2(x)}{c+d \cosh (x)} \, dx=-\frac {2 \, b d \arctan \left (e^{x}\right )}{c^{2}} + \frac {2 \, {\left (a c^{2} + b d^{2}\right )} \arctan \left (\frac {d e^{x} + c}{\sqrt {-c^{2} + d^{2}}}\right )}{\sqrt {-c^{2} + d^{2}} c^{2}} - \frac {2 \, b}{c {\left (e^{\left (2 \, x\right )} + 1\right )}} \]
[In]
[Out]
Time = 8.07 (sec) , antiderivative size = 704, normalized size of antiderivative = 9.51 \[ \int \frac {a+b \text {sech}^2(x)}{c+d \cosh (x)} \, dx=\frac {\ln \left (\frac {\sqrt {\left (c+d\right )\,\left (c-d\right )}\,\left (\frac {32\,\left (a^2\,c^4+2\,a\,b\,c^2\,d^2-4\,{\mathrm {e}}^x\,b^2\,c^3\,d-2\,b^2\,c^2\,d^2+3\,{\mathrm {e}}^x\,b^2\,c\,d^3+2\,b^2\,d^4\right )}{c^2\,d^4}-\frac {\sqrt {\left (c+d\right )\,\left (c-d\right )}\,\left (a\,c^2+b\,d^2\right )\,\left (\frac {32\,c\,\left (2\,b\,d^3+4\,a\,c^3\,{\mathrm {e}}^x+2\,a\,c^2\,d-a\,c\,d^2\,{\mathrm {e}}^x+3\,b\,c\,d^2\,{\mathrm {e}}^x\right )}{d^5}+\frac {32\,\sqrt {\left (c+d\right )\,\left (c-d\right )}\,\left (a\,c^2+b\,d^2\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^2-d^2\right )}\right )}{c^2\,\left (c^2-d^2\right )}\right )\,\left (a\,c^2+b\,d^2\right )}{c^2\,\left (c^2-d^2\right )}-\frac {32\,b\,\left (a\,c^2+b\,d^2\right )\,\left (2\,b\,d+a\,c\,{\mathrm {e}}^x+4\,b\,c\,{\mathrm {e}}^x\right )}{c^3\,d^3}\right )\,\sqrt {\left (c+d\right )\,\left (c-d\right )}\,\left (a\,c^2+b\,d^2\right )}{c^4-c^2\,d^2}-\frac {2\,b}{c\,\left ({\mathrm {e}}^{2\,x}+1\right )}-\frac {\ln \left (-\frac {32\,b\,\left (a\,c^2+b\,d^2\right )\,\left (2\,b\,d+a\,c\,{\mathrm {e}}^x+4\,b\,c\,{\mathrm {e}}^x\right )}{c^3\,d^3}-\frac {\sqrt {\left (c+d\right )\,\left (c-d\right )}\,\left (\frac {32\,\left (a^2\,c^4+2\,a\,b\,c^2\,d^2-4\,{\mathrm {e}}^x\,b^2\,c^3\,d-2\,b^2\,c^2\,d^2+3\,{\mathrm {e}}^x\,b^2\,c\,d^3+2\,b^2\,d^4\right )}{c^2\,d^4}+\frac {\sqrt {\left (c+d\right )\,\left (c-d\right )}\,\left (a\,c^2+b\,d^2\right )\,\left (\frac {32\,c\,\left (2\,b\,d^3+4\,a\,c^3\,{\mathrm {e}}^x+2\,a\,c^2\,d-a\,c\,d^2\,{\mathrm {e}}^x+3\,b\,c\,d^2\,{\mathrm {e}}^x\right )}{d^5}-\frac {32\,\sqrt {\left (c+d\right )\,\left (c-d\right )}\,\left (a\,c^2+b\,d^2\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^2-d^2\right )}\right )}{c^2\,\left (c^2-d^2\right )}\right )\,\left (a\,c^2+b\,d^2\right )}{c^2\,\left (c^2-d^2\right )}\right )\,\sqrt {\left (c+d\right )\,\left (c-d\right )}\,\left (a\,c^2+b\,d^2\right )}{c^4-c^2\,d^2}+\frac {b\,d\,\ln \left ({\mathrm {e}}^x-\mathrm {i}\right )\,1{}\mathrm {i}}{c^2}-\frac {b\,d\,\ln \left ({\mathrm {e}}^x+1{}\mathrm {i}\right )\,1{}\mathrm {i}}{c^2} \]
[In]
[Out]