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

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

Optimal result

Integrand size = 19, antiderivative size = 299 \[ \int \frac {\cosh ^3(x)}{a+b \cosh (x)+c \cosh ^2(x)} \, dx=-\frac {b x}{c^2}+\frac {2 \left (b^2-a c-\frac {b^3}{\sqrt {b^2-4 a c}}+\frac {3 a b c}{\sqrt {b^2-4 a c}}\right ) \text {arctanh}\left (\frac {\sqrt {b-2 c-\sqrt {b^2-4 a c}} \tanh \left (\frac {x}{2}\right )}{\sqrt {b+2 c-\sqrt {b^2-4 a c}}}\right )}{c^2 \sqrt {b-2 c-\sqrt {b^2-4 a c}} \sqrt {b+2 c-\sqrt {b^2-4 a c}}}+\frac {2 \left (b^2-a c+\frac {b^3}{\sqrt {b^2-4 a c}}-\frac {3 a b c}{\sqrt {b^2-4 a c}}\right ) \text {arctanh}\left (\frac {\sqrt {b-2 c+\sqrt {b^2-4 a c}} \tanh \left (\frac {x}{2}\right )}{\sqrt {b+2 c+\sqrt {b^2-4 a c}}}\right )}{c^2 \sqrt {b-2 c+\sqrt {b^2-4 a c}} \sqrt {b+2 c+\sqrt {b^2-4 a c}}}+\frac {\sinh (x)}{c} \]

[Out]

-b*x/c^2+sinh(x)/c+2*arctanh((b-2*c-(-4*a*c+b^2)^(1/2))^(1/2)*tanh(1/2*x)/(b+2*c-(-4*a*c+b^2)^(1/2))^(1/2))*(b
^2-a*c-b^3/(-4*a*c+b^2)^(1/2)+3*a*b*c/(-4*a*c+b^2)^(1/2))/c^2/(b-2*c-(-4*a*c+b^2)^(1/2))^(1/2)/(b+2*c-(-4*a*c+
b^2)^(1/2))^(1/2)+2*arctanh((b-2*c+(-4*a*c+b^2)^(1/2))^(1/2)*tanh(1/2*x)/(b+2*c+(-4*a*c+b^2)^(1/2))^(1/2))*(b^
2-a*c+b^3/(-4*a*c+b^2)^(1/2)-3*a*b*c/(-4*a*c+b^2)^(1/2))/c^2/(b-2*c+(-4*a*c+b^2)^(1/2))^(1/2)/(b+2*c+(-4*a*c+b
^2)^(1/2))^(1/2)

Rubi [A] (verified)

Time = 4.22 (sec) , antiderivative size = 299, normalized size of antiderivative = 1.00, number of steps used = 8, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.263, Rules used = {3338, 2717, 3374, 2738, 214} \[ \int \frac {\cosh ^3(x)}{a+b \cosh (x)+c \cosh ^2(x)} \, dx=\frac {2 \left (\frac {3 a b c}{\sqrt {b^2-4 a c}}-\frac {b^3}{\sqrt {b^2-4 a c}}-a c+b^2\right ) \text {arctanh}\left (\frac {\tanh \left (\frac {x}{2}\right ) \sqrt {-\sqrt {b^2-4 a c}+b-2 c}}{\sqrt {-\sqrt {b^2-4 a c}+b+2 c}}\right )}{c^2 \sqrt {-\sqrt {b^2-4 a c}+b-2 c} \sqrt {-\sqrt {b^2-4 a c}+b+2 c}}+\frac {2 \left (-\frac {3 a b c}{\sqrt {b^2-4 a c}}+\frac {b^3}{\sqrt {b^2-4 a c}}-a c+b^2\right ) \text {arctanh}\left (\frac {\tanh \left (\frac {x}{2}\right ) \sqrt {\sqrt {b^2-4 a c}+b-2 c}}{\sqrt {\sqrt {b^2-4 a c}+b+2 c}}\right )}{c^2 \sqrt {\sqrt {b^2-4 a c}+b-2 c} \sqrt {\sqrt {b^2-4 a c}+b+2 c}}-\frac {b x}{c^2}+\frac {\sinh (x)}{c} \]

[In]

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

[Out]

