\(\int \frac {d+e \cosh (x)}{a+b \cosh (x)+c \cosh ^2(x)} \, dx\) [597]

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

Optimal result

Integrand size = 21, antiderivative size = 246 \[ \int \frac {d+e \cosh (x)}{a+b \cosh (x)+c \cosh ^2(x)} \, dx=\frac {2 \left (e+\frac {2 c d-b e}{\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 )}{\sqrt {b-2 c-\sqrt {b^2-4 a c}} \sqrt {b+2 c-\sqrt {b^2-4 a c}}}+\frac {2 \left (e-\frac {2 c d-b e}{\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 )}{\sqrt {b-2 c+\sqrt {b^2-4 a c}} \sqrt {b+2 c+\sqrt {b^2-4 a c}}} \] Output:

2*(e+(-b*e+2*c*d)/(-4*a*c+b^2)^(1/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*c-(-4*a*c+b^2)^(1/ 
2))^(1/2)/(b+2*c-(-4*a*c+b^2)^(1/2))^(1/2)+2*(e-(-b*e+2*c*d)/(-4*a*c+b^2)^ 
(1/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*c+(-4*a*c+b^2)^(1/2))^(1/2)/(b+2*c+(-4*a*c+b^2)^( 
1/2))^(1/2)
 

Mathematica [A] (verified)

Time = 0.73 (sec) , antiderivative size = 241, normalized size of antiderivative = 0.98 \[ \int \frac {d+e \cosh (x)}{a+b \cosh (x)+c \cosh ^2(x)} \, dx=\frac {\sqrt {2} \left (-\frac {\left (-2 c d+\left (b+\sqrt {b^2-4 a c}\right ) e\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+2 c (a+c)-b \sqrt {b^2-4 a c}}}+\frac {\left (2 c d+\left (-b+\sqrt {b^2-4 a c}\right ) e\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+2 c (a+c)+b \sqrt {b^2-4 a c}}}\right )}{\sqrt {b^2-4 a c}} \] Input:

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

Output:

(Sqrt[2]*(-(((-2*c*d + (b + Sqrt[b^2 - 4*a*c])*e)*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 + 2*c*(a + c) - b*Sqrt[b^2 - 4*a*c]]) + ((2*c*d + (-b + Sqrt 
[b^2 - 4*a*c])*e)*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 + 2*c*(a + c) + b 
*Sqrt[b^2 - 4*a*c]]))/Sqrt[b^2 - 4*a*c]
 

Rubi [A] (verified)

Time = 0.57 (sec) , antiderivative size = 246, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.238, Rules used = {3042, 3774, 3042, 3138, 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 {d+e \cosh (x)}{a+b \cosh (x)+c \cosh ^2(x)} \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {d+e \cos (i x)}{a+b \cos (i x)+c \cos (i x)^2}dx\)

\(\Big \downarrow \) 3774

\(\displaystyle \left (\frac {2 c d-b e}{\sqrt {b^2-4 a c}}+e\right ) \int \frac {1}{b+2 c \cosh (x)-\sqrt {b^2-4 a c}}dx+\left (e-\frac {2 c d-b e}{\sqrt {b^2-4 a c}}\right ) \int \frac {1}{b+2 c \cosh (x)+\sqrt {b^2-4 a c}}dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \left (\frac {2 c d-b e}{\sqrt {b^2-4 a c}}+e\right ) \int \frac {1}{b+2 c \sin \left (i x+\frac {\pi }{2}\right )-\sqrt {b^2-4 a c}}dx+\left (e-\frac {2 c d-b e}{\sqrt {b^2-4 a c}}\right ) \int \frac {1}{b+2 c \sin \left (i x+\frac {\pi }{2}\right )+\sqrt {b^2-4 a c}}dx\)

\(\Big \downarrow \) 3138

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

\(\Big \downarrow \) 221

\(\displaystyle \frac {2 \left (\frac {2 c d-b e}{\sqrt {b^2-4 a c}}+e\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 )}{\sqrt {-\sqrt {b^2-4 a c}+b-2 c} \sqrt {-\sqrt {b^2-4 a c}+b+2 c}}+\frac {2 \left (e-\frac {2 c d-b e}{\sqrt {b^2-4 a c}}\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 )}{\sqrt {\sqrt {b^2-4 a c}+b-2 c} \sqrt {\sqrt {b^2-4 a c}+b+2 c}}\)

Input:

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

Output:

(2*(e + (2*c*d - b*e)/Sqrt[b^2 - 4*a*c])*ArcTanh[(Sqrt[b - 2*c - Sqrt[b^2 
- 4*a*c]]*Tanh[x/2])/Sqrt[b + 2*c - Sqrt[b^2 - 4*a*c]]])/(Sqrt[b - 2*c - S 
qrt[b^2 - 4*a*c]]*Sqrt[b + 2*c - Sqrt[b^2 - 4*a*c]]) + (2*(e - (2*c*d - b* 
e)/Sqrt[b^2 - 4*a*c])*ArcTanh[(Sqrt[b - 2*c + Sqrt[b^2 - 4*a*c]]*Tanh[x/2] 
)/Sqrt[b + 2*c + Sqrt[b^2 - 4*a*c]]])/(Sqrt[b - 2*c + Sqrt[b^2 - 4*a*c]]*S 
qrt[b + 2*c + Sqrt[b^2 - 4*a*c]])
 

Defintions of rubi rules used

rule 221
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 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 3138
Int[((a_) + (b_.)*sin[Pi/2 + (c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> With[{ 
e = FreeFactors[Tan[(c + d*x)/2], x]}, Simp[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 3774
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]}, Simp[(B + (b*B - 2*A*c)/q)   Int[1/(b + q + 2*c*Cos[d + e*x]) 
, x], x] + Simp[(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]
 
Maple [A] (verified)

Time = 3.86 (sec) , antiderivative size = 254, normalized size of antiderivative = 1.03

method result size
default \(2 \left (a -b +c \right ) \left (\frac {\left (-d \sqrt {-4 a c +b^{2}}+e \sqrt {-4 a c +b^{2}}+2 a e -b d -b e +2 c d \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 (-d \sqrt {-4 a c +b^{2}}+e \sqrt {-4 a c +b^{2}}-2 a e +b d +b e -2 c d \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 )\) \(254\)
risch \(\text {Expression too large to display}\) \(8285\)

Input:

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

Output:

2*(a-b+c)*(1/2*(-d*(-4*a*c+b^2)^(1/2)+e*(-4*a*c+b^2)^(1/2)+2*a*e-b*d-b*e+2 
*c*d)/(-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 
*(-d*(-4*a*c+b^2)^(1/2)+e*(-4*a*c+b^2)^(1/2)-2*a*e+b*d+b*e-2*c*d)/(-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. 6997 vs. \(2 (206) = 412\).

Time = 2.98 (sec) , antiderivative size = 6997, normalized size of antiderivative = 28.44 \[ \int \frac {d+e \cosh (x)}{a+b \cosh (x)+c \cosh ^2(x)} \, dx=\text {Too large to display} \] Input:

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

Output:

Too large to include
 

Sympy [F(-1)]

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

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

Output:

Timed out
 

Maxima [F]

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

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

Output:

integrate((e*cosh(x) + d)/(c*cosh(x)^2 + b*cosh(x) + a), x)
 

Giac [A] (verification not implemented)

Time = 1.22 (sec) , antiderivative size = 1, normalized size of antiderivative = 0.00 \[ \int \frac {d+e \cosh (x)}{a+b \cosh (x)+c \cosh ^2(x)} \, dx=0 \] Input:

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

Output:

0
 

Mupad [F(-1)]

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

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

Output:

\text{Hanged}
 

Reduce [F]

\[ \int \frac {d+e \cosh (x)}{a+b \cosh (x)+c \cosh ^2(x)} \, dx=\frac {-8 \left (\int \frac {e^{2 x}}{e^{4 x} c +2 e^{3 x} b +4 e^{2 x} a +2 e^{2 x} c +2 e^{x} b +c}d x \right ) a e +4 \left (\int \frac {e^{2 x}}{e^{4 x} c +2 e^{3 x} b +4 e^{2 x} a +2 e^{2 x} c +2 e^{x} b +c}d x \right ) b d -4 \left (\int \frac {e^{2 x}}{e^{4 x} c +2 e^{3 x} b +4 e^{2 x} a +2 e^{2 x} c +2 e^{x} b +c}d x \right ) c e -4 \left (\int \frac {e^{x}}{e^{4 x} c +2 e^{3 x} b +4 e^{2 x} a +2 e^{2 x} c +2 e^{x} b +c}d x \right ) b e -4 \left (\int \frac {1}{e^{4 x} c +2 e^{3 x} b +4 e^{2 x} a +2 e^{2 x} c +2 e^{x} b +c}d x \right ) c e -\mathrm {log}\left (e^{4 x} c +2 e^{3 x} b +4 e^{2 x} a +2 e^{2 x} c +2 e^{x} b +c \right ) e +4 e x}{b} \] Input:

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

Output:

( - 8*int(e**(2*x)/(e**(4*x)*c + 2*e**(3*x)*b + 4*e**(2*x)*a + 2*e**(2*x)* 
c + 2*e**x*b + c),x)*a*e + 4*int(e**(2*x)/(e**(4*x)*c + 2*e**(3*x)*b + 4*e 
**(2*x)*a + 2*e**(2*x)*c + 2*e**x*b + c),x)*b*d - 4*int(e**(2*x)/(e**(4*x) 
*c + 2*e**(3*x)*b + 4*e**(2*x)*a + 2*e**(2*x)*c + 2*e**x*b + c),x)*c*e - 4 
*int(e**x/(e**(4*x)*c + 2*e**(3*x)*b + 4*e**(2*x)*a + 2*e**(2*x)*c + 2*e** 
x*b + c),x)*b*e - 4*int(1/(e**(4*x)*c + 2*e**(3*x)*b + 4*e**(2*x)*a + 2*e* 
*(2*x)*c + 2*e**x*b + c),x)*c*e - log(e**(4*x)*c + 2*e**(3*x)*b + 4*e**(2* 
x)*a + 2*e**(2*x)*c + 2*e**x*b + c)*e + 4*e*x)/b