Integrand size = 11, antiderivative size = 73 \[ \int \frac {\cosh (x)}{a+b \tanh (x)} \, dx=-\frac {b^2 \arctan \left (\frac {\cosh (x) (b+a \tanh (x))}{\sqrt {a^2-b^2}}\right )}{\left (a^2-b^2\right )^{3/2}}-\frac {b \cosh (x)}{a^2-b^2}+\frac {a \sinh (x)}{a^2-b^2} \]
-b^2*arctan(cosh(x)*(b+a*tanh(x))/(a^2-b^2)^(1/2))/(a^2-b^2)^(3/2)-b*cosh( x)/(a^2-b^2)+a*sinh(x)/(a^2-b^2)
Time = 0.23 (sec) , antiderivative size = 80, normalized size of antiderivative = 1.10 \[ \int \frac {\cosh (x)}{a+b \tanh (x)} \, dx=-\frac {2 b^2 \arctan \left (\frac {b+a \tanh \left (\frac {x}{2}\right )}{\sqrt {a-b} \sqrt {a+b}}\right )}{(a-b)^{3/2} (a+b)^{3/2}}+\frac {b \cosh (x)}{-a^2+b^2}+\frac {a \sinh (x)}{a^2-b^2} \]
(-2*b^2*ArcTan[(b + a*Tanh[x/2])/(Sqrt[a - b]*Sqrt[a + b])])/((a - b)^(3/2 )*(a + b)^(3/2)) + (b*Cosh[x])/(-a^2 + b^2) + (a*Sinh[x])/(a^2 - b^2)
Time = 0.48 (sec) , antiderivative size = 64, normalized size of antiderivative = 0.88, number of steps used = 9, number of rules used = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.727, Rules used = {3042, 3990, 3042, 3967, 3042, 3117, 3988, 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+b \tanh (x)} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {1}{\sec (i x) (a-i b \tan (i x))}dx\) |
\(\Big \downarrow \) 3990 |
\(\displaystyle \frac {\int \cosh (x) (a-b \tanh (x))dx}{a^2-b^2}-\frac {b^2 \int \frac {\text {sech}(x)}{a+b \tanh (x)}dx}{a^2-b^2}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {\int \frac {a+i b \tan (i x)}{\sec (i x)}dx}{a^2-b^2}-\frac {b^2 \int \frac {\sec (i x)}{a-i b \tan (i x)}dx}{a^2-b^2}\) |
\(\Big \downarrow \) 3967 |
\(\displaystyle \frac {a \int \cosh (x)dx-b \cosh (x)}{a^2-b^2}-\frac {b^2 \int \frac {\sec (i x)}{a-i b \tan (i x)}dx}{a^2-b^2}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {-b \cosh (x)+a \int \sin \left (i x+\frac {\pi }{2}\right )dx}{a^2-b^2}-\frac {b^2 \int \frac {\sec (i x)}{a-i b \tan (i x)}dx}{a^2-b^2}\) |
\(\Big \downarrow \) 3117 |
\(\displaystyle \frac {a \sinh (x)-b \cosh (x)}{a^2-b^2}-\frac {b^2 \int \frac {\sec (i x)}{a-i b \tan (i x)}dx}{a^2-b^2}\) |
\(\Big \downarrow \) 3988 |
\(\displaystyle \frac {a \sinh (x)-b \cosh (x)}{a^2-b^2}-\frac {i b^2 \int \frac {1}{a^2-b^2+\cosh ^2(x) (b+a \tanh (x))^2}d(-i \cosh (x) (b+a \tanh (x)))}{a^2-b^2}\) |
\(\Big \downarrow \) 219 |
\(\displaystyle \frac {a \sinh (x)-b \cosh (x)}{a^2-b^2}-\frac {b^2 \arctan \left (\frac {\cosh (x) (a \tanh (x)+b)}{\sqrt {a^2-b^2}}\right )}{\left (a^2-b^2\right )^{3/2}}\) |
-((b^2*ArcTan[(Cosh[x]*(b + a*Tanh[x]))/Sqrt[a^2 - b^2]])/(a^2 - b^2)^(3/2 )) + (-(b*Cosh[x]) + a*Sinh[x])/(a^2 - b^2)
3.2.13.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[sin[Pi/2 + (c_.) + (d_.)*(x_)], x_Symbol] :> Simp[Sin[c + d*x]/d, x] /; FreeQ[{c, d}, x]
Int[((d_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*( x_)]), x_Symbol] :> Simp[b*((d*Sec[e + f*x])^m/(f*m)), x] + Simp[a Int[(d *Sec[e + f*x])^m, x], x] /; FreeQ[{a, b, d, e, f, m}, x] && (IntegerQ[2*m] || NeQ[a^2 + b^2, 0])
Int[sec[(e_.) + (f_.)*(x_)]/((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbo l] :> Simp[-f^(-1) Subst[Int[1/(a^2 + b^2 - x^2), x], x, (b - a*Tan[e + f *x])/Sec[e + f*x]], x] /; FreeQ[{a, b, e, f}, x] && NeQ[a^2 + b^2, 0]
Int[sec[(e_.) + (f_.)*(x_)]^(m_)/((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]), x_ Symbol] :> Simp[1/(a^2 + b^2) Int[Sec[e + f*x]^m*(a - b*Tan[e + f*x]), x] , x] + Simp[b^2/(a^2 + b^2) Int[Sec[e + f*x]^(m + 2)/(a + b*Tan[e + f*x]) , x], x] /; FreeQ[{a, b, e, f}, x] && NeQ[a^2 + b^2, 0] && ILtQ[(m - 1)/2, 0]
Time = 0.23 (sec) , antiderivative size = 93, normalized size of antiderivative = 1.27
method | result | size |
default | \(-\frac {2 b^{2} \arctan \left (\frac {2 a \tanh \left (\frac {x}{2}\right )+2 b}{2 \sqrt {a^{2}-b^{2}}}\right )}{\left (a -b \right ) \left (a +b \right ) \sqrt {a^{2}-b^{2}}}-\frac {2}{\left (2 a -2 b \right ) \left (\tanh \left (\frac {x}{2}\right )+1\right )}-\frac {2}{\left (2 a +2 b \right ) \left (\tanh \left (\frac {x}{2}\right )-1\right )}\) | \(93\) |
risch | \(\frac {{\mathrm e}^{x}}{2 a +2 b}-\frac {{\mathrm e}^{-x}}{2 \left (a -b \right )}-\frac {b^{2} \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 {b^{2} \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 )}\) | \(122\) |
-2*b^2/(a-b)/(a+b)/(a^2-b^2)^(1/2)*arctan(1/2*(2*a*tanh(1/2*x)+2*b)/(a^2-b ^2)^(1/2))-2/(2*a-2*b)/(tanh(1/2*x)+1)-2/(2*a+2*b)/(tanh(1/2*x)-1)
Leaf count of result is larger than twice the leaf count of optimal. 190 vs. \(2 (69) = 138\).
Time = 0.27 (sec) , antiderivative size = 435, normalized size of antiderivative = 5.96 \[ \int \frac {\cosh (x)}{a+b \tanh (x)} \, dx=\left [-\frac {a^{3} + a^{2} b - a b^{2} - b^{3} - {\left (a^{3} - a^{2} b - a b^{2} + b^{3}\right )} \cosh \left (x\right )^{2} - 2 \, {\left (a^{3} - a^{2} b - a b^{2} + b^{3}\right )} \cosh \left (x\right ) \sinh \left (x\right ) - {\left (a^{3} - a^{2} b - a b^{2} + b^{3}\right )} \sinh \left (x\right )^{2} - 2 \, {\left (b^{2} \cosh \left (x\right ) + b^{2} \sinh \left (x\right )\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 ({\left (a^{4} - 2 \, a^{2} b^{2} + b^{4}\right )} \cosh \left (x\right ) + {\left (a^{4} - 2 \, a^{2} b^{2} + b^{4}\right )} \sinh \left (x\right )\right )}}, -\frac {a^{3} + a^{2} b - a b^{2} - b^{3} - {\left (a^{3} - a^{2} b - a b^{2} + b^{3}\right )} \cosh \left (x\right )^{2} - 2 \, {\left (a^{3} - a^{2} b - a b^{2} + b^{3}\right )} \cosh \left (x\right ) \sinh \left (x\right ) - {\left (a^{3} - a^{2} b - a b^{2} + b^{3}\right )} \sinh \left (x\right )^{2} - 4 \, {\left (b^{2} \cosh \left (x\right ) + b^{2} \sinh \left (x\right )\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 )}{2 \, {\left ({\left (a^{4} - 2 \, a^{2} b^{2} + b^{4}\right )} \cosh \left (x\right ) + {\left (a^{4} - 2 \, a^{2} b^{2} + b^{4}\right )} \sinh \left (x\right )\right )}}\right ] \]
[-1/2*(a^3 + a^2*b - a*b^2 - b^3 - (a^3 - a^2*b - a*b^2 + b^3)*cosh(x)^2 - 2*(a^3 - a^2*b - a*b^2 + b^3)*cosh(x)*sinh(x) - (a^3 - a^2*b - a*b^2 + b^ 3)*sinh(x)^2 - 2*(b^2*cosh(x) + b^2*sinh(x))*sqrt(-a^2 + b^2)*log(((a + b) *cosh(x)^2 + 2*(a + b)*cosh(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)))/((a^4 - 2*a^2*b^2 + b^4)*cosh(x) + (a^4 - 2*a^2*b^2 + b^4)*sinh(x)), -1/2*(a^3 + a^2*b - a*b^2 - b^3 - (a^3 - a^2*b - a*b^2 + b^3)*cosh(x)^2 - 2*(a^3 - a^2*b - a*b^2 + b^3)*cosh(x)*si nh(x) - (a^3 - a^2*b - a*b^2 + b^3)*sinh(x)^2 - 4*(b^2*cosh(x) + b^2*sinh( x))*sqrt(a^2 - b^2)*arctan(sqrt(a^2 - b^2)/((a + b)*cosh(x) + (a + b)*sinh (x))))/((a^4 - 2*a^2*b^2 + b^4)*cosh(x) + (a^4 - 2*a^2*b^2 + b^4)*sinh(x)) ]
\[ \int \frac {\cosh (x)}{a+b \tanh (x)} \, dx=\int \frac {\cosh {\left (x \right )}}{a + b \tanh {\left (x \right )}}\, dx \]
Exception generated. \[ \int \frac {\cosh (x)}{a+b \tanh (x)} \, 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.25 (sec) , antiderivative size = 61, normalized size of antiderivative = 0.84 \[ \int \frac {\cosh (x)}{a+b \tanh (x)} \, dx=-\frac {2 \, b^{2} \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 {e^{\left (-x\right )}}{2 \, {\left (a - b\right )}} + \frac {e^{x}}{2 \, {\left (a + b\right )}} \]
-2*b^2*arctan((a*e^x + b*e^x)/sqrt(a^2 - b^2))/(a^2 - b^2)^(3/2) - 1/2*e^( -x)/(a - b) + 1/2*e^x/(a + b)
Time = 1.93 (sec) , antiderivative size = 157, normalized size of antiderivative = 2.15 \[ \int \frac {\cosh (x)}{a+b \tanh (x)} \, dx=\frac {{\mathrm {e}}^x}{2\,a+2\,b}-\frac {{\mathrm {e}}^{-x}}{2\,a-2\,b}-\frac {b^2\,\ln \left (-\frac {2\,b^2}{{\left (a+b\right )}^{5/2}\,\sqrt {b-a}}-\frac {2\,b^2\,{\mathrm {e}}^x}{-a^3-a^2\,b+a\,b^2+b^3}\right )}{{\left (a+b\right )}^{3/2}\,{\left (b-a\right )}^{3/2}}+\frac {b^2\,\ln \left (\frac {2\,b^2}{{\left (a+b\right )}^{5/2}\,\sqrt {b-a}}-\frac {2\,b^2\,{\mathrm {e}}^x}{-a^3-a^2\,b+a\,b^2+b^3}\right )}{{\left (a+b\right )}^{3/2}\,{\left (b-a\right )}^{3/2}} \]
exp(x)/(2*a + 2*b) - exp(-x)/(2*a - 2*b) - (b^2*log(- (2*b^2)/((a + b)^(5/ 2)*(b - a)^(1/2)) - (2*b^2*exp(x))/(a*b^2 - a^2*b - a^3 + b^3)))/((a + b)^ (3/2)*(b - a)^(3/2)) + (b^2*log((2*b^2)/((a + b)^(5/2)*(b - a)^(1/2)) - (2 *b^2*exp(x))/(a*b^2 - a^2*b - a^3 + b^3)))/((a + b)^(3/2)*(b - a)^(3/2))