\(\int \frac {\cosh ^3(x)}{(a \cosh (x)+b \sinh (x))^2} \, dx\) [461]

Optimal result
Mathematica [A] (verified)
Rubi [A] (verified)
Maple [A] (verified)
Fricas [B] (verification not implemented)
Sympy [F(-1)]
Maxima [F(-2)]
Giac [A] (verification not implemented)
Mupad [B] (verification not implemented)
Reduce [B] (verification not implemented)

Optimal result

Integrand size = 16, antiderivative size = 133 \[ \int \frac {\cosh ^3(x)}{(a \cosh (x)+b \sinh (x))^2} \, dx=-\frac {3 a b^2 \arctan \left (\frac {b \cosh (x)+a \sinh (x)}{\sqrt {a^2-b^2}}\right )}{\left (a^2-b^2\right )^{5/2}}+\frac {1}{(a+b)^2 \left (1-\tanh \left (\frac {x}{2}\right )\right )}-\frac {1}{(a-b)^2 \left (1+\tanh \left (\frac {x}{2}\right )\right )}-\frac {2 b^3 \left (a+b \tanh \left (\frac {x}{2}\right )\right )}{a \left (a^2-b^2\right )^2 \left (a+2 b \tanh \left (\frac {x}{2}\right )+a \tanh ^2\left (\frac {x}{2}\right )\right )} \] Output:

-3*a*b^2*arctan((b*cosh(x)+a*sinh(x))/(a^2-b^2)^(1/2))/(a^2-b^2)^(5/2)+1/( 
a+b)^2/(1-tanh(1/2*x))-1/(a-b)^2/(1+tanh(1/2*x))-2*b^3*(a+b*tanh(1/2*x))/a 
/(a^2-b^2)^2/(a+2*b*tanh(1/2*x)+a*tanh(1/2*x)^2)
 

Mathematica [A] (verified)

Time = 0.32 (sec) , antiderivative size = 204, normalized size of antiderivative = 1.53 \[ \int \frac {\cosh ^3(x)}{(a \cosh (x)+b \sinh (x))^2} \, dx=\frac {-\sqrt {a-b} b^3 (a+b)-2 a^2 \sqrt {a-b} b (a+b) \cosh ^2(x)-6 a b^3 \sqrt {a+b} \arctan \left (\frac {b+a \tanh \left (\frac {x}{2}\right )}{\sqrt {a-b} \sqrt {a+b}}\right ) \sinh (x)+\sqrt {a-b} b \left (a^3+a^2 b+a b^2+b^3\right ) \sinh ^2(x)+a \cosh (x) \left (-6 a b^2 \sqrt {a+b} \arctan \left (\frac {b+a \tanh \left (\frac {x}{2}\right )}{\sqrt {a-b} \sqrt {a+b}}\right )+(a-b)^{3/2} (a+b)^2 \sinh (x)\right )}{(a-b)^{5/2} (a+b)^3 (a \cosh (x)+b \sinh (x))} \] Input:

Integrate[Cosh[x]^3/(a*Cosh[x] + b*Sinh[x])^2,x]
 

Output:

(-(Sqrt[a - b]*b^3*(a + b)) - 2*a^2*Sqrt[a - b]*b*(a + b)*Cosh[x]^2 - 6*a* 
b^3*Sqrt[a + b]*ArcTan[(b + a*Tanh[x/2])/(Sqrt[a - b]*Sqrt[a + b])]*Sinh[x 
] + Sqrt[a - b]*b*(a^3 + a^2*b + a*b^2 + b^3)*Sinh[x]^2 + a*Cosh[x]*(-6*a* 
b^2*Sqrt[a + b]*ArcTan[(b + a*Tanh[x/2])/(Sqrt[a - b]*Sqrt[a + b])] + (a - 
 b)^(3/2)*(a + b)^2*Sinh[x]))/((a - b)^(5/2)*(a + b)^3*(a*Cosh[x] + b*Sinh 
[x]))
 

Rubi [A] (verified)

