Integrand size = 20, antiderivative size = 39 \[ \int \frac {\sinh ^2(x)}{a \cosh ^2(x)+b \sinh ^2(x)} \, dx=\frac {x}{a+b}-\frac {\sqrt {a} \arctan \left (\frac {\sqrt {b} \tanh (x)}{\sqrt {a}}\right )}{\sqrt {b} (a+b)} \] Output:
x/(a+b)-a^(1/2)*arctan(b^(1/2)*tanh(x)/a^(1/2))/b^(1/2)/(a+b)
Time = 0.30 (sec) , antiderivative size = 34, normalized size of antiderivative = 0.87 \[ \int \frac {\sinh ^2(x)}{a \cosh ^2(x)+b \sinh ^2(x)} \, dx=\frac {x-\frac {\sqrt {a} \arctan \left (\frac {\sqrt {b} \tanh (x)}{\sqrt {a}}\right )}{\sqrt {b}}}{a+b} \] Input:
Integrate[Sinh[x]^2/(a*Cosh[x]^2 + b*Sinh[x]^2),x]
Output:
(x - (Sqrt[a]*ArcTan[(Sqrt[b]*Tanh[x])/Sqrt[a]])/Sqrt[b])/(a + b)
Time = 0.45 (sec) , antiderivative size = 41, normalized size of antiderivative = 1.05, number of steps used = 8, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.350, Rules used = {3042, 25, 4889, 25, 383, 218, 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 {\sinh ^2(x)}{a \cosh ^2(x)+b \sinh ^2(x)} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int -\frac {\sin (i x)^2}{a \cos (i x)^2-b \sin (i x)^2}dx\) |
\(\Big \downarrow \) 25 |
\(\displaystyle -\int \frac {\sin (i x)^2}{a \cos (i x)^2-b \sin (i x)^2}dx\) |
\(\Big \downarrow \) 4889 |
\(\displaystyle -\int -\frac {\tanh ^2(x)}{\left (1-\tanh ^2(x)\right ) \left (b \tanh ^2(x)+a\right )}d\tanh (x)\) |
\(\Big \downarrow \) 25 |
\(\displaystyle \int \frac {\tanh ^2(x)}{\left (1-\tanh ^2(x)\right ) \left (a+b \tanh ^2(x)\right )}d\tanh (x)\) |
\(\Big \downarrow \) 383 |
\(\displaystyle \frac {\int \frac {1}{1-\tanh ^2(x)}d\tanh (x)}{a+b}-\frac {a \int \frac {1}{b \tanh ^2(x)+a}d\tanh (x)}{a+b}\) |
\(\Big \downarrow \) 218 |
\(\displaystyle \frac {\int \frac {1}{1-\tanh ^2(x)}d\tanh (x)}{a+b}-\frac {\sqrt {a} \arctan \left (\frac {\sqrt {b} \tanh (x)}{\sqrt {a}}\right )}{\sqrt {b} (a+b)}\) |
\(\Big \downarrow \) 219 |
\(\displaystyle \frac {\text {arctanh}(\tanh (x))}{a+b}-\frac {\sqrt {a} \arctan \left (\frac {\sqrt {b} \tanh (x)}{\sqrt {a}}\right )}{\sqrt {b} (a+b)}\) |
Input:
Int[Sinh[x]^2/(a*Cosh[x]^2 + b*Sinh[x]^2),x]
Output:
-((Sqrt[a]*ArcTan[(Sqrt[b]*Tanh[x])/Sqrt[a]])/(Sqrt[b]*(a + b))) + ArcTanh [Tanh[x]]/(a + b)
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]/a)*ArcTan[x/R t[a/b, 2]], x] /; FreeQ[{a, b}, x] && PosQ[a/b]
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[((e_.)*(x_))^(m_.)/(((a_) + (b_.)*(x_)^2)*((c_) + (d_.)*(x_)^2)), x_Sym bol] :> Simp[(-a)*(e^2/(b*c - a*d)) Int[(e*x)^(m - 2)/(a + b*x^2), x], x] + Simp[c*(e^2/(b*c - a*d)) Int[(e*x)^(m - 2)/(c + d*x^2), x], x] /; Free Q[{a, b, c, d, e, m}, x] && NeQ[b*c - a*d, 0] && LeQ[2, m, 3]
Int[u_, x_Symbol] :> With[{v = FunctionOfTrig[u, x]}, With[{d = FreeFactors [Tan[v], x]}, Simp[d/Coefficient[v, x, 1] Subst[Int[SubstFor[1/(1 + d^2*x ^2), Tan[v]/d, u, x], x], x, Tan[v]/d], x]] /; !FalseQ[v] && FunctionOfQ[N onfreeFactors[Tan[v], x], u, x]] /; InverseFunctionFreeQ[u, x] && !MatchQ[ u, (v_.)*((c_.)*tan[w_]^(n_.)*tan[z_]^(n_.))^(p_.) /; FreeQ[{c, p}, x] && I ntegerQ[n] && LinearQ[w, x] && EqQ[z, 2*w]]
Leaf count of result is larger than twice the leaf count of optimal. \(91\) vs. \(2(31)=62\).
Time = 0.18 (sec) , antiderivative size = 92, normalized size of antiderivative = 2.36
method | result | size |
risch | \(\frac {x}{a +b}+\frac {\sqrt {-a b}\, \ln \left ({\mathrm e}^{2 x}-\frac {-a +2 \sqrt {-a b}+b}{a +b}\right )}{2 b \left (a +b \right )}-\frac {\sqrt {-a b}\, \ln \left ({\mathrm e}^{2 x}+\frac {a +2 \sqrt {-a b}-b}{a +b}\right )}{2 b \left (a +b \right )}\) | \(92\) |
default | \(\frac {8 \ln \left (1+\tanh \left (\frac {x}{2}\right )\right )}{8 a +8 b}-\frac {8 \ln \left (\tanh \left (\frac {x}{2}\right )-1\right )}{8 a +8 b}+\frac {8 a^{2} \left (-\frac {\left (-a +\sqrt {b \left (a +b \right )}-b \right ) \operatorname {arctanh}\left (\frac {a \tanh \left (\frac {x}{2}\right )}{\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 (a +\sqrt {b \left (a +b \right )}+b \right ) \arctan \left (\frac {a \tanh \left (\frac {x}{2}\right )}{\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 )}{4 a +4 b}\) | \(191\) |
Input:
int(sinh(x)^2/(a*cosh(x)^2+b*sinh(x)^2),x,method=_RETURNVERBOSE)
Output:
x/(a+b)+1/2/b*(-a*b)^(1/2)/(a+b)*ln(exp(2*x)-(-a+2*(-a*b)^(1/2)+b)/(a+b))- 1/2/b*(-a*b)^(1/2)/(a+b)*ln(exp(2*x)+(a+2*(-a*b)^(1/2)-b)/(a+b))
Time = 0.13 (sec) , antiderivative size = 367, normalized size of antiderivative = 9.41 \[ \int \frac {\sinh ^2(x)}{a \cosh ^2(x)+b \sinh ^2(x)} \, dx=\left [\frac {\sqrt {-\frac {a}{b}} \log \left (\frac {{\left (a^{2} + 2 \, a b + b^{2}\right )} \cosh \left (x\right )^{4} + 4 \, {\left (a^{2} + 2 \, a b + b^{2}\right )} \cosh \left (x\right ) \sinh \left (x\right )^{3} + {\left (a^{2} + 2 \, a b + b^{2}\right )} \sinh \left (x\right )^{4} + 2 \, {\left (a^{2} - b^{2}\right )} \cosh \left (x\right )^{2} + 2 \, {\left (3 \, {\left (a^{2} + 2 \, a b + b^{2}\right )} \cosh \left (x\right )^{2} + a^{2} - b^{2}\right )} \sinh \left (x\right )^{2} + a^{2} - 6 \, a b + b^{2} + 4 \, {\left ({\left (a^{2} + 2 \, a b + b^{2}\right )} \cosh \left (x\right )^{3} + {\left (a^{2} - b^{2}\right )} \cosh \left (x\right )\right )} \sinh \left (x\right ) - 4 \, {\left ({\left (a b + b^{2}\right )} \cosh \left (x\right )^{2} + 2 \, {\left (a b + b^{2}\right )} \cosh \left (x\right ) \sinh \left (x\right ) + {\left (a b + b^{2}\right )} \sinh \left (x\right )^{2} + a b - b^{2}\right )} \sqrt {-\frac {a}{b}}}{{\left (a + b\right )} \cosh \left (x\right )^{4} + 4 \, {\left (a + b\right )} \cosh \left (x\right ) \sinh \left (x\right )^{3} + {\left (a + b\right )} \sinh \left (x\right )^{4} + 2 \, {\left (a - b\right )} \cosh \left (x\right )^{2} + 2 \, {\left (3 \, {\left (a + b\right )} \cosh \left (x\right )^{2} + a - b\right )} \sinh \left (x\right )^{2} + 4 \, {\left ({\left (a + b\right )} \cosh \left (x\right )^{3} + {\left (a - b\right )} \cosh \left (x\right )\right )} \sinh \left (x\right ) + a + b}\right ) + 2 \, x}{2 \, {\left (a + b\right )}}, -\frac {\sqrt {\frac {a}{b}} \arctan \left (\frac {{\left ({\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 )} \sqrt {\frac {a}{b}}}{2 \, a}\right ) - x}{a + b}\right ] \] Input:
integrate(sinh(x)^2/(a*cosh(x)^2+b*sinh(x)^2),x, algorithm="fricas")
Output:
[1/2*(sqrt(-a/b)*log(((a^2 + 2*a*b + b^2)*cosh(x)^4 + 4*(a^2 + 2*a*b + b^2 )*cosh(x)*sinh(x)^3 + (a^2 + 2*a*b + b^2)*sinh(x)^4 + 2*(a^2 - b^2)*cosh(x )^2 + 2*(3*(a^2 + 2*a*b + b^2)*cosh(x)^2 + a^2 - b^2)*sinh(x)^2 + a^2 - 6* a*b + b^2 + 4*((a^2 + 2*a*b + b^2)*cosh(x)^3 + (a^2 - b^2)*cosh(x))*sinh(x ) - 4*((a*b + b^2)*cosh(x)^2 + 2*(a*b + b^2)*cosh(x)*sinh(x) + (a*b + b^2) *sinh(x)^2 + a*b - b^2)*sqrt(-a/b))/((a + b)*cosh(x)^4 + 4*(a + b)*cosh(x) *sinh(x)^3 + (a + b)*sinh(x)^4 + 2*(a - b)*cosh(x)^2 + 2*(3*(a + b)*cosh(x )^2 + a - b)*sinh(x)^2 + 4*((a + b)*cosh(x)^3 + (a - b)*cosh(x))*sinh(x) + a + b)) + 2*x)/(a + b), -(sqrt(a/b)*arctan(1/2*((a + b)*cosh(x)^2 + 2*(a + b)*cosh(x)*sinh(x) + (a + b)*sinh(x)^2 + a - b)*sqrt(a/b)/a) - x)/(a + b )]
Leaf count of result is larger than twice the leaf count of optimal. 218 vs. \(2 (32) = 64\).
Time = 0.56 (sec) , antiderivative size = 218, normalized size of antiderivative = 5.59 \[ \int \frac {\sinh ^2(x)}{a \cosh ^2(x)+b \sinh ^2(x)} \, dx=\begin {cases} \tilde {\infty } x & \text {for}\: a = 0 \wedge b = 0 \\\frac {x - \frac {\sinh {\left (x \right )}}{\cosh {\left (x \right )}}}{a} & \text {for}\: b = 0 \\\frac {x}{b} & \text {for}\: a = 0 \\- \frac {x \sinh ^{2}{\left (x \right )}}{- 2 b \sinh ^{2}{\left (x \right )} + 2 b \cosh ^{2}{\left (x \right )}} + \frac {x \cosh ^{2}{\left (x \right )}}{- 2 b \sinh ^{2}{\left (x \right )} + 2 b \cosh ^{2}{\left (x \right )}} - \frac {\sinh {\left (x \right )} \cosh {\left (x \right )}}{- 2 b \sinh ^{2}{\left (x \right )} + 2 b \cosh ^{2}{\left (x \right )}} & \text {for}\: a = - b \\- \frac {a \log {\left (- \sqrt {- \frac {a}{b}} \cosh {\left (x \right )} + \sinh {\left (x \right )} \right )}}{2 a b \sqrt {- \frac {a}{b}} + 2 b^{2} \sqrt {- \frac {a}{b}}} + \frac {a \log {\left (\sqrt {- \frac {a}{b}} \cosh {\left (x \right )} + \sinh {\left (x \right )} \right )}}{2 a b \sqrt {- \frac {a}{b}} + 2 b^{2} \sqrt {- \frac {a}{b}}} + \frac {2 b x \sqrt {- \frac {a}{b}}}{2 a b \sqrt {- \frac {a}{b}} + 2 b^{2} \sqrt {- \frac {a}{b}}} & \text {otherwise} \end {cases} \] Input:
integrate(sinh(x)**2/(a*cosh(x)**2+b*sinh(x)**2),x)
Output:
Piecewise((zoo*x, Eq(a, 0) & Eq(b, 0)), ((x - sinh(x)/cosh(x))/a, Eq(b, 0) ), (x/b, Eq(a, 0)), (-x*sinh(x)**2/(-2*b*sinh(x)**2 + 2*b*cosh(x)**2) + x* cosh(x)**2/(-2*b*sinh(x)**2 + 2*b*cosh(x)**2) - sinh(x)*cosh(x)/(-2*b*sinh (x)**2 + 2*b*cosh(x)**2), Eq(a, -b)), (-a*log(-sqrt(-a/b)*cosh(x) + sinh(x ))/(2*a*b*sqrt(-a/b) + 2*b**2*sqrt(-a/b)) + a*log(sqrt(-a/b)*cosh(x) + sin h(x))/(2*a*b*sqrt(-a/b) + 2*b**2*sqrt(-a/b)) + 2*b*x*sqrt(-a/b)/(2*a*b*sqr t(-a/b) + 2*b**2*sqrt(-a/b)), True))
Leaf count of result is larger than twice the leaf count of optimal. 74 vs. \(2 (31) = 62\).
Time = 0.15 (sec) , antiderivative size = 74, normalized size of antiderivative = 1.90 \[ \int \frac {\sinh ^2(x)}{a \cosh ^2(x)+b \sinh ^2(x)} \, dx=-\frac {{\left (a - b\right )} \arctan \left (\frac {{\left (a + b\right )} e^{\left (2 \, x\right )} + a - b}{2 \, \sqrt {a b}}\right )}{2 \, \sqrt {a b} {\left (a + b\right )}} + \frac {\arctan \left (\frac {{\left (a + b\right )} e^{\left (-2 \, x\right )} + a - b}{2 \, \sqrt {a b}}\right )}{2 \, \sqrt {a b}} + \frac {x}{a + b} \] Input:
integrate(sinh(x)^2/(a*cosh(x)^2+b*sinh(x)^2),x, algorithm="maxima")
Output:
-1/2*(a - b)*arctan(1/2*((a + b)*e^(2*x) + a - b)/sqrt(a*b))/(sqrt(a*b)*(a + b)) + 1/2*arctan(1/2*((a + b)*e^(-2*x) + a - b)/sqrt(a*b))/sqrt(a*b) + x/(a + b)
Time = 0.11 (sec) , antiderivative size = 46, normalized size of antiderivative = 1.18 \[ \int \frac {\sinh ^2(x)}{a \cosh ^2(x)+b \sinh ^2(x)} \, dx=-\frac {a \arctan \left (\frac {a e^{\left (2 \, x\right )} + b e^{\left (2 \, x\right )} + a - b}{2 \, \sqrt {a b}}\right )}{\sqrt {a b} {\left (a + b\right )}} + \frac {x}{a + b} \] Input:
integrate(sinh(x)^2/(a*cosh(x)^2+b*sinh(x)^2),x, algorithm="giac")
Output:
-a*arctan(1/2*(a*e^(2*x) + b*e^(2*x) + a - b)/sqrt(a*b))/(sqrt(a*b)*(a + b )) + x/(a + b)
Time = 1.49 (sec) , antiderivative size = 209, normalized size of antiderivative = 5.36 \[ \int \frac {\sinh ^2(x)}{a \cosh ^2(x)+b \sinh ^2(x)} \, dx=\frac {x}{a+b}-\frac {\sqrt {a}\,\mathrm {atan}\left (\frac {\left ({\mathrm {e}}^{2\,x}\,\left (\frac {4\,a}{{\left (a+b\right )}^4}+\frac {\left (a^2-b^2\right )\,\left (a-b\right )}{{\left (a+b\right )}^3\,\sqrt {b\,{\left (a+b\right )}^2}\,\sqrt {a^2\,b+2\,a\,b^2+b^3}}\right )+\frac {\left (a-b\right )\,\left (a^2+2\,a\,b+b^2\right )}{{\left (a+b\right )}^3\,\sqrt {b\,{\left (a+b\right )}^2}\,\sqrt {a^2\,b+2\,a\,b^2+b^3}}\right )\,\left (a^2\,\sqrt {a^2\,b+2\,a\,b^2+b^3}+b^2\,\sqrt {a^2\,b+2\,a\,b^2+b^3}+2\,a\,b\,\sqrt {a^2\,b+2\,a\,b^2+b^3}\right )}{2\,\sqrt {a}}\right )}{\sqrt {a^2\,b+2\,a\,b^2+b^3}} \] Input:
int(sinh(x)^2/(b*sinh(x)^2 + a*cosh(x)^2),x)
Output:
x/(a + b) - (a^(1/2)*atan(((exp(2*x)*((4*a)/(a + b)^4 + ((a^2 - b^2)*(a - b))/((a + b)^3*(b*(a + b)^2)^(1/2)*(2*a*b^2 + a^2*b + b^3)^(1/2))) + ((a - b)*(2*a*b + a^2 + b^2))/((a + b)^3*(b*(a + b)^2)^(1/2)*(2*a*b^2 + a^2*b + b^3)^(1/2)))*(a^2*(2*a*b^2 + a^2*b + b^3)^(1/2) + b^2*(2*a*b^2 + a^2*b + b^3)^(1/2) + 2*a*b*(2*a*b^2 + a^2*b + b^3)^(1/2)))/(2*a^(1/2))))/(2*a*b^2 + a^2*b + b^3)^(1/2)
\[ \int \frac {\sinh ^2(x)}{a \cosh ^2(x)+b \sinh ^2(x)} \, dx=\int \frac {\sinh \left (x \right )^{2}}{\cosh \left (x \right )^{2} a +\sinh \left (x \right )^{2} b}d x \] Input:
int(sinh(x)^2/(a*cosh(x)^2+b*sinh(x)^2),x)
Output:
int(sinh(x)**2/(cosh(x)**2*a + sinh(x)**2*b),x)