3.7.6 \(\int (a \cosh (c+d x)-a \sinh (c+d x))^2 \, dx\) [606]

Optimal. Leaf size=27 \[ -\frac {(a \cosh (c+d x)-a \sinh (c+d x))^2}{2 d} \]

[Out]

-1/2*(a*cosh(d*x+c)-a*sinh(d*x+c))^2/d

________________________________________________________________________________________

Rubi [A]
time = 0.01, antiderivative size = 27, normalized size of antiderivative = 1.00, number of steps used = 1, number of rules used = 1, integrand size = 20, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.050, Rules used = {3150} \begin {gather*} -\frac {(a \cosh (c+d x)-a \sinh (c+d x))^2}{2 d} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

-1/2*(a*Cosh[c + d*x] - a*Sinh[c + d*x])^2/d

Rule 3150

Int[(cos[(c_.) + (d_.)*(x_)]*(a_.) + (b_.)*sin[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[a*((a*Cos[c + d*x]
 + b*Sin[c + d*x])^n/(b*d*n)), x] /; FreeQ[{a, b, c, d, n}, x] && EqQ[a^2 + b^2, 0]

Rubi steps

\begin {align*} \int (a \cosh (c+d x)-a \sinh (c+d x))^2 \, dx &=-\frac {(a \cosh (c+d x)-a \sinh (c+d x))^2}{2 d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.02, size = 27, normalized size = 1.00 \begin {gather*} -\frac {(a \cosh (c+d x)-a \sinh (c+d x))^2}{2 d} \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

-1/2*(a*Cosh[c + d*x] - a*Sinh[c + d*x])^2/d

________________________________________________________________________________________

Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(70\) vs. \(2(25)=50\).
time = 3.36, size = 71, normalized size = 2.63

method result size
risch \(-\frac {a^{2} {\mathrm e}^{-2 d x -2 c}}{2 d}\) \(18\)
gosper \(-\frac {a^{2} \left (\cosh \left (d x +c \right )-\sinh \left (d x +c \right )\right )^{2}}{2 d}\) \(26\)
derivativedivides \(\frac {a^{2} \left (\frac {\cosh \left (d x +c \right ) \sinh \left (d x +c \right )}{2}-\frac {d x}{2}-\frac {c}{2}\right )-a^{2} \left (\cosh ^{2}\left (d x +c \right )\right )+a^{2} \left (\frac {\cosh \left (d x +c \right ) \sinh \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )}{d}\) \(71\)
default \(\frac {a^{2} \left (\frac {\cosh \left (d x +c \right ) \sinh \left (d x +c \right )}{2}-\frac {d x}{2}-\frac {c}{2}\right )-a^{2} \left (\cosh ^{2}\left (d x +c \right )\right )+a^{2} \left (\frac {\cosh \left (d x +c \right ) \sinh \left (d x +c \right )}{2}+\frac {d x}{2}+\frac {c}{2}\right )}{d}\) \(71\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a*cosh(d*x+c)-a*sinh(d*x+c))^2,x,method=_RETURNVERBOSE)

[Out]

1/d*(a^2*(1/2*cosh(d*x+c)*sinh(d*x+c)-1/2*d*x-1/2*c)-a^2*cosh(d*x+c)^2+a^2*(1/2*cosh(d*x+c)*sinh(d*x+c)+1/2*d*
x+1/2*c))

________________________________________________________________________________________

Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 89 vs. \(2 (25) = 50\).
time = 0.26, size = 89, normalized size = 3.30 \begin {gather*} \frac {1}{8} \, a^{2} {\left (4 \, x + \frac {e^{\left (2 \, d x + 2 \, c\right )}}{d} - \frac {e^{\left (-2 \, d x - 2 \, c\right )}}{d}\right )} - \frac {1}{8} \, a^{2} {\left (4 \, x - \frac {e^{\left (2 \, d x + 2 \, c\right )}}{d} + \frac {e^{\left (-2 \, d x - 2 \, c\right )}}{d}\right )} - \frac {a^{2} \cosh \left (d x + c\right )^{2}}{d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/8*a^2*(4*x + e^(2*d*x + 2*c)/d - e^(-2*d*x - 2*c)/d) - 1/8*a^2*(4*x - e^(2*d*x + 2*c)/d + e^(-2*d*x - 2*c)/d
) - a^2*cosh(d*x + c)^2/d

________________________________________________________________________________________

Fricas [A]
time = 0.39, size = 43, normalized size = 1.59 \begin {gather*} -\frac {a^{2}}{2 \, {\left (d \cosh \left (d x + c\right )^{2} + 2 \, d \cosh \left (d x + c\right ) \sinh \left (d x + c\right ) + d \sinh \left (d x + c\right )^{2}\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-1/2*a^2/(d*cosh(d*x + c)^2 + 2*d*cosh(d*x + c)*sinh(d*x + c) + d*sinh(d*x + c)^2)

________________________________________________________________________________________

Sympy [A]
time = 0.08, size = 44, normalized size = 1.63 \begin {gather*} \begin {cases} \frac {a^{2} \sinh {\left (c + d x \right )} \cosh {\left (c + d x \right )}}{d} - \frac {a^{2} \cosh ^{2}{\left (c + d x \right )}}{d} & \text {for}\: d \neq 0 \\x \left (- a \sinh {\left (c \right )} + a \cosh {\left (c \right )}\right )^{2} & \text {otherwise} \end {cases} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a*cosh(d*x+c)-a*sinh(d*x+c))**2,x)

[Out]

Piecewise((a**2*sinh(c + d*x)*cosh(c + d*x)/d - a**2*cosh(c + d*x)**2/d, Ne(d, 0)), (x*(-a*sinh(c) + a*cosh(c)
)**2, True))

________________________________________________________________________________________

Giac [A]
time = 0.41, size = 17, normalized size = 0.63 \begin {gather*} -\frac {a^{2} e^{\left (-2 \, d x - 2 \, c\right )}}{2 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-1/2*a^2*e^(-2*d*x - 2*c)/d

________________________________________________________________________________________

Mupad [B]
time = 0.06, size = 17, normalized size = 0.63 \begin {gather*} -\frac {a^2\,{\mathrm {e}}^{-2\,c-2\,d\,x}}{2\,d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a*cosh(c + d*x) - a*sinh(c + d*x))^2,x)

[Out]

-(a^2*exp(- 2*c - 2*d*x))/(2*d)

________________________________________________________________________________________