Time = 0.71 (sec) , antiderivative size = 200, normalized size of antiderivative = 1.50, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.250, Rules used = {3042, 4902, 7293, 2009}

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 ^3(x)}{(a \cosh (x)+b \sinh (x))^2} \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {\cos (i x)^3}{(a \cos (i x)-i b \sin (i x))^2}dx\)

\(\Big \downarrow \) 4902

\(\displaystyle 2 \int \frac {\left (\tanh ^2\left (\frac {x}{2}\right )+1\right )^3}{\left (1-\tanh ^2\left (\frac {x}{2}\right )\right )^2 \left (a \tanh ^2\left (\frac {x}{2}\right )+2 b \tanh \left (\frac {x}{2}\right )+a\right )^2}d\tanh \left (\frac {x}{2}\right )\)

\(\Big \downarrow \) 7293

\(\displaystyle 2 \int \left (-\frac {2 \tanh \left (\frac {x}{2}\right ) b^3}{a \left (b^2-a^2\right ) \left (a \tanh ^2\left (\frac {x}{2}\right )+2 b \tanh \left (\frac {x}{2}\right )+a\right )^2}+\frac {b^4-3 a^2 b^2}{a \left (a^2-b^2\right )^2 \left (a \tanh ^2\left (\frac {x}{2}\right )+2 b \tanh \left (\frac {x}{2}\right )+a\right )}+\frac {1}{2 (a+b)^2 \left (\tanh \left (\frac {x}{2}\right )-1\right )^2}+\frac {1}{2 (a-b)^2 \left (\tanh \left (\frac {x}{2}\right )+1\right )^2}\right )d\tanh \left (\frac {x}{2}\right )\)

\(\Big \downarrow \) 2009

\(\displaystyle 2 \left (-\frac {b^2 \left (3 a^2-b^2\right ) \arctan \left (\frac {a \tanh \left (\frac {x}{2}\right )+b}{\sqrt {a^2-b^2}}\right )}{a \left (a^2-b^2\right )^{5/2}}-\frac {b^4 \arctan \left (\frac {a \tanh \left (\frac {x}{2}\right )+b}{\sqrt {a^2-b^2}}\right )}{a \left (a^2-b^2\right )^{5/2}}-\frac {b^3 \left (a+b \tanh \left (\frac {x}{2}\right )\right )}{a \left (a^2-b^2\right )^2 \left (a \tanh ^2\left (\frac {x}{2}\right )+a+2 b \tanh \left (\frac {x}{2}\right )\right )}+\frac {1}{2 (a+b)^2 \left (1-\tanh \left (\frac {x}{2}\right )\right )}-\frac {1}{2 (a-b)^2 \left (\tanh \left (\frac {x}{2}\right )+1\right )}\right )\)

Input:

Int[Cosh[x]^3/(a*Cosh[x] + b*Sinh[x])^2,x]
 

Output:

2*(-((b^4*ArcTan[(b + a*Tanh[x/2])/Sqrt[a^2 - b^2]])/(a*(a^2 - b^2)^(5/2)) 
) - (b^2*(3*a^2 - b^2)*ArcTan[(b + a*Tanh[x/2])/Sqrt[a^2 - b^2]])/(a*(a^2 
- b^2)^(5/2)) + 1/(2*(a + b)^2*(1 - Tanh[x/2])) - 1/(2*(a - b)^2*(1 + Tanh 
[x/2])) - (b^3*(a + b*Tanh[x/2]))/(a*(a^2 - b^2)^2*(a + 2*b*Tanh[x/2] + a* 
Tanh[x/2]^2)))
 

