### 3.750 $$\int \frac{1}{(a+a \cosh (x)+c \sinh (x))^2} \, dx$$

Optimal. Leaf size=43 $\frac{a \log \left (a+c \tanh \left (\frac{x}{2}\right )\right )}{c^3}-\frac{a \sinh (x)+c \cosh (x)}{c^2 (a \cosh (x)+a+c \sinh (x))}$

[Out]

(a*Log[a + c*Tanh[x/2]])/c^3 - (c*Cosh[x] + a*Sinh[x])/(c^2*(a + a*Cosh[x] + c*Sinh[x]))

________________________________________________________________________________________

Rubi [A]  time = 0.0406585, antiderivative size = 43, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 4, integrand size = 12, $$\frac{\text{number of rules}}{\text{integrand size}}$$ = 0.333, Rules used = {3129, 12, 3124, 31} $\frac{a \log \left (a+c \tanh \left (\frac{x}{2}\right )\right )}{c^3}-\frac{a \sinh (x)+c \cosh (x)}{c^2 (a \cosh (x)+a+c \sinh (x))}$

Antiderivative was successfully veriﬁed.

[In]

Int[(a + a*Cosh[x] + c*Sinh[x])^(-2),x]

[Out]

(a*Log[a + c*Tanh[x/2]])/c^3 - (c*Cosh[x] + a*Sinh[x])/(c^2*(a + a*Cosh[x] + c*Sinh[x]))

Rule 3129

Int[(cos[(d_.) + (e_.)*(x_)]*(b_.) + (a_) + (c_.)*sin[(d_.) + (e_.)*(x_)])^(n_), x_Symbol] :> Simp[((-(c*Cos[d
+ e*x]) + b*Sin[d + e*x])*(a + b*Cos[d + e*x] + c*Sin[d + e*x])^(n + 1))/(e*(n + 1)*(a^2 - b^2 - c^2)), x] +
Dist[1/((n + 1)*(a^2 - b^2 - c^2)), Int[(a*(n + 1) - b*(n + 2)*Cos[d + e*x] - c*(n + 2)*Sin[d + e*x])*(a + b*C
os[d + e*x] + c*Sin[d + e*x])^(n + 1), x], x] /; FreeQ[{a, b, c, d, e}, x] && NeQ[a^2 - b^2 - c^2, 0] && LtQ[n
, -1] && NeQ[n, -3/2]

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

Rule 3124

Int[(cos[(d_.) + (e_.)*(x_)]*(b_.) + (a_) + (c_.)*sin[(d_.) + (e_.)*(x_)])^(-1), x_Symbol] :> Module[{f = Free
Factors[Tan[(d + e*x)/2], x]}, Dist[(2*f)/e, Subst[Int[1/(a + b + 2*c*f*x + (a - b)*f^2*x^2), x], x, Tan[(d +
e*x)/2]/f], x]] /; FreeQ[{a, b, c, d, e}, x] && NeQ[a^2 - b^2 - c^2, 0]

Rule 31

Int[((a_) + (b_.)*(x_))^(-1), x_Symbol] :> Simp[Log[RemoveContent[a + b*x, x]]/b, x] /; FreeQ[{a, b}, x]

Rubi steps

\begin{align*} \int \frac{1}{(a+a \cosh (x)+c \sinh (x))^2} \, dx &=-\frac{c \cosh (x)+a \sinh (x)}{c^2 (a+a \cosh (x)+c \sinh (x))}+\frac{\int \frac{a}{a+a \cosh (x)+c \sinh (x)} \, dx}{c^2}\\ &=-\frac{c \cosh (x)+a \sinh (x)}{c^2 (a+a \cosh (x)+c \sinh (x))}+\frac{a \int \frac{1}{a+a \cosh (x)+c \sinh (x)} \, dx}{c^2}\\ &=-\frac{c \cosh (x)+a \sinh (x)}{c^2 (a+a \cosh (x)+c \sinh (x))}+\frac{(2 a) \operatorname{Subst}\left (\int \frac{1}{2 a+2 c x} \, dx,x,\tanh \left (\frac{x}{2}\right )\right )}{c^2}\\ &=\frac{a \log \left (a+c \tanh \left (\frac{x}{2}\right )\right )}{c^3}-\frac{c \cosh (x)+a \sinh (x)}{c^2 (a+a \cosh (x)+c \sinh (x))}\\ \end{align*}

Mathematica [B]  time = 0.291693, size = 87, normalized size = 2.02 $\frac{\frac{c \left (c^2-a^2\right ) \sinh \left (\frac{x}{2}\right )}{a \left (a \cosh \left (\frac{x}{2}\right )+c \sinh \left (\frac{x}{2}\right )\right )}+2 a \left (\log \left (a \cosh \left (\frac{x}{2}\right )+c \sinh \left (\frac{x}{2}\right )\right )-\log \left (\cosh \left (\frac{x}{2}\right )\right )\right )-c \tanh \left (\frac{x}{2}\right )}{2 c^3}$

Antiderivative was successfully veriﬁed.

[In]

Integrate[(a + a*Cosh[x] + c*Sinh[x])^(-2),x]

[Out]

(2*a*(-Log[Cosh[x/2]] + Log[a*Cosh[x/2] + c*Sinh[x/2]]) + (c*(-a^2 + c^2)*Sinh[x/2])/(a*(a*Cosh[x/2] + c*Sinh[
x/2])) - c*Tanh[x/2])/(2*c^3)

________________________________________________________________________________________

