Integrand size = 23, antiderivative size = 50 \[ \int \frac {\cosh ^2(c+d x)}{a+b \sinh ^2(c+d x)} \, dx=\frac {x}{b}-\frac {\sqrt {a-b} \text {arctanh}\left (\frac {\sqrt {a-b} \tanh (c+d x)}{\sqrt {a}}\right )}{\sqrt {a} b d} \] Output:
x/b-(a-b)^(1/2)*arctanh((a-b)^(1/2)*tanh(d*x+c)/a^(1/2))/a^(1/2)/b/d
Time = 0.20 (sec) , antiderivative size = 50, normalized size of antiderivative = 1.00 \[ \int \frac {\cosh ^2(c+d x)}{a+b \sinh ^2(c+d x)} \, dx=\frac {c+d x-\frac {\sqrt {a-b} \text {arctanh}\left (\frac {\sqrt {a-b} \tanh (c+d x)}{\sqrt {a}}\right )}{\sqrt {a}}}{b d} \] Input:
Integrate[Cosh[c + d*x]^2/(a + b*Sinh[c + d*x]^2),x]
Output:
(c + d*x - (Sqrt[a - b]*ArcTanh[(Sqrt[a - b]*Tanh[c + d*x])/Sqrt[a]])/Sqrt [a])/(b*d)
Time = 0.28 (sec) , antiderivative size = 57, 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.217, Rules used = {3042, 3670, 303, 219, 221}
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 ^2(c+d x)} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\cos (i c+i d x)^2}{a-b \sin (i c+i d x)^2}dx\) |
\(\Big \downarrow \) 3670 |
\(\displaystyle \frac {\int \frac {1}{\left (1-\tanh ^2(c+d x)\right ) \left (a-(a-b) \tanh ^2(c+d x)\right )}d\tanh (c+d x)}{d}\) |
\(\Big \downarrow \) 303 |
\(\displaystyle \frac {\frac {\int \frac {1}{1-\tanh ^2(c+d x)}d\tanh (c+d x)}{b}-\frac {(a-b) \int \frac {1}{a-(a-b) \tanh ^2(c+d x)}d\tanh (c+d x)}{b}}{d}\) |
\(\Big \downarrow \) 219 |
\(\displaystyle \frac {\frac {\text {arctanh}(\tanh (c+d x))}{b}-\frac {(a-b) \int \frac {1}{a-(a-b) \tanh ^2(c+d x)}d\tanh (c+d x)}{b}}{d}\) |
\(\Big \downarrow \) 221 |
\(\displaystyle \frac {\frac {\text {arctanh}(\tanh (c+d x))}{b}-\frac {\sqrt {a-b} \text {arctanh}\left (\frac {\sqrt {a-b} \tanh (c+d x)}{\sqrt {a}}\right )}{\sqrt {a} b}}{d}\) |
Input:
Int[Cosh[c + d*x]^2/(a + b*Sinh[c + d*x]^2),x]
Output:
(ArcTanh[Tanh[c + d*x]]/b - (Sqrt[a - b]*ArcTanh[(Sqrt[a - b]*Tanh[c + d*x ])/Sqrt[a]])/(Sqrt[a]*b))/d
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[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[-a/b, 2]/a)*ArcTanh[x /Rt[-a/b, 2]], x] /; FreeQ[{a, b}, x] && NegQ[a/b]
Int[1/(((a_) + (b_.)*(x_)^2)*((c_) + (d_.)*(x_)^2)), x_Symbol] :> Simp[b/(b *c - a*d) Int[1/(a + b*x^2), x], x] - Simp[d/(b*c - a*d) Int[1/(c + d*x ^2), x], x] /; FreeQ[{a, b, c, d}, x] && NeQ[b*c - a*d, 0]
Int[cos[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]^2)^( p_.), x_Symbol] :> With[{ff = FreeFactors[Tan[e + f*x], x]}, Simp[ff/f Su bst[Int[(a + (a + b)*ff^2*x^2)^p/(1 + ff^2*x^2)^(m/2 + p + 1), x], x, Tan[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f}, x] && IntegerQ[m/2] && IntegerQ[p]
Leaf count of result is larger than twice the leaf count of optimal. \(111\) vs. \(2(42)=84\).
Time = 3.13 (sec) , antiderivative size = 112, normalized size of antiderivative = 2.24
method | result | size |
risch | \(\frac {x}{b}+\frac {\sqrt {a \left (a -b \right )}\, \ln \left ({\mathrm e}^{2 d x +2 c}+\frac {2 a +2 \sqrt {a \left (a -b \right )}-b}{b}\right )}{2 a d b}-\frac {\sqrt {a \left (a -b \right )}\, \ln \left ({\mathrm e}^{2 d x +2 c}-\frac {-2 a +2 \sqrt {a \left (a -b \right )}+b}{b}\right )}{2 a d b}\) | \(112\) |
derivativedivides | \(\frac {-\frac {\ln \left (\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{b}+\frac {\ln \left (\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{b}+\frac {2 a \left (a -b \right ) \left (-\frac {\left (\sqrt {-b \left (a -b \right )}-b \right ) \operatorname {arctanh}\left (\frac {\tanh \left (\frac {d x}{2}+\frac {c}{2}\right ) a}{\sqrt {\left (2 \sqrt {-b \left (a -b \right )}+a -2 b \right ) a}}\right )}{2 a \sqrt {-b \left (a -b \right )}\, \sqrt {\left (2 \sqrt {-b \left (a -b \right )}+a -2 b \right ) a}}+\frac {\left (\sqrt {-b \left (a -b \right )}+b \right ) \arctan \left (\frac {\tanh \left (\frac {d x}{2}+\frac {c}{2}\right ) a}{\sqrt {\left (2 \sqrt {-b \left (a -b \right )}-a +2 b \right ) a}}\right )}{2 a \sqrt {-b \left (a -b \right )}\, \sqrt {\left (2 \sqrt {-b \left (a -b \right )}-a +2 b \right ) a}}\right )}{b}}{d}\) | \(219\) |
default | \(\frac {-\frac {\ln \left (\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{b}+\frac {\ln \left (\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{b}+\frac {2 a \left (a -b \right ) \left (-\frac {\left (\sqrt {-b \left (a -b \right )}-b \right ) \operatorname {arctanh}\left (\frac {\tanh \left (\frac {d x}{2}+\frac {c}{2}\right ) a}{\sqrt {\left (2 \sqrt {-b \left (a -b \right )}+a -2 b \right ) a}}\right )}{2 a \sqrt {-b \left (a -b \right )}\, \sqrt {\left (2 \sqrt {-b \left (a -b \right )}+a -2 b \right ) a}}+\frac {\left (\sqrt {-b \left (a -b \right )}+b \right ) \arctan \left (\frac {\tanh \left (\frac {d x}{2}+\frac {c}{2}\right ) a}{\sqrt {\left (2 \sqrt {-b \left (a -b \right )}-a +2 b \right ) a}}\right )}{2 a \sqrt {-b \left (a -b \right )}\, \sqrt {\left (2 \sqrt {-b \left (a -b \right )}-a +2 b \right ) a}}\right )}{b}}{d}\) | \(219\) |
Input:
int(cosh(d*x+c)^2/(a+b*sinh(d*x+c)^2),x,method=_RETURNVERBOSE)
Output:
x/b+1/2/a*(a*(a-b))^(1/2)/d/b*ln(exp(2*d*x+2*c)+(2*a+2*(a*(a-b))^(1/2)-b)/ b)-1/2/a*(a*(a-b))^(1/2)/d/b*ln(exp(2*d*x+2*c)-(-2*a+2*(a*(a-b))^(1/2)+b)/ b)
Leaf count of result is larger than twice the leaf count of optimal. 88 vs. \(2 (42) = 84\).
Time = 0.13 (sec) , antiderivative size = 443, normalized size of antiderivative = 8.86 \[ \int \frac {\cosh ^2(c+d x)}{a+b \sinh ^2(c+d x)} \, dx=\left [\frac {2 \, d x + \sqrt {\frac {a - b}{a}} \log \left (\frac {b^{2} \cosh \left (d x + c\right )^{4} + 4 \, b^{2} \cosh \left (d x + c\right ) \sinh \left (d x + c\right )^{3} + b^{2} \sinh \left (d x + c\right )^{4} + 2 \, {\left (2 \, a b - b^{2}\right )} \cosh \left (d x + c\right )^{2} + 2 \, {\left (3 \, b^{2} \cosh \left (d x + c\right )^{2} + 2 \, a b - b^{2}\right )} \sinh \left (d x + c\right )^{2} + 8 \, a^{2} - 8 \, a b + b^{2} + 4 \, {\left (b^{2} \cosh \left (d x + c\right )^{3} + {\left (2 \, a b - b^{2}\right )} \cosh \left (d x + c\right )\right )} \sinh \left (d x + c\right ) + 4 \, {\left (a b \cosh \left (d x + c\right )^{2} + 2 \, a b \cosh \left (d x + c\right ) \sinh \left (d x + c\right ) + a b \sinh \left (d x + c\right )^{2} + 2 \, a^{2} - a b\right )} \sqrt {\frac {a - b}{a}}}{b \cosh \left (d x + c\right )^{4} + 4 \, b \cosh \left (d x + c\right ) \sinh \left (d x + c\right )^{3} + b \sinh \left (d x + c\right )^{4} + 2 \, {\left (2 \, a - b\right )} \cosh \left (d x + c\right )^{2} + 2 \, {\left (3 \, b \cosh \left (d x + c\right )^{2} + 2 \, a - b\right )} \sinh \left (d x + c\right )^{2} + 4 \, {\left (b \cosh \left (d x + c\right )^{3} + {\left (2 \, a - b\right )} \cosh \left (d x + c\right )\right )} \sinh \left (d x + c\right ) + b}\right )}{2 \, b d}, \frac {d x + \sqrt {-\frac {a - b}{a}} \arctan \left (-\frac {{\left (b \cosh \left (d x + c\right )^{2} + 2 \, b \cosh \left (d x + c\right ) \sinh \left (d x + c\right ) + b \sinh \left (d x + c\right )^{2} + 2 \, a - b\right )} \sqrt {-\frac {a - b}{a}}}{2 \, {\left (a - b\right )}}\right )}{b d}\right ] \] Input:
integrate(cosh(d*x+c)^2/(a+b*sinh(d*x+c)^2),x, algorithm="fricas")
Output:
[1/2*(2*d*x + sqrt((a - b)/a)*log((b^2*cosh(d*x + c)^4 + 4*b^2*cosh(d*x + c)*sinh(d*x + c)^3 + b^2*sinh(d*x + c)^4 + 2*(2*a*b - b^2)*cosh(d*x + c)^2 + 2*(3*b^2*cosh(d*x + c)^2 + 2*a*b - b^2)*sinh(d*x + c)^2 + 8*a^2 - 8*a*b + b^2 + 4*(b^2*cosh(d*x + c)^3 + (2*a*b - b^2)*cosh(d*x + c))*sinh(d*x + c) + 4*(a*b*cosh(d*x + c)^2 + 2*a*b*cosh(d*x + c)*sinh(d*x + c) + a*b*sinh (d*x + c)^2 + 2*a^2 - a*b)*sqrt((a - b)/a))/(b*cosh(d*x + c)^4 + 4*b*cosh( d*x + c)*sinh(d*x + c)^3 + b*sinh(d*x + c)^4 + 2*(2*a - b)*cosh(d*x + c)^2 + 2*(3*b*cosh(d*x + c)^2 + 2*a - b)*sinh(d*x + c)^2 + 4*(b*cosh(d*x + c)^ 3 + (2*a - b)*cosh(d*x + c))*sinh(d*x + c) + b)))/(b*d), (d*x + sqrt(-(a - b)/a)*arctan(-1/2*(b*cosh(d*x + c)^2 + 2*b*cosh(d*x + c)*sinh(d*x + c) + b*sinh(d*x + c)^2 + 2*a - b)*sqrt(-(a - b)/a)/(a - b)))/(b*d)]
Timed out. \[ \int \frac {\cosh ^2(c+d x)}{a+b \sinh ^2(c+d x)} \, dx=\text {Timed out} \] Input:
integrate(cosh(d*x+c)**2/(a+b*sinh(d*x+c)**2),x)
Output:
Timed out
Exception generated. \[ \int \frac {\cosh ^2(c+d x)}{a+b \sinh ^2(c+d x)} \, dx=\text {Exception raised: ValueError} \] Input:
integrate(cosh(d*x+c)^2/(a+b*sinh(d*x+c)^2),x, algorithm="maxima")
Output:
Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'assume' command before evaluation *may* help (example of legal syntax is 'assume(b-a>0)', see `assume?` for more details)Is
Time = 0.40 (sec) , antiderivative size = 68, normalized size of antiderivative = 1.36 \[ \int \frac {\cosh ^2(c+d x)}{a+b \sinh ^2(c+d x)} \, dx=-\frac {\frac {{\left (a - b\right )} \arctan \left (\frac {b e^{\left (2 \, d x + 2 \, c\right )} + 2 \, a - b}{2 \, \sqrt {-a^{2} + a b}}\right )}{\sqrt {-a^{2} + a b} b} - \frac {d x + c}{b}}{d} \] Input:
integrate(cosh(d*x+c)^2/(a+b*sinh(d*x+c)^2),x, algorithm="giac")
Output:
-((a - b)*arctan(1/2*(b*e^(2*d*x + 2*c) + 2*a - b)/sqrt(-a^2 + a*b))/(sqrt (-a^2 + a*b)*b) - (d*x + c)/b)/d
Time = 0.48 (sec) , antiderivative size = 166, normalized size of antiderivative = 3.32 \[ \int \frac {\cosh ^2(c+d x)}{a+b \sinh ^2(c+d x)} \, dx=\frac {x}{b}+\frac {\ln \left (\frac {4\,{\mathrm {e}}^{2\,c+2\,d\,x}\,\left (a-b\right )}{b^2}-\frac {2\,\sqrt {a-b}\,\left (b+2\,a\,{\mathrm {e}}^{2\,c+2\,d\,x}-b\,{\mathrm {e}}^{2\,c+2\,d\,x}\right )}{\sqrt {a}\,b^2}\right )\,\sqrt {a-b}}{2\,\sqrt {a}\,b\,d}-\frac {\ln \left (\frac {4\,{\mathrm {e}}^{2\,c+2\,d\,x}\,\left (a-b\right )}{b^2}+\frac {2\,\sqrt {a-b}\,\left (b+2\,a\,{\mathrm {e}}^{2\,c+2\,d\,x}-b\,{\mathrm {e}}^{2\,c+2\,d\,x}\right )}{\sqrt {a}\,b^2}\right )\,\sqrt {a-b}}{2\,\sqrt {a}\,b\,d} \] Input:
int(cosh(c + d*x)^2/(a + b*sinh(c + d*x)^2),x)
Output:
x/b + (log((4*exp(2*c + 2*d*x)*(a - b))/b^2 - (2*(a - b)^(1/2)*(b + 2*a*ex p(2*c + 2*d*x) - b*exp(2*c + 2*d*x)))/(a^(1/2)*b^2))*(a - b)^(1/2))/(2*a^( 1/2)*b*d) - (log((4*exp(2*c + 2*d*x)*(a - b))/b^2 + (2*(a - b)^(1/2)*(b + 2*a*exp(2*c + 2*d*x) - b*exp(2*c + 2*d*x)))/(a^(1/2)*b^2))*(a - b)^(1/2))/ (2*a^(1/2)*b*d)
Time = 0.17 (sec) , antiderivative size = 134, normalized size of antiderivative = 2.68 \[ \int \frac {\cosh ^2(c+d x)}{a+b \sinh ^2(c+d x)} \, dx=\frac {-\sqrt {a}\, \sqrt {a -b}\, \mathrm {log}\left (-\sqrt {2 \sqrt {a}\, \sqrt {a -b}-2 a +b}+e^{d x +c} \sqrt {b}\right )-\sqrt {a}\, \sqrt {a -b}\, \mathrm {log}\left (\sqrt {2 \sqrt {a}\, \sqrt {a -b}-2 a +b}+e^{d x +c} \sqrt {b}\right )+\sqrt {a}\, \sqrt {a -b}\, \mathrm {log}\left (2 \sqrt {a}\, \sqrt {a -b}+e^{2 d x +2 c} b +2 a -b \right )+2 a d x}{2 a b d} \] Input:
int(cosh(d*x+c)^2/(a+b*sinh(d*x+c)^2),x)
Output:
( - sqrt(a)*sqrt(a - b)*log( - sqrt(2*sqrt(a)*sqrt(a - b) - 2*a + b) + e** (c + d*x)*sqrt(b)) - sqrt(a)*sqrt(a - b)*log(sqrt(2*sqrt(a)*sqrt(a - b) - 2*a + b) + e**(c + d*x)*sqrt(b)) + sqrt(a)*sqrt(a - b)*log(2*sqrt(a)*sqrt( a - b) + e**(2*c + 2*d*x)*b + 2*a - b) + 2*a*d*x)/(2*a*b*d)