Defintions of rubi rules used

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 4902
Int[u_, x_Symbol] :> With[{w = Block[{$ShowSteps = False, $StepCounter = Nu 
ll}, Int[SubstFor[1/(1 + FreeFactors[Tan[FunctionOfTrig[u, x]/2], x]^2*x^2) 
, Tan[FunctionOfTrig[u, x]/2]/FreeFactors[Tan[FunctionOfTrig[u, x]/2], x], 
u, x], x]]}, Module[{v = FunctionOfTrig[u, x], d}, Simp[d = FreeFactors[Tan 
[v/2], x]; 2*(d/Coefficient[v, x, 1])   Subst[Int[SubstFor[1/(1 + d^2*x^2), 
 Tan[v/2]/d, u, x], x], x, Tan[v/2]/d], x]] /; CalculusFreeQ[w, x]] /; Inve 
rseFunctionFreeQ[u, x] &&  !FalseQ[FunctionOfTrig[u, x]]
 

rule 7293
Int[u_, x_Symbol] :> With[{v = ExpandIntegrand[u, x]}, Int[v, x] /; SumQ[v] 
]
 
Maple [A] (verified)

Time = 0.55 (sec) , antiderivative size = 124, normalized size of antiderivative = 0.93

method result size
default \(-\frac {1}{\left (a +b \right )^{2} \left (\tanh \left (\frac {x}{2}\right )-1\right )}-\frac {2 b^{2} \left (\frac {\frac {b^{2} \tanh \left (\frac {x}{2}\right )}{a}+b}{a +2 b \tanh \left (\frac {x}{2}\right )+a \tanh \left (\frac {x}{2}\right )^{2}}+\frac {3 a \arctan \left (\frac {2 a \tanh \left (\frac {x}{2}\right )+2 b}{2 \sqrt {a^{2}-b^{2}}}\right )}{\sqrt {a^{2}-b^{2}}}\right )}{\left (a -b \right )^{2} \left (a +b \right )^{2}}-\frac {1}{\left (a -b \right )^{2} \left (1+\tanh \left (\frac {x}{2}\right )\right )}\) \(124\)
risch \(\frac {{\mathrm e}^{x}}{2 a^{2}+4 a b +2 b^{2}}-\frac {{\mathrm e}^{-x}}{2 \left (a^{2}-2 a b +b^{2}\right )}-\frac {2 \,{\mathrm e}^{x} b^{3}}{\left (a -b \right )^{2} \left (a^{2}+2 a b +b^{2}\right ) \left ({\mathrm e}^{2 x} a +b \,{\mathrm e}^{2 x}+a -b \right )}-\frac {3 b^{2} a \ln \left ({\mathrm e}^{x}+\frac {a -b}{\sqrt {-a^{2}+b^{2}}}\right )}{\sqrt {-a^{2}+b^{2}}\, \left (a +b \right )^{2} \left (a -b \right )^{2}}+\frac {3 b^{2} a \ln \left ({\mathrm e}^{x}-\frac {a -b}{\sqrt {-a^{2}+b^{2}}}\right )}{\sqrt {-a^{2}+b^{2}}\, \left (a +b \right )^{2} \left (a -b \right )^{2}}\) \(185\)

Input:

int(cosh(x)^3/(a*cosh(x)+b*sinh(x))^2,x,method=_RETURNVERBOSE)
 

Output:

-1/(a+b)^2/(tanh(1/2*x)-1)-2*b^2/(a-b)^2/(a+b)^2*((b^2/a*tanh(1/2*x)+b)/(a 
+2*b*tanh(1/2*x)+a*tanh(1/2*x)^2)+3*a/(a^2-b^2)^(1/2)*arctan(1/2*(2*a*tanh 
(1/2*x)+2*b)/(a^2-b^2)^(1/2)))-1/(a-b)^2/(1+tanh(1/2*x))
 

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 795 vs. \(2 (118) = 236\).

Time = 0.14 (sec) , antiderivative size = 1645, normalized size of antiderivative = 12.37 \[ \int \frac {\cosh ^3(x)}{(a \cosh (x)+b \sinh (x))^2} \, dx=\text {Too large to display} \] Input:

integrate(cosh(x)^3/(a*cosh(x)+b*sinh(x))^2,x, algorithm="fricas")
 

Output:

[-1/2*(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)^4 - 4*(a^5 - a^4*b - 2*a^3*b^ 
2 + 2*a^2*b^3 + a*b^4 - b^5)*cosh(x)*sinh(x)^3 - (a^5 - a^4*b - 2*a^3*b^2 
+ 2*a^2*b^3 + a*b^4 - b^5)*sinh(x)^4 + 6*(a^4*b - b^5)*cosh(x)^2 + 6*(a^4* 
b - 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)*s 
inh(x)^2 + 6*((a^2*b^2 + a*b^3)*cosh(x)^3 + 3*(a^2*b^2 + a*b^3)*cosh(x)*si 
nh(x)^2 + (a^2*b^2 + a*b^3)*sinh(x)^3 + (a^2*b^2 - a*b^3)*cosh(x) + (a^2*b 
^2 - a*b^3 + 3*(a^2*b^2 + a*b^3)*cosh(x)^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*sqr 
t(-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)) - 4*((a^5 - a^4*b - 2*a^3*b^ 
2 + 2*a^2*b^3 + a*b^4 - b^5)*cosh(x)^3 - 3*(a^4*b - b^5)*cosh(x))*sinh(x)) 
/((a^7 + a^6*b - 3*a^5*b^2 - 3*a^4*b^3 + 3*a^3*b^4 + 3*a^2*b^5 - a*b^6 - b 
^7)*cosh(x)^3 + 3*(a^7 + a^6*b - 3*a^5*b^2 - 3*a^4*b^3 + 3*a^3*b^4 + 3*a^2 
*b^5 - a*b^6 - b^7)*cosh(x)*sinh(x)^2 + (a^7 + a^6*b - 3*a^5*b^2 - 3*a^4*b 
^3 + 3*a^3*b^4 + 3*a^2*b^5 - a*b^6 - b^7)*sinh(x)^3 + (a^7 - a^6*b - 3*a^5 
*b^2 + 3*a^4*b^3 + 3*a^3*b^4 - 3*a^2*b^5 - a*b^6 + b^7)*cosh(x) + (a^7 - a 
^6*b - 3*a^5*b^2 + 3*a^4*b^3 + 3*a^3*b^4 - 3*a^2*b^5 - a*b^6 + b^7 + 3*(a^ 
7 + a^6*b - 3*a^5*b^2 - 3*a^4*b^3 + 3*a^3*b^4 + 3*a^2*b^5 - a*b^6 - b^7)*c 
osh(x)^2)*sinh(x)), -1/2*(a^5 + a^4*b - 2*a^3*b^2 - 2*a^2*b^3 + a*b^4 +...
 

Sympy [F(-1)]

Timed out. \[ \int \frac {\cosh ^3(x)}{(a \cosh (x)+b \sinh (x))^2} \, dx=\text {Timed out} \] Input:

integrate(cosh(x)**3/(a*cosh(x)+b*sinh(x))**2,x)
 

Output:

Timed out
 

Maxima [F(-2)]

Exception generated. \[ \int \frac {\cosh ^3(x)}{(a \cosh (x)+b \sinh (x))^2} \, dx=\text {Exception raised: ValueError} \] Input:

integrate(cosh(x)^3/(a*cosh(x)+b*sinh(x))^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(4*b^2-4*a^2>0)', see `assume?` f 
or more de
 

Giac [A] (verification not implemented)

Time = 0.13 (sec) , antiderivative size = 174, normalized size of antiderivative = 1.31 \[ \int \frac {\cosh ^3(x)}{(a \cosh (x)+b \sinh (x))^2} \, dx=-\frac {6 \, a b^{2} \arctan \left (\frac {a e^{x} + b e^{x}}{\sqrt {a^{2} - b^{2}}}\right )}{{\left (a^{4} - 2 \, a^{2} b^{2} + b^{4}\right )} \sqrt {a^{2} - b^{2}}} + \frac {e^{x}}{2 \, {\left (a^{2} + 2 \, a b + b^{2}\right )}} - \frac {a^{3} e^{\left (2 \, x\right )} + 3 \, a^{2} b e^{\left (2 \, x\right )} + 3 \, a b^{2} e^{\left (2 \, x\right )} + 5 \, b^{3} e^{\left (2 \, x\right )} + a^{3} + a^{2} b - a b^{2} - b^{3}}{2 \, {\left (a^{4} - 2 \, a^{2} b^{2} + b^{4}\right )} {\left (a e^{\left (3 \, x\right )} + b e^{\left (3 \, x\right )} + a e^{x} - b e^{x}\right )}} \] Input:

integrate(cosh(x)^3/(a*cosh(x)+b*sinh(x))^2,x, algorithm="giac")
 

Output:

-6*a*b^2*arctan((a*e^x + b*e^x)/sqrt(a^2 - b^2))/((a^4 - 2*a^2*b^2 + b^4)* 
sqrt(a^2 - b^2)) + 1/2*e^x/(a^2 + 2*a*b + b^2) - 1/2*(a^3*e^(2*x) + 3*a^2* 
b*e^(2*x) + 3*a*b^2*e^(2*x) + 5*b^3*e^(2*x) + a^3 + a^2*b - a*b^2 - b^3)/( 
(a^4 - 2*a^2*b^2 + b^4)*(a*e^(3*x) + b*e^(3*x) + a*e^x - b*e^x))
 

Mupad [B] (verification not implemented)

Time = 1.10 (sec) , antiderivative size = 255, normalized size of antiderivative = 1.92 \[ \int \frac {\cosh ^3(x)}{(a \cosh (x)+b \sinh (x))^2} \, dx=\frac {{\mathrm {e}}^x}{2\,{\left (a+b\right )}^2}-\frac {{\mathrm {e}}^{-x}}{2\,{\left (a-b\right )}^2}-\frac {6\,\mathrm {atan}\left (\frac {a\,b^2\,{\mathrm {e}}^x\,\sqrt {a^{10}-5\,a^8\,b^2+10\,a^6\,b^4-10\,a^4\,b^6+5\,a^2\,b^8-b^{10}}}{a^5\,\sqrt {a^2\,b^4}-b^5\,\sqrt {a^2\,b^4}+2\,a^2\,b^3\,\sqrt {a^2\,b^4}-2\,a^3\,b^2\,\sqrt {a^2\,b^4}+a\,b^4\,\sqrt {a^2\,b^4}-a^4\,b\,\sqrt {a^2\,b^4}}\right )\,\sqrt {a^2\,b^4}}{\sqrt {a^{10}-5\,a^8\,b^2+10\,a^6\,b^4-10\,a^4\,b^6+5\,a^2\,b^8-b^{10}}}-\frac {2\,b^3\,{\mathrm {e}}^x}{{\left (a+b\right )}^2\,{\left (a-b\right )}^2\,\left (a-b+{\mathrm {e}}^{2\,x}\,\left (a+b\right )\right )} \] Input:

int(cosh(x)^3/(a*cosh(x) + b*sinh(x))^2,x)
 

Output:

exp(x)/(2*(a + b)^2) - exp(-x)/(2*(a - b)^2) - (6*atan((a*b^2*exp(x)*(a^10 
 - b^10 + 5*a^2*b^8 - 10*a^4*b^6 + 10*a^6*b^4 - 5*a^8*b^2)^(1/2))/(a^5*(a^ 
2*b^4)^(1/2) - b^5*(a^2*b^4)^(1/2) + 2*a^2*b^3*(a^2*b^4)^(1/2) - 2*a^3*b^2 
*(a^2*b^4)^(1/2) + a*b^4*(a^2*b^4)^(1/2) - a^4*b*(a^2*b^4)^(1/2)))*(a^2*b^ 
4)^(1/2))/(a^10 - b^10 + 5*a^2*b^8 - 10*a^4*b^6 + 10*a^6*b^4 - 5*a^8*b^2)^ 
(1/2) - (2*b^3*exp(x))/((a + b)^2*(a - b)^2*(a - b + exp(2*x)*(a + b)))
 

Reduce [B] (verification not implemented)

Time = 0.21 (sec) , antiderivative size = 462, normalized size of antiderivative = 3.47 \[ \int \frac {\cosh ^3(x)}{(a \cosh (x)+b \sinh (x))^2} \, dx=\frac {-12 e^{3 x} \sqrt {a^{2}-b^{2}}\, \mathit {atan} \left (\frac {e^{x} a +e^{x} b}{\sqrt {a^{2}-b^{2}}}\right ) a^{2} b^{2}-12 e^{3 x} \sqrt {a^{2}-b^{2}}\, \mathit {atan} \left (\frac {e^{x} a +e^{x} b}{\sqrt {a^{2}-b^{2}}}\right ) a \,b^{3}-12 e^{x} \sqrt {a^{2}-b^{2}}\, \mathit {atan} \left (\frac {e^{x} a +e^{x} b}{\sqrt {a^{2}-b^{2}}}\right ) a^{2} b^{2}+12 e^{x} \sqrt {a^{2}-b^{2}}\, \mathit {atan} \left (\frac {e^{x} a +e^{x} b}{\sqrt {a^{2}-b^{2}}}\right ) a \,b^{3}+e^{4 x} a^{5}-e^{4 x} a^{4} b -2 e^{4 x} a^{3} b^{2}+2 e^{4 x} a^{2} b^{3}+e^{4 x} a \,b^{4}-e^{4 x} b^{5}-6 e^{2 x} a^{4} b +6 e^{2 x} b^{5}-a^{5}-a^{4} b +2 a^{3} b^{2}+2 a^{2} b^{3}-a \,b^{4}-b^{5}}{2 e^{x} \left (e^{2 x} a^{7}+e^{2 x} a^{6} b -3 e^{2 x} a^{5} b^{2}-3 e^{2 x} a^{4} b^{3}+3 e^{2 x} a^{3} b^{4}+3 e^{2 x} a^{2} b^{5}-e^{2 x} a \,b^{6}-e^{2 x} b^{7}+a^{7}-a^{6} b -3 a^{5} b^{2}+3 a^{4} b^{3}+3 a^{3} b^{4}-3 a^{2} b^{5}-a \,b^{6}+b^{7}\right )} \] Input:

int(cosh(x)^3/(a*cosh(x)+b*sinh(x))^2,x)
 

Output:

( - 12*e**(3*x)*sqrt(a**2 - b**2)*atan((e**x*a + e**x*b)/sqrt(a**2 - b**2) 
)*a**2*b**2 - 12*e**(3*x)*sqrt(a**2 - b**2)*atan((e**x*a + e**x*b)/sqrt(a* 
*2 - b**2))*a*b**3 - 12*e**x*sqrt(a**2 - b**2)*atan((e**x*a + e**x*b)/sqrt 
(a**2 - b**2))*a**2*b**2 + 12*e**x*sqrt(a**2 - b**2)*atan((e**x*a + e**x*b 
)/sqrt(a**2 - b**2))*a*b**3 + e**(4*x)*a**5 - e**(4*x)*a**4*b - 2*e**(4*x) 
*a**3*b**2 + 2*e**(4*x)*a**2*b**3 + e**(4*x)*a*b**4 - e**(4*x)*b**5 - 6*e* 
*(2*x)*a**4*b + 6*e**(2*x)*b**5 - a**5 - a**4*b + 2*a**3*b**2 + 2*a**2*b** 
3 - a*b**4 - b**5)/(2*e**x*(e**(2*x)*a**7 + e**(2*x)*a**6*b - 3*e**(2*x)*a 
**5*b**2 - 3*e**(2*x)*a**4*b**3 + 3*e**(2*x)*a**3*b**4 + 3*e**(2*x)*a**2*b 
**5 - e**(2*x)*a*b**6 - e**(2*x)*b**7 + a**7 - a**6*b - 3*a**5*b**2 + 3*a* 
*4*b**3 + 3*a**3*b**4 - 3*a**2*b**5 - a*b**6 + b**7))