Maple [A]  time = 0.063, size = 58, normalized size = 1.4 \begin{align*} -{\frac{1}{2\,{c}^{2}}\tanh \left ({\frac{x}{2}} \right ) }+{\frac{{a}^{2}}{2\,{c}^{3}} \left ( a+c\tanh \left ({\frac{x}{2}} \right ) \right ) ^{-1}}-{\frac{1}{2\,c} \left ( a+c\tanh \left ({\frac{x}{2}} \right ) \right ) ^{-1}}+{\frac{a}{{c}^{3}}\ln \left ( a+c\tanh \left ({\frac{x}{2}} \right ) \right ) } \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

int(1/(a+a*cosh(x)+c*sinh(x))^2,x)

[Out]

-1/2/c^2*tanh(1/2*x)+1/2/c^3/(a+c*tanh(1/2*x))*a^2-1/2/c/(a+c*tanh(1/2*x))+a*ln(a+c*tanh(1/2*x))/c^3

________________________________________________________________________________________

Maxima [B]  time = 1.04669, size = 116, normalized size = 2.7 \begin{align*} -\frac{2 \,{\left (a e^{\left (-x\right )} + a + c\right )}}{2 \, a c^{2} e^{\left (-x\right )} + a c^{2} + c^{3} +{\left (a c^{2} - c^{3}\right )} e^{\left (-2 \, x\right )}} + \frac{a \log \left (-{\left (a - c\right )} e^{\left (-x\right )} - a - c\right )}{c^{3}} - \frac{a \log \left (e^{\left (-x\right )} + 1\right )}{c^{3}} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-2*(a*e^(-x) + a + c)/(2*a*c^2*e^(-x) + a*c^2 + c^3 + (a*c^2 - c^3)*e^(-2*x)) + a*log(-(a - c)*e^(-x) - a - c)
/c^3 - a*log(e^(-x) + 1)/c^3

________________________________________________________________________________________

Fricas [B]  time = 2.41647, size = 657, normalized size = 15.28 \begin{align*} \frac{2 \, a c \cosh \left (x\right ) + 2 \, a c \sinh \left (x\right ) + 2 \, a c - 2 \, c^{2} +{\left (2 \, a^{2} \cosh \left (x\right ) +{\left (a^{2} + a c\right )} \cosh \left (x\right )^{2} +{\left (a^{2} + a c\right )} \sinh \left (x\right )^{2} + a^{2} - a c + 2 \,{\left (a^{2} +{\left (a^{2} + a c\right )} \cosh \left (x\right )\right )} \sinh \left (x\right )\right )} \log \left ({\left (a + c\right )} \cosh \left (x\right ) +{\left (a + c\right )} \sinh \left (x\right ) + a - c\right ) -{\left (2 \, a^{2} \cosh \left (x\right ) +{\left (a^{2} + a c\right )} \cosh \left (x\right )^{2} +{\left (a^{2} + a c\right )} \sinh \left (x\right )^{2} + a^{2} - a c + 2 \,{\left (a^{2} +{\left (a^{2} + a c\right )} \cosh \left (x\right )\right )} \sinh \left (x\right )\right )} \log \left (\cosh \left (x\right ) + \sinh \left (x\right ) + 1\right )}{2 \, a c^{3} \cosh \left (x\right ) + a c^{3} - c^{4} +{\left (a c^{3} + c^{4}\right )} \cosh \left (x\right )^{2} +{\left (a c^{3} + c^{4}\right )} \sinh \left (x\right )^{2} + 2 \,{\left (a c^{3} +{\left (a c^{3} + c^{4}\right )} \cosh \left (x\right )\right )} \sinh \left (x\right )} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

(2*a*c*cosh(x) + 2*a*c*sinh(x) + 2*a*c - 2*c^2 + (2*a^2*cosh(x) + (a^2 + a*c)*cosh(x)^2 + (a^2 + a*c)*sinh(x)^
2 + a^2 - a*c + 2*(a^2 + (a^2 + a*c)*cosh(x))*sinh(x))*log((a + c)*cosh(x) + (a + c)*sinh(x) + a - c) - (2*a^2
*cosh(x) + (a^2 + a*c)*cosh(x)^2 + (a^2 + a*c)*sinh(x)^2 + a^2 - a*c + 2*(a^2 + (a^2 + a*c)*cosh(x))*sinh(x))*
log(cosh(x) + sinh(x) + 1))/(2*a*c^3*cosh(x) + a*c^3 - c^4 + (a*c^3 + c^4)*cosh(x)^2 + (a*c^3 + c^4)*sinh(x)^2
+ 2*(a*c^3 + (a*c^3 + c^4)*cosh(x))*sinh(x))

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

integrate(1/(a+a*cosh(x)+c*sinh(x))**2,x)

[Out]

Timed out

________________________________________________________________________________________

Giac [B]  time = 1.13695, size = 113, normalized size = 2.63 \begin{align*} \frac{{\left (a^{2} + a c\right )} \log \left ({\left | a e^{x} + c e^{x} + a - c \right |}\right )}{a c^{3} + c^{4}} - \frac{a \log \left (e^{x} + 1\right )}{c^{3}} + \frac{2 \,{\left (a e^{x} + a - c\right )}}{{\left (a e^{\left (2 \, x\right )} + c e^{\left (2 \, x\right )} + 2 \, a e^{x} + a - c\right )} c^{2}} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

(a^2 + a*c)*log(abs(a*e^x + c*e^x + a - c))/(a*c^3 + c^4) - a*log(e^x + 1)/c^3 + 2*(a*e^x + a - c)/((a*e^(2*x)
+ c*e^(2*x) + 2*a*e^x + a - c)*c^2)