-((b*x)/c^2) + (2*(b^2 - a*c - b^3/Sqrt[b^2 - 4*a*c] + (3*a*b*c)/Sqrt[b^2 - 4*a*c])*ArcTanh[(Sqrt[b - 2*c - Sq
rt[b^2 - 4*a*c]]*Tanh[x/2])/Sqrt[b + 2*c - Sqrt[b^2 - 4*a*c]]])/(c^2*Sqrt[b - 2*c - Sqrt[b^2 - 4*a*c]]*Sqrt[b
+ 2*c - Sqrt[b^2 - 4*a*c]]) + (2*(b^2 - a*c + b^3/Sqrt[b^2 - 4*a*c] - (3*a*b*c)/Sqrt[b^2 - 4*a*c])*ArcTanh[(Sq
rt[b - 2*c + Sqrt[b^2 - 4*a*c]]*Tanh[x/2])/Sqrt[b + 2*c + Sqrt[b^2 - 4*a*c]]])/(c^2*Sqrt[b - 2*c + Sqrt[b^2 -
4*a*c]]*Sqrt[b + 2*c + Sqrt[b^2 - 4*a*c]]) + Sinh[x]/c

Rule 214

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]

Rule 2717

Int[sin[Pi/2 + (c_.) + (d_.)*(x_)], x_Symbol] :> Simp[Sin[c + d*x]/d, x] /; FreeQ[{c, d}, x]

Rule 2738

Int[((a_) + (b_.)*sin[Pi/2 + (c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> With[{e = FreeFactors[Tan[(c + d*x)/2], x
]}, Dist[2*(e/d), Subst[Int[1/(a + b + (a - b)*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]

Rule 3338

Int[cos[(d_.) + (e_.)*(x_)]^(m_.)*((a_.) + cos[(d_.) + (e_.)*(x_)]^(n_.)*(b_.) + cos[(d_.) + (e_.)*(x_)]^(n2_.
)*(c_.))^(p_), x_Symbol] :> Int[ExpandTrig[cos[d + e*x]^m*(a + b*cos[d + e*x]^n + c*cos[d + e*x]^(2*n))^p, x],
 x] /; FreeQ[{a, b, c, d, e}, x] && EqQ[n2, 2*n] && NeQ[b^2 - 4*a*c, 0] && IntegersQ[m, n, p]

Rule 3374

Int[(cos[(d_.) + (e_.)*(x_)]*(B_.) + (A_))/((a_.) + cos[(d_.) + (e_.)*(x_)]*(b_.) + cos[(d_.) + (e_.)*(x_)]^2*
(c_.)), x_Symbol] :> Module[{q = Rt[b^2 - 4*a*c, 2]}, Dist[B + (b*B - 2*A*c)/q, Int[1/(b + q + 2*c*Cos[d + e*x
]), x], x] + Dist[B - (b*B - 2*A*c)/q, Int[1/(b - q + 2*c*Cos[d + e*x]), x], x]] /; FreeQ[{a, b, c, d, e, A, B
}, x] && NeQ[b^2 - 4*a*c, 0]

Rubi steps \begin{align*} \text {integral}& = \int \left (-\frac {b}{c^2}+\frac {\cosh (x)}{c}+\frac {a b+b^2 \left (1-\frac {a c}{b^2}\right ) \cosh (x)}{c^2 \left (a+b \cosh (x)+c \cosh ^2(x)\right )}\right ) \, dx \\ & = -\frac {b x}{c^2}+\frac {\int \frac {a b+b^2 \left (1-\frac {a c}{b^2}\right ) \cosh (x)}{a+b \cosh (x)+c \cosh ^2(x)} \, dx}{c^2}+\frac {\int \cosh (x) \, dx}{c} \\ & = -\frac {b x}{c^2}+\frac {\sinh (x)}{c}+\frac {\left (b^2-a c+\frac {b^3}{\sqrt {b^2-4 a c}}-\frac {3 a b c}{\sqrt {b^2-4 a c}}\right ) \int \frac {1}{b+\sqrt {b^2-4 a c}+2 c \cosh (x)} \, dx}{c^2}+\frac {\left (b^2-a c-\frac {b^3}{\sqrt {b^2-4 a c}}+\frac {3 a b c}{\sqrt {b^2-4 a c}}\right ) \int \frac {1}{b-\sqrt {b^2-4 a c}+2 c \cosh (x)} \, dx}{c^2} \\ & = -\frac {b x}{c^2}+\frac {\sinh (x)}{c}+\frac {\left (2 \left (b^2-a c+\frac {b^3}{\sqrt {b^2-4 a c}}-\frac {3 a b c}{\sqrt {b^2-4 a c}}\right )\right ) \text {Subst}\left (\int \frac {1}{b+2 c+\sqrt {b^2-4 a c}-\left (b-2 c+\sqrt {b^2-4 a c}\right ) x^2} \, dx,x,\tanh \left (\frac {x}{2}\right )\right )}{c^2}+\frac {\left (2 \left (b^2-a c-\frac {b^3}{\sqrt {b^2-4 a c}}+\frac {3 a b c}{\sqrt {b^2-4 a c}}\right )\right ) \text {Subst}\left (\int \frac {1}{b+2 c-\sqrt {b^2-4 a c}-\left (b-2 c-\sqrt {b^2-4 a c}\right ) x^2} \, dx,x,\tanh \left (\frac {x}{2}\right )\right )}{c^2} \\ & = -\frac {b x}{c^2}+\frac {2 \left (b^2-a c-\frac {b^3}{\sqrt {b^2-4 a c}}+\frac {3 a b c}{\sqrt {b^2-4 a c}}\right ) \text {arctanh}\left (\frac {\sqrt {b-2 c-\sqrt {b^2-4 a c}} \tanh \left (\frac {x}{2}\right )}{\sqrt {b+2 c-\sqrt {b^2-4 a c}}}\right )}{c^2 \sqrt {b-2 c-\sqrt {b^2-4 a c}} \sqrt {b+2 c-\sqrt {b^2-4 a c}}}+\frac {2 \left (b^2-a c+\frac {b^3}{\sqrt {b^2-4 a c}}-\frac {3 a b c}{\sqrt {b^2-4 a c}}\right ) \text {arctanh}\left (\frac {\sqrt {b-2 c+\sqrt {b^2-4 a c}} \tanh \left (\frac {x}{2}\right )}{\sqrt {b+2 c+\sqrt {b^2-4 a c}}}\right )}{c^2 \sqrt {b-2 c+\sqrt {b^2-4 a c}} \sqrt {b+2 c+\sqrt {b^2-4 a c}}}+\frac {\sinh (x)}{c} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.43 (sec) , antiderivative size = 309, normalized size of antiderivative = 1.03 \[ \int \frac {\cosh ^3(x)}{a+b \cosh (x)+c \cosh ^2(x)} \, dx=\frac {-b x-\frac {\sqrt {2} \left (b^3-3 a b c+b^2 \sqrt {b^2-4 a c}-a c \sqrt {b^2-4 a c}\right ) \arctan \left (\frac {\left (b-2 c+\sqrt {b^2-4 a c}\right ) \tanh \left (\frac {x}{2}\right )}{\sqrt {-2 b^2+4 c (a+c)-2 b \sqrt {b^2-4 a c}}}\right )}{\sqrt {b^2-4 a c} \sqrt {-b^2+2 c (a+c)-b \sqrt {b^2-4 a c}}}+\frac {\sqrt {2} \left (-b^3+3 a b c+b^2 \sqrt {b^2-4 a c}-a c \sqrt {b^2-4 a c}\right ) \arctan \left (\frac {\left (-b+2 c+\sqrt {b^2-4 a c}\right ) \tanh \left (\frac {x}{2}\right )}{\sqrt {-2 b^2+4 c (a+c)+2 b \sqrt {b^2-4 a c}}}\right )}{\sqrt {b^2-4 a c} \sqrt {-b^2+2 c (a+c)+b \sqrt {b^2-4 a c}}}+c \sinh (x)}{c^2} \]

[In]

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

[Out]

(-(b*x) - (Sqrt[2]*(b^3 - 3*a*b*c + b^2*Sqrt[b^2 - 4*a*c] - a*c*Sqrt[b^2 - 4*a*c])*ArcTan[((b - 2*c + Sqrt[b^2
 - 4*a*c])*Tanh[x/2])/Sqrt[-2*b^2 + 4*c*(a + c) - 2*b*Sqrt[b^2 - 4*a*c]]])/(Sqrt[b^2 - 4*a*c]*Sqrt[-b^2 + 2*c*
(a + c) - b*Sqrt[b^2 - 4*a*c]]) + (Sqrt[2]*(-b^3 + 3*a*b*c + b^2*Sqrt[b^2 - 4*a*c] - a*c*Sqrt[b^2 - 4*a*c])*Ar
cTan[((-b + 2*c + Sqrt[b^2 - 4*a*c])*Tanh[x/2])/Sqrt[-2*b^2 + 4*c*(a + c) + 2*b*Sqrt[b^2 - 4*a*c]]])/(Sqrt[b^2
 - 4*a*c]*Sqrt[-b^2 + 2*c*(a + c) + b*Sqrt[b^2 - 4*a*c]]) + c*Sinh[x])/c^2

Maple [A] (verified)

Time = 1.50 (sec) , antiderivative size = 354, normalized size of antiderivative = 1.18

method result size
default \(-\frac {1}{c \left (1+\tanh \left (\frac {x}{2}\right )\right )}-\frac {b \ln \left (1+\tanh \left (\frac {x}{2}\right )\right )}{c^{2}}-\frac {1}{c \left (\tanh \left (\frac {x}{2}\right )-1\right )}+\frac {b \ln \left (\tanh \left (\frac {x}{2}\right )-1\right )}{c^{2}}+\frac {2 \left (a -b +c \right ) \left (\frac {\left (-a b \sqrt {-4 a c +b^{2}}-a c \sqrt {-4 a c +b^{2}}+b^{2} \sqrt {-4 a c +b^{2}}-2 a^{2} c +a \,b^{2}+3 b c a -b^{3}\right ) \operatorname {arctanh}\left (\frac {\left (-a +b -c \right ) \tanh \left (\frac {x}{2}\right )}{\sqrt {\left (\sqrt {-4 a c +b^{2}}+a -c \right ) \left (a -b +c \right )}}\right )}{2 \sqrt {-4 a c +b^{2}}\, \left (a -b +c \right ) \sqrt {\left (\sqrt {-4 a c +b^{2}}+a -c \right ) \left (a -b +c \right )}}+\frac {\left (-a b \sqrt {-4 a c +b^{2}}-a c \sqrt {-4 a c +b^{2}}+b^{2} \sqrt {-4 a c +b^{2}}+2 a^{2} c -a \,b^{2}-3 b c a +b^{3}\right ) \arctan \left (\frac {\left (a -b +c \right ) \tanh \left (\frac {x}{2}\right )}{\sqrt {\left (\sqrt {-4 a c +b^{2}}-a +c \right ) \left (a -b +c \right )}}\right )}{2 \sqrt {-4 a c +b^{2}}\, \left (a -b +c \right ) \sqrt {\left (\sqrt {-4 a c +b^{2}}-a +c \right ) \left (a -b +c \right )}}\right )}{c^{2}}\) \(354\)
risch \(\text {Expression too large to display}\) \(2096\)

[In]

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

[Out]

-1/c/(1+tanh(1/2*x))-b/c^2*ln(1+tanh(1/2*x))-1/c/(tanh(1/2*x)-1)+b/c^2*ln(tanh(1/2*x)-1)+2/c^2*(a-b+c)*(1/2*(-
a*b*(-4*a*c+b^2)^(1/2)-a*c*(-4*a*c+b^2)^(1/2)+b^2*(-4*a*c+b^2)^(1/2)-2*a^2*c+a*b^2+3*b*c*a-b^3)/(-4*a*c+b^2)^(
1/2)/(a-b+c)/(((-4*a*c+b^2)^(1/2)+a-c)*(a-b+c))^(1/2)*arctanh((-a+b-c)*tanh(1/2*x)/(((-4*a*c+b^2)^(1/2)+a-c)*(
a-b+c))^(1/2))+1/2*(-a*b*(-4*a*c+b^2)^(1/2)-a*c*(-4*a*c+b^2)^(1/2)+b^2*(-4*a*c+b^2)^(1/2)+2*a^2*c-a*b^2-3*b*c*
a+b^3)/(-4*a*c+b^2)^(1/2)/(a-b+c)/(((-4*a*c+b^2)^(1/2)-a+c)*(a-b+c))^(1/2)*arctan((a-b+c)*tanh(1/2*x)/(((-4*a*
c+b^2)^(1/2)-a+c)*(a-b+c))^(1/2)))

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 6794 vs. \(2 (255) = 510\).

Time = 1.08 (sec) , antiderivative size = 6794, normalized size of antiderivative = 22.72 \[ \int \frac {\cosh ^3(x)}{a+b \cosh (x)+c \cosh ^2(x)} \, dx=\text {Too large to display} \]

[In]

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

[Out]

Too large to include

Sympy [F(-1)]

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

[In]

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

[Out]

Timed out

Maxima [F]

\[ \int \frac {\cosh ^3(x)}{a+b \cosh (x)+c \cosh ^2(x)} \, dx=\int { \frac {\cosh \left (x\right )^{3}}{c \cosh \left (x\right )^{2} + b \cosh \left (x\right ) + a} \,d x } \]

[In]

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

[Out]

-1/2*(2*b*x*e^x - c*e^(2*x) + c)*e^(-x)/c^2 - 1/8*integrate(-16*(2*a*b*e^(2*x) + (b^2 - a*c)*e^(3*x) + (b^2 -
a*c)*e^x)/(c^3*e^(4*x) + 2*b*c^2*e^(3*x) + 2*b*c^2*e^x + c^3 + 2*(2*a*c^2 + c^3)*e^(2*x)), x)

Giac [A] (verification not implemented)

none

Time = 0.80 (sec) , antiderivative size = 24, normalized size of antiderivative = 0.08 \[ \int \frac {\cosh ^3(x)}{a+b \cosh (x)+c \cosh ^2(x)} \, dx=-\frac {b x}{c^{2}} - \frac {e^{\left (-x\right )}}{2 \, c} + \frac {e^{x}}{2 \, c} \]

[In]

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

[Out]

-b*x/c^2 - 1/2*e^(-x)/c + 1/2*e^x/c

Mupad [F(-1)]

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

[In]

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

[Out]

\text{Hanged}