Integrand size = 14, antiderivative size = 64 \[ \int \frac {\cosh (x)}{(a \cosh (x)+b \sinh (x))^2} \, dx=\frac {a \arctan \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))} \]
a*arctan((b*cosh(x)+a*sinh(x))/(a^2-b^2)^(1/2))/(a^2-b^2)^(3/2)+b/(a^2-b^2 )/(a*cosh(x)+b*sinh(x))
Time = 0.10 (sec) , antiderivative size = 124, normalized size of antiderivative = 1.94 \[ \int \frac {\cosh (x)}{(a \cosh (x)+b \sinh (x))^2} \, dx=\frac {\sqrt {a-b} b (a+b)+2 a^2 \sqrt {a+b} \arctan \left (\frac {b+a \tanh \left (\frac {x}{2}\right )}{\sqrt {a-b} \sqrt {a+b}}\right ) \cosh (x)+2 a b \sqrt {a+b} \arctan \left (\frac {b+a \tanh \left (\frac {x}{2}\right )}{\sqrt {a-b} \sqrt {a+b}}\right ) \sinh (x)}{(a-b)^{3/2} (a+b)^2 (a \cosh (x)+b \sinh (x))} \]
(Sqrt[a - b]*b*(a + b) + 2*a^2*Sqrt[a + b]*ArcTan[(b + a*Tanh[x/2])/(Sqrt[ a - b]*Sqrt[a + b])]*Cosh[x] + 2*a*b*Sqrt[a + b]*ArcTan[(b + a*Tanh[x/2])/ (Sqrt[a - b]*Sqrt[a + b])]*Sinh[x])/((a - b)^(3/2)*(a + b)^2*(a*Cosh[x] + b*Sinh[x]))
Result contains complex when optimal does not.
Time = 0.30 (sec) , antiderivative size = 73, normalized size of antiderivative = 1.14, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.357, Rules used = {3042, 3634, 3042, 3553, 219}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \frac {\cosh (x)}{(a \cosh (x)+b \sinh (x))^2} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\cos (i x)}{(a \cos (i x)-i b \sin (i x))^2}dx\) |
\(\Big \downarrow \) 3634 |
\(\displaystyle \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))}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {b}{\left (a^2-b^2\right ) (a \cosh (x)+b \sinh (x))}+\frac {a \int \frac {1}{a \cos (i x)-i b \sin (i x)}dx}{a^2-b^2}\) |
\(\Big \downarrow \) 3553 |
\(\displaystyle \frac {b}{\left (a^2-b^2\right ) (a \cosh (x)+b \sinh (x))}+\frac {i a \int \frac {1}{a^2-b^2-(-i b \cosh (x)-i a \sinh (x))^2}d(-i b \cosh (x)-i a \sinh (x))}{a^2-b^2}\) |
\(\Big \downarrow \) 219 |
\(\displaystyle \frac {b}{\left (a^2-b^2\right ) (a \cosh (x)+b \sinh (x))}+\frac {i a \text {arctanh}\left (\frac {-i a \sinh (x)-i b \cosh (x)}{\sqrt {a^2-b^2}}\right )}{\left (a^2-b^2\right )^{3/2}}\) |
(I*a*ArcTanh[((-I)*b*Cosh[x] - I*a*Sinh[x])/Sqrt[a^2 - b^2]])/(a^2 - b^2)^ (3/2) + b/((a^2 - b^2)*(a*Cosh[x] + b*Sinh[x]))
3.7.99.3.1 Defintions of rubi rules used
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))* ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x] /; FreeQ[{a, b}, x] && NegQ[a/b] && (Gt Q[a, 0] || LtQ[b, 0])
Int[(cos[(c_.) + (d_.)*(x_)]*(a_.) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(-1), x _Symbol] :> Simp[-d^(-1) Subst[Int[1/(a^2 + b^2 - x^2), x], x, b*Cos[c + d*x] - a*Sin[c + d*x]], x] /; FreeQ[{a, b, c, d}, x] && NeQ[a^2 + b^2, 0]
Int[((A_.) + cos[(d_.) + (e_.)*(x_)]*(B_.))/((a_.) + cos[(d_.) + (e_.)*(x_) ]*(b_.) + (c_.)*sin[(d_.) + (e_.)*(x_)])^2, x_Symbol] :> Simp[(c*B + c*A*Co s[d + e*x] + (a*B - b*A)*Sin[d + e*x])/(e*(a^2 - b^2 - c^2)*(a + b*Cos[d + e*x] + c*Sin[d + e*x])), x] + Simp[(a*A - b*B)/(a^2 - b^2 - c^2) Int[1/(a + b*Cos[d + e*x] + c*Sin[d + e*x]), x], x] /; FreeQ[{a, b, c, d, e, A, B}, x] && NeQ[a^2 - b^2 - c^2, 0] && NeQ[a*A - b*B, 0]
Time = 1.09 (sec) , antiderivative size = 98, normalized size of antiderivative = 1.53
method | result | size |
default | \(\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}}}{\tanh \left (\frac {x}{2}\right )^{2} a +2 b \tanh \left (\frac {x}{2}\right )+a}+\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}}}\) | \(98\) |
risch | \(\frac {2 b \,{\mathrm e}^{x}}{\left (a -b \right ) \left (a +b \right ) \left (a \,{\mathrm e}^{2 x}+b \,{\mathrm e}^{2 x}+a -b \right )}-\frac {a \ln \left ({\mathrm e}^{x}-\frac {a -b}{\sqrt {-a^{2}+b^{2}}}\right )}{\sqrt {-a^{2}+b^{2}}\, \left (a +b \right ) \left (a -b \right )}+\frac {a \ln \left ({\mathrm e}^{x}+\frac {a -b}{\sqrt {-a^{2}+b^{2}}}\right )}{\sqrt {-a^{2}+b^{2}}\, \left (a +b \right ) \left (a -b \right )}\) | \(132\) |
2*(b^2/a/(a^2-b^2)*tanh(1/2*x)+b/(a^2-b^2))/(tanh(1/2*x)^2*a+2*b*tanh(1/2* x)+a)+2/(a^2-b^2)^(3/2)*a*arctan(1/2*(2*a*tanh(1/2*x)+2*b)/(a^2-b^2)^(1/2) )
Leaf count of result is larger than twice the leaf count of optimal. 271 vs. \(2 (60) = 120\).
Time = 0.26 (sec) , antiderivative size = 596, normalized size of antiderivative = 9.31 \[ \int \frac {\cosh (x)}{(a \cosh (x)+b \sinh (x))^2} \, dx=\left [\frac {{\left ({\left (a^{2} + a b\right )} \cosh \left (x\right )^{2} + 2 \, {\left (a^{2} + a b\right )} \cosh \left (x\right ) \sinh \left (x\right ) + {\left (a^{2} + a b\right )} \sinh \left (x\right )^{2} + a^{2} - a b\right )} \sqrt {-a^{2} + b^{2}} \log \left (\frac {{\left (a + b\right )} \cosh \left (x\right )^{2} + 2 \, {\left (a + b\right )} \cosh \left (x\right ) \sinh \left (x\right ) + {\left (a + b\right )} \sinh \left (x\right )^{2} + 2 \, \sqrt {-a^{2} + b^{2}} {\left (\cosh \left (x\right ) + \sinh \left (x\right )\right )} - a + b}{{\left (a + b\right )} \cosh \left (x\right )^{2} + 2 \, {\left (a + b\right )} \cosh \left (x\right ) \sinh \left (x\right ) + {\left (a + b\right )} \sinh \left (x\right )^{2} + a - b}\right ) + 2 \, {\left (a^{2} b - b^{3}\right )} \cosh \left (x\right ) + 2 \, {\left (a^{2} b - b^{3}\right )} \sinh \left (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 \left (x\right )^{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 \left (x\right ) \sinh \left (x\right ) + {\left (a^{5} + a^{4} b - 2 \, a^{3} b^{2} - 2 \, a^{2} b^{3} + a b^{4} + b^{5}\right )} \sinh \left (x\right )^{2}}, -\frac {2 \, {\left ({\left ({\left (a^{2} + a b\right )} \cosh \left (x\right )^{2} + 2 \, {\left (a^{2} + a b\right )} \cosh \left (x\right ) \sinh \left (x\right ) + {\left (a^{2} + a b\right )} \sinh \left (x\right )^{2} + a^{2} - a b\right )} \sqrt {a^{2} - b^{2}} \arctan \left (\frac {\sqrt {a^{2} - b^{2}}}{{\left (a + b\right )} \cosh \left (x\right ) + {\left (a + b\right )} \sinh \left (x\right )}\right ) - {\left (a^{2} b - b^{3}\right )} \cosh \left (x\right ) - {\left (a^{2} b - b^{3}\right )} \sinh \left (x\right )\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 \left (x\right )^{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 \left (x\right ) \sinh \left (x\right ) + {\left (a^{5} + a^{4} b - 2 \, a^{3} b^{2} - 2 \, a^{2} b^{3} + a b^{4} + b^{5}\right )} \sinh \left (x\right )^{2}}\right ] \]
[(((a^2 + a*b)*cosh(x)^2 + 2*(a^2 + a*b)*cosh(x)*sinh(x) + (a^2 + a*b)*sin h(x)^2 + a^2 - a*b)*sqrt(-a^2 + b^2)*log(((a + b)*cosh(x)^2 + 2*(a + b)*co sh(x)*sinh(x) + (a + b)*sinh(x)^2 + 2*sqrt(-a^2 + b^2)*(cosh(x) + sinh(x)) - a + b)/((a + b)*cosh(x)^2 + 2*(a + b)*cosh(x)*sinh(x) + (a + b)*sinh(x) ^2 + a - b)) + 2*(a^2*b - b^3)*cosh(x) + 2*(a^2*b - b^3)*sinh(x))/(a^5 - a ^4*b - 2*a^3*b^2 + 2*a^2*b^3 + a*b^4 - b^5 + (a^5 + a^4*b - 2*a^3*b^2 - 2* a^2*b^3 + a*b^4 + b^5)*cosh(x)^2 + 2*(a^5 + a^4*b - 2*a^3*b^2 - 2*a^2*b^3 + a*b^4 + b^5)*cosh(x)*sinh(x) + (a^5 + a^4*b - 2*a^3*b^2 - 2*a^2*b^3 + a* b^4 + b^5)*sinh(x)^2), -2*(((a^2 + a*b)*cosh(x)^2 + 2*(a^2 + a*b)*cosh(x)* sinh(x) + (a^2 + a*b)*sinh(x)^2 + a^2 - a*b)*sqrt(a^2 - b^2)*arctan(sqrt(a ^2 - b^2)/((a + b)*cosh(x) + (a + b)*sinh(x))) - (a^2*b - b^3)*cosh(x) - ( a^2*b - b^3)*sinh(x))/(a^5 - a^4*b - 2*a^3*b^2 + 2*a^2*b^3 + a*b^4 - b^5 + (a^5 + a^4*b - 2*a^3*b^2 - 2*a^2*b^3 + a*b^4 + b^5)*cosh(x)^2 + 2*(a^5 + a^4*b - 2*a^3*b^2 - 2*a^2*b^3 + a*b^4 + b^5)*cosh(x)*sinh(x) + (a^5 + a^4* b - 2*a^3*b^2 - 2*a^2*b^3 + a*b^4 + b^5)*sinh(x)^2)]
Timed out. \[ \int \frac {\cosh (x)}{(a \cosh (x)+b \sinh (x))^2} \, dx=\text {Timed out} \]
Exception generated. \[ \int \frac {\cosh (x)}{(a \cosh (x)+b \sinh (x))^2} \, dx=\text {Exception raised: ValueError} \]
Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'assume' command before evaluation *may* help (example of legal syntax is 'assume(4*b^2-4*a^2>0)', see `assume?` f or more de
Time = 0.26 (sec) , antiderivative size = 72, normalized size of antiderivative = 1.12 \[ \int \frac {\cosh (x)}{(a \cosh (x)+b \sinh (x))^2} \, dx=\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 )}} \]
2*a*arctan((a*e^x + b*e^x)/sqrt(a^2 - b^2))/(a^2 - b^2)^(3/2) + 2*b*e^x/(( a^2 - b^2)*(a*e^(2*x) + b*e^(2*x) + a - b))
Time = 2.42 (sec) , antiderivative size = 183, normalized size of antiderivative = 2.86 \[ \int \frac {\cosh (x)}{(a \cosh (x)+b \sinh (x))^2} \, dx=\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 )} \]
(2*atan((exp(x)*(a^2*(a^6 - b^6 + 3*a^2*b^4 - 3*a^4*b^2)^(1/2) + a*b*(a^6 - b^6 + 3*a^2*b^4 - 3*a^4*b^2)^(1/2)))/(a^4*(a^2)^(1/2) - 2*b^2*(a^2)^(3/2 ) + b^4*(a^2)^(1/2) + a*b*(a^2)^(3/2) - a^3*b*(a^2)^(1/2)))*(a^2)^(1/2))/( a^6 - b^6 + 3*a^2*b^4 - 3*a^4*b^2)^(1/2) + (2*b*exp(x))/((a + b)*(a - b)*( a - b + exp(2*x)*(a + b)))