Integrand size = 21, antiderivative size = 68 \[ \int \frac {\cosh ^2(c+d x)}{a+b \sinh (c+d x)} \, dx=-\frac {a x}{b^2}-\frac {2 \sqrt {a^2+b^2} \text {arctanh}\left (\frac {b-a \tanh \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a^2+b^2}}\right )}{b^2 d}+\frac {\cosh (c+d x)}{b d} \] Output:
-a*x/b^2-2*(a^2+b^2)^(1/2)*arctanh((b-a*tanh(1/2*d*x+1/2*c))/(a^2+b^2)^(1/ 2))/b^2/d+cosh(d*x+c)/b/d
Result contains complex when optimal does not.
Time = 0.99 (sec) , antiderivative size = 458, normalized size of antiderivative = 6.74 \[ \int \frac {\cosh ^2(c+d x)}{a+b \sinh (c+d x)} \, dx=\frac {\cosh (c+d x) \left (-2 \sqrt {a-i b} \sqrt {a+i b} \text {arctanh}\left (\frac {\sqrt {-\frac {b (i+\sinh (c+d x))}{a-i b}}}{\sqrt {-\frac {b (-i+\sinh (c+d x))}{a+i b}}}\right ) \sqrt {1+i \sinh (c+d x)}+2 (a-i b) \text {arctanh}\left (\frac {\sqrt {a-i b} \sqrt {-\frac {b (i+\sinh (c+d x))}{a-i b}}}{\sqrt {a+i b} \sqrt {-\frac {b (-i+\sinh (c+d x))}{a+i b}}}\right ) \sqrt {1+i \sinh (c+d x)}+\sqrt {a+i b} \sqrt {-\frac {b (-i+\sinh (c+d x))}{a+i b}} \left (-2 (-1)^{3/4} \sqrt {b} \arcsin \left (\frac {\sqrt [4]{-1} \sqrt {a-i b} \sqrt {-\frac {b (i+\sinh (c+d x))}{a-i b}}}{\sqrt {2} \sqrt {b}}\right )+\sqrt {a-i b} \sqrt {1+i \sinh (c+d x)} \sqrt {-\frac {b (i+\sinh (c+d x))}{a-i b}}\right )\right )}{\sqrt {a-i b} \sqrt {a+i b} b d \sqrt {1+i \sinh (c+d x)} \sqrt {-\frac {b (-i+\sinh (c+d x))}{a+i b}} \sqrt {-\frac {b (i+\sinh (c+d x))}{a-i b}}} \] Input:
Integrate[Cosh[c + d*x]^2/(a + b*Sinh[c + d*x]),x]
Output:
(Cosh[c + d*x]*(-2*Sqrt[a - I*b]*Sqrt[a + I*b]*ArcTanh[Sqrt[-((b*(I + Sinh [c + d*x]))/(a - I*b))]/Sqrt[-((b*(-I + Sinh[c + d*x]))/(a + I*b))]]*Sqrt[ 1 + I*Sinh[c + d*x]] + 2*(a - I*b)*ArcTanh[(Sqrt[a - I*b]*Sqrt[-((b*(I + S inh[c + d*x]))/(a - I*b))])/(Sqrt[a + I*b]*Sqrt[-((b*(-I + Sinh[c + d*x])) /(a + I*b))])]*Sqrt[1 + I*Sinh[c + d*x]] + Sqrt[a + I*b]*Sqrt[-((b*(-I + S inh[c + d*x]))/(a + I*b))]*(-2*(-1)^(3/4)*Sqrt[b]*ArcSin[((-1)^(1/4)*Sqrt[ a - I*b]*Sqrt[-((b*(I + Sinh[c + d*x]))/(a - I*b))])/(Sqrt[2]*Sqrt[b])] + Sqrt[a - I*b]*Sqrt[1 + I*Sinh[c + d*x]]*Sqrt[-((b*(I + Sinh[c + d*x]))/(a - I*b))])))/(Sqrt[a - I*b]*Sqrt[a + I*b]*b*d*Sqrt[1 + I*Sinh[c + d*x]]*Sqr t[-((b*(-I + Sinh[c + d*x]))/(a + I*b))]*Sqrt[-((b*(I + Sinh[c + d*x]))/(a - I*b))])
Time = 0.47 (sec) , antiderivative size = 71, normalized size of antiderivative = 1.04, number of steps used = 10, number of rules used = 9, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.429, Rules used = {3042, 3174, 26, 3042, 3214, 3042, 3139, 1083, 217}
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 ^2(c+d x)}{a+b \sinh (c+d x)} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\cos (i c+i d x)^2}{a-i b \sin (i c+i d x)}dx\) |
\(\Big \downarrow \) 3174 |
\(\displaystyle \frac {\cosh (c+d x)}{b d}+\frac {i \int -\frac {i (b-a \sinh (c+d x))}{a+b \sinh (c+d x)}dx}{b}\) |
\(\Big \downarrow \) 26 |
\(\displaystyle \frac {\int \frac {b-a \sinh (c+d x)}{a+b \sinh (c+d x)}dx}{b}+\frac {\cosh (c+d x)}{b d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {\cosh (c+d x)}{b d}+\frac {\int \frac {b+i a \sin (i c+i d x)}{a-i b \sin (i c+i d x)}dx}{b}\) |
\(\Big \downarrow \) 3214 |
\(\displaystyle \frac {\frac {\left (a^2+b^2\right ) \int \frac {1}{a+b \sinh (c+d x)}dx}{b}-\frac {a x}{b}}{b}+\frac {\cosh (c+d x)}{b d}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {\cosh (c+d x)}{b d}+\frac {-\frac {a x}{b}+\frac {\left (a^2+b^2\right ) \int \frac {1}{a-i b \sin (i c+i d x)}dx}{b}}{b}\) |
\(\Big \downarrow \) 3139 |
\(\displaystyle \frac {\cosh (c+d x)}{b d}+\frac {-\frac {a x}{b}-\frac {2 i \left (a^2+b^2\right ) \int \frac {1}{-a \tanh ^2\left (\frac {1}{2} (c+d x)\right )+2 b \tanh \left (\frac {1}{2} (c+d x)\right )+a}d\left (i \tanh \left (\frac {1}{2} (c+d x)\right )\right )}{b d}}{b}\) |
\(\Big \downarrow \) 1083 |
\(\displaystyle \frac {\cosh (c+d x)}{b d}+\frac {-\frac {a x}{b}+\frac {4 i \left (a^2+b^2\right ) \int \frac {1}{\tanh ^2\left (\frac {1}{2} (c+d x)\right )-4 \left (a^2+b^2\right )}d\left (2 i a \tanh \left (\frac {1}{2} (c+d x)\right )-2 i b\right )}{b d}}{b}\) |
\(\Big \downarrow \) 217 |
\(\displaystyle \frac {\frac {2 \sqrt {a^2+b^2} \text {arctanh}\left (\frac {\tanh \left (\frac {1}{2} (c+d x)\right )}{2 \sqrt {a^2+b^2}}\right )}{b d}-\frac {a x}{b}}{b}+\frac {\cosh (c+d x)}{b d}\) |
Input:
Int[Cosh[c + d*x]^2/(a + b*Sinh[c + d*x]),x]
Output:
(-((a*x)/b) + (2*Sqrt[a^2 + b^2]*ArcTanh[Tanh[(c + d*x)/2]/(2*Sqrt[a^2 + b ^2])])/(b*d))/b + Cosh[c + d*x]/(b*d)
Int[(Complex[0, a_])*(Fx_), x_Symbol] :> Simp[(Complex[Identity[0], a]) I nt[Fx, x], x] /; FreeQ[a, x] && EqQ[a^2, 1]
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(-(Rt[-a, 2]*Rt[-b, 2])^( -1))*ArcTan[Rt[-b, 2]*(x/Rt[-a, 2])], x] /; FreeQ[{a, b}, x] && PosQ[a/b] & & (LtQ[a, 0] || LtQ[b, 0])
Int[((a_) + (b_.)*(x_) + (c_.)*(x_)^2)^(-1), x_Symbol] :> Simp[-2 Subst[I nt[1/Simp[b^2 - 4*a*c - x^2, x], x], x, b + 2*c*x], x] /; FreeQ[{a, b, c}, x]
Int[((a_) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> With[{e = Fre eFactors[Tan[(c + d*x)/2], x]}, Simp[2*(e/d) Subst[Int[1/(a + 2*b*e*x + a *e^2*x^2), x], x, Tan[(c + d*x)/2]/e], x]] /; FreeQ[{a, b, c, d}, x] && NeQ [a^2 - b^2, 0]
Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x _)])^(m_), x_Symbol] :> Simp[g*(g*Cos[e + f*x])^(p - 1)*((a + b*Sin[e + f*x ])^(m + 1)/(b*f*(m + p))), x] + Simp[g^2*((p - 1)/(b*(m + p))) Int[(g*Cos [e + f*x])^(p - 2)*(a + b*Sin[e + f*x])^m*(b + a*Sin[e + f*x]), x], x] /; F reeQ[{a, b, e, f, g, m}, x] && NeQ[a^2 - b^2, 0] && GtQ[p, 1] && NeQ[m + p, 0] && IntegersQ[2*m, 2*p]
Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])/((c_.) + (d_.)*sin[(e_.) + (f_. )*(x_)]), x_Symbol] :> Simp[b*(x/d), x] - Simp[(b*c - a*d)/d Int[1/(c + d *Sin[e + f*x]), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0]
Time = 1.79 (sec) , antiderivative size = 122, normalized size of antiderivative = 1.79
method | result | size |
risch | \(-\frac {a x}{b^{2}}+\frac {{\mathrm e}^{d x +c}}{2 b d}+\frac {{\mathrm e}^{-d x -c}}{2 b d}+\frac {\sqrt {a^{2}+b^{2}}\, \ln \left ({\mathrm e}^{d x +c}-\frac {-a +\sqrt {a^{2}+b^{2}}}{b}\right )}{d \,b^{2}}-\frac {\sqrt {a^{2}+b^{2}}\, \ln \left ({\mathrm e}^{d x +c}+\frac {a +\sqrt {a^{2}+b^{2}}}{b}\right )}{d \,b^{2}}\) | \(122\) |
derivativedivides | \(\frac {\frac {1}{b \left (1+\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}-\frac {a \ln \left (1+\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{b^{2}}-\frac {1}{b \left (\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}+\frac {a \ln \left (\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{b^{2}}-\frac {2 \left (-a^{2}-b^{2}\right ) \operatorname {arctanh}\left (\frac {2 a \tanh \left (\frac {d x}{2}+\frac {c}{2}\right )-2 b}{2 \sqrt {a^{2}+b^{2}}}\right )}{b^{2} \sqrt {a^{2}+b^{2}}}}{d}\) | \(129\) |
default | \(\frac {\frac {1}{b \left (1+\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}-\frac {a \ln \left (1+\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{b^{2}}-\frac {1}{b \left (\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}+\frac {a \ln \left (\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{b^{2}}-\frac {2 \left (-a^{2}-b^{2}\right ) \operatorname {arctanh}\left (\frac {2 a \tanh \left (\frac {d x}{2}+\frac {c}{2}\right )-2 b}{2 \sqrt {a^{2}+b^{2}}}\right )}{b^{2} \sqrt {a^{2}+b^{2}}}}{d}\) | \(129\) |
Input:
int(cosh(d*x+c)^2/(a+b*sinh(d*x+c)),x,method=_RETURNVERBOSE)
Output:
-a*x/b^2+1/2/b/d*exp(d*x+c)+1/2/b/d*exp(-d*x-c)+(a^2+b^2)^(1/2)/d/b^2*ln(e xp(d*x+c)-(-a+(a^2+b^2)^(1/2))/b)-(a^2+b^2)^(1/2)/d/b^2*ln(exp(d*x+c)+(a+( a^2+b^2)^(1/2))/b)
Leaf count of result is larger than twice the leaf count of optimal. 259 vs. \(2 (65) = 130\).
Time = 0.12 (sec) , antiderivative size = 259, normalized size of antiderivative = 3.81 \[ \int \frac {\cosh ^2(c+d x)}{a+b \sinh (c+d x)} \, dx=-\frac {2 \, a d x \cosh \left (d x + c\right ) - b \cosh \left (d x + c\right )^{2} - b \sinh \left (d x + c\right )^{2} - 2 \, \sqrt {a^{2} + b^{2}} {\left (\cosh \left (d x + c\right ) + \sinh \left (d x + c\right )\right )} \log \left (\frac {b^{2} \cosh \left (d x + c\right )^{2} + b^{2} \sinh \left (d x + c\right )^{2} + 2 \, a b \cosh \left (d x + c\right ) + 2 \, a^{2} + b^{2} + 2 \, {\left (b^{2} \cosh \left (d x + c\right ) + a b\right )} \sinh \left (d x + c\right ) - 2 \, \sqrt {a^{2} + b^{2}} {\left (b \cosh \left (d x + c\right ) + b \sinh \left (d x + c\right ) + a\right )}}{b \cosh \left (d x + c\right )^{2} + b \sinh \left (d x + c\right )^{2} + 2 \, a \cosh \left (d x + c\right ) + 2 \, {\left (b \cosh \left (d x + c\right ) + a\right )} \sinh \left (d x + c\right ) - b}\right ) + 2 \, {\left (a d x - b \cosh \left (d x + c\right )\right )} \sinh \left (d x + c\right ) - b}{2 \, {\left (b^{2} d \cosh \left (d x + c\right ) + b^{2} d \sinh \left (d x + c\right )\right )}} \] Input:
integrate(cosh(d*x+c)^2/(a+b*sinh(d*x+c)),x, algorithm="fricas")
Output:
-1/2*(2*a*d*x*cosh(d*x + c) - b*cosh(d*x + c)^2 - b*sinh(d*x + c)^2 - 2*sq rt(a^2 + b^2)*(cosh(d*x + c) + sinh(d*x + c))*log((b^2*cosh(d*x + c)^2 + b ^2*sinh(d*x + c)^2 + 2*a*b*cosh(d*x + c) + 2*a^2 + b^2 + 2*(b^2*cosh(d*x + c) + a*b)*sinh(d*x + c) - 2*sqrt(a^2 + b^2)*(b*cosh(d*x + c) + b*sinh(d*x + c) + a))/(b*cosh(d*x + c)^2 + b*sinh(d*x + c)^2 + 2*a*cosh(d*x + c) + 2 *(b*cosh(d*x + c) + a)*sinh(d*x + c) - b)) + 2*(a*d*x - b*cosh(d*x + c))*s inh(d*x + c) - b)/(b^2*d*cosh(d*x + c) + b^2*d*sinh(d*x + c))
Timed out. \[ \int \frac {\cosh ^2(c+d x)}{a+b \sinh (c+d x)} \, dx=\text {Timed out} \] Input:
integrate(cosh(d*x+c)**2/(a+b*sinh(d*x+c)),x)
Output:
Timed out
Time = 0.14 (sec) , antiderivative size = 116, normalized size of antiderivative = 1.71 \[ \int \frac {\cosh ^2(c+d x)}{a+b \sinh (c+d x)} \, dx=-\frac {{\left (d x + c\right )} a}{b^{2} d} + \frac {e^{\left (d x + c\right )}}{2 \, b d} + \frac {e^{\left (-d x - c\right )}}{2 \, b d} + \frac {\sqrt {a^{2} + b^{2}} \log \left (\frac {b e^{\left (-d x - c\right )} - a - \sqrt {a^{2} + b^{2}}}{b e^{\left (-d x - c\right )} - a + \sqrt {a^{2} + b^{2}}}\right )}{b^{2} d} \] Input:
integrate(cosh(d*x+c)^2/(a+b*sinh(d*x+c)),x, algorithm="maxima")
Output:
-(d*x + c)*a/(b^2*d) + 1/2*e^(d*x + c)/(b*d) + 1/2*e^(-d*x - c)/(b*d) + sq rt(a^2 + b^2)*log((b*e^(-d*x - c) - a - sqrt(a^2 + b^2))/(b*e^(-d*x - c) - a + sqrt(a^2 + b^2)))/(b^2*d)
Time = 0.14 (sec) , antiderivative size = 110, normalized size of antiderivative = 1.62 \[ \int \frac {\cosh ^2(c+d x)}{a+b \sinh (c+d x)} \, dx=-\frac {\frac {2 \, {\left (d x + c\right )} a}{b^{2}} - \frac {e^{\left (d x + c\right )}}{b} - \frac {e^{\left (-d x - c\right )}}{b} - \frac {2 \, \sqrt {a^{2} + b^{2}} \log \left (\frac {{\left | 2 \, b e^{\left (d x + c\right )} + 2 \, a - 2 \, \sqrt {a^{2} + b^{2}} \right |}}{{\left | 2 \, b e^{\left (d x + c\right )} + 2 \, a + 2 \, \sqrt {a^{2} + b^{2}} \right |}}\right )}{b^{2}}}{2 \, d} \] Input:
integrate(cosh(d*x+c)^2/(a+b*sinh(d*x+c)),x, algorithm="giac")
Output:
-1/2*(2*(d*x + c)*a/b^2 - e^(d*x + c)/b - e^(-d*x - c)/b - 2*sqrt(a^2 + b^ 2)*log(abs(2*b*e^(d*x + c) + 2*a - 2*sqrt(a^2 + b^2))/abs(2*b*e^(d*x + c) + 2*a + 2*sqrt(a^2 + b^2)))/b^2)/d
Time = 1.26 (sec) , antiderivative size = 121, normalized size of antiderivative = 1.78 \[ \int \frac {\cosh ^2(c+d x)}{a+b \sinh (c+d x)} \, dx=\frac {{\mathrm {e}}^{c+d\,x}}{2\,b\,d}-\frac {2\,\mathrm {atan}\left (\frac {a\,\sqrt {-b^4\,d^2}}{b^2\,d\,\sqrt {a^2+b^2}}+\frac {{\mathrm {e}}^{d\,x}\,{\mathrm {e}}^c\,\sqrt {-b^4\,d^2}}{b\,d\,\sqrt {a^2+b^2}}\right )\,\sqrt {a^2+b^2}}{\sqrt {-b^4\,d^2}}+\frac {{\mathrm {e}}^{-c-d\,x}}{2\,b\,d}-\frac {a\,x}{b^2} \] Input:
int(cosh(c + d*x)^2/(a + b*sinh(c + d*x)),x)
Output:
exp(c + d*x)/(2*b*d) - (2*atan((a*(-b^4*d^2)^(1/2))/(b^2*d*(a^2 + b^2)^(1/ 2)) + (exp(d*x)*exp(c)*(-b^4*d^2)^(1/2))/(b*d*(a^2 + b^2)^(1/2)))*(a^2 + b ^2)^(1/2))/(-b^4*d^2)^(1/2) + exp(- c - d*x)/(2*b*d) - (a*x)/b^2
Time = 0.23 (sec) , antiderivative size = 87, normalized size of antiderivative = 1.28 \[ \int \frac {\cosh ^2(c+d x)}{a+b \sinh (c+d x)} \, dx=\frac {4 e^{d x +c} \sqrt {a^{2}+b^{2}}\, \mathit {atan} \left (\frac {e^{d x +c} b i +a i}{\sqrt {a^{2}+b^{2}}}\right ) i +e^{2 d x +2 c} b -2 e^{d x +c} a d x +b}{2 e^{d x +c} b^{2} d} \] Input:
int(cosh(d*x+c)^2/(a+b*sinh(d*x+c)),x)
Output:
(4*e**(c + d*x)*sqrt(a**2 + b**2)*atan((e**(c + d*x)*b*i + a*i)/sqrt(a**2 + b**2))*i + e**(2*c + 2*d*x)*b - 2*e**(c + d*x)*a*d*x + b)/(2*e**(c + d*x )*b**2*d)