### 3.740 $$\int (a+b \cosh (x)+c \sinh (x))^2 \, dx$$

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

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.0354636, antiderivative size = 59, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 12, $$\frac{\text{number of rules}}{\text{integrand size}}$$ = 0.25, Rules used = {3120, 2637, 2638} $\frac{1}{2} x \left (2 a^2+b^2-c^2\right )+\frac{1}{2} (b \sinh (x)+c \cosh (x)) (a+b \cosh (x)+c \sinh (x))+\frac{3}{2} a b \sinh (x)+\frac{3}{2} a c \cosh (x)$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

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

Rule 3120

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), x] + Dist[1/n, Int[Simp[n*a^2 +
(n - 1)*(b^2 + c^2) + a*b*(2*n - 1)*Cos[d + e*x] + a*c*(2*n - 1)*Sin[d + e*x], x]*(a + b*Cos[d + e*x] + c*Sin
[d + e*x])^(n - 2), x], x] /; FreeQ[{a, b, c, d, e}, x] && NeQ[a^2 - b^2 - c^2, 0] && GtQ[n, 1]

Rule 2637

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

Rule 2638

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

Rubi steps

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

Mathematica [A]  time = 0.0814906, size = 54, normalized size = 0.92 $\frac{1}{4} \left (2 x \left (2 a^2+b^2-c^2\right )+8 a b \sinh (x)+8 a c \cosh (x)+\left (b^2+c^2\right ) \sinh (2 x)+2 b c \cosh (2 x)\right )$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

(2*(2*a^2 + b^2 - c^2)*x + 8*a*c*Cosh[x] + 2*b*c*Cosh[2*x] + 8*a*b*Sinh[x] + (b^2 + c^2)*Sinh[2*x])/4

________________________________________________________________________________________

Maple [A]  time = 0.023, size = 54, normalized size = 0.9 \begin{align*}{a}^{2}x+2\,ab\sinh \left ( x \right ) +2\,ac\cosh \left ( x \right ) +{b}^{2} \left ({\frac{\cosh \left ( x \right ) \sinh \left ( x \right ) }{2}}+{\frac{x}{2}} \right ) +b \left ( \cosh \left ( x \right ) \right ) ^{2}c+{c}^{2} \left ({\frac{\cosh \left ( x \right ) \sinh \left ( x \right ) }{2}}-{\frac{x}{2}} \right ) \end{align*}

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

[In]

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

[Out]

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

________________________________________________________________________________________

Maxima [A]  time = 1.00798, size = 85, normalized size = 1.44 \begin{align*} b c \cosh \left (x\right )^{2} + \frac{1}{8} \, b^{2}{\left (4 \, x + e^{\left (2 \, x\right )} - e^{\left (-2 \, x\right )}\right )} - \frac{1}{8} \, c^{2}{\left (4 \, x - e^{\left (2 \, x\right )} + e^{\left (-2 \, x\right )}\right )} + a^{2} x + 2 \,{\left (c \cosh \left (x\right ) + b \sinh \left (x\right )\right )} a \end{align*}

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

[In]

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

[Out]

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

________________________________________________________________________________________

Fricas [A]  time = 1.95671, size = 171, normalized size = 2.9 \begin{align*} \frac{1}{2} \, b c \cosh \left (x\right )^{2} + \frac{1}{2} \, b c \sinh \left (x\right )^{2} + 2 \, a c \cosh \left (x\right ) + \frac{1}{2} \,{\left (2 \, a^{2} + b^{2} - c^{2}\right )} x + \frac{1}{2} \,{\left (4 \, a b +{\left (b^{2} + c^{2}\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((a+b*cosh(x)+c*sinh(x))^2,x, algorithm="fricas")

[Out]

1/2*b*c*cosh(x)^2 + 1/2*b*c*sinh(x)^2 + 2*a*c*cosh(x) + 1/2*(2*a^2 + b^2 - c^2)*x + 1/2*(4*a*b + (b^2 + c^2)*c
osh(x))*sinh(x)

________________________________________________________________________________________

Sympy [A]  time = 0.352485, size = 100, normalized size = 1.69 \begin{align*} a^{2} x + 2 a b \sinh{\left (x \right )} + 2 a c \cosh{\left (x \right )} - \frac{b^{2} x \sinh ^{2}{\left (x \right )}}{2} + \frac{b^{2} x \cosh ^{2}{\left (x \right )}}{2} + \frac{b^{2} \sinh{\left (x \right )} \cosh{\left (x \right )}}{2} + b c \sinh ^{2}{\left (x \right )} + \frac{c^{2} x \sinh ^{2}{\left (x \right )}}{2} - \frac{c^{2} x \cosh ^{2}{\left (x \right )}}{2} + \frac{c^{2} \sinh{\left (x \right )} \cosh{\left (x \right )}}{2} \end{align*}

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

[In]

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

[Out]

a**2*x + 2*a*b*sinh(x) + 2*a*c*cosh(x) - b**2*x*sinh(x)**2/2 + b**2*x*cosh(x)**2/2 + b**2*sinh(x)*cosh(x)/2 +
b*c*sinh(x)**2 + c**2*x*sinh(x)**2/2 - c**2*x*cosh(x)**2/2 + c**2*sinh(x)*cosh(x)/2

________________________________________________________________________________________

Giac [A]  time = 1.13587, size = 112, normalized size = 1.9 \begin{align*} \frac{1}{8} \, b^{2} e^{\left (2 \, x\right )} + \frac{1}{4} \, b c e^{\left (2 \, x\right )} + \frac{1}{8} \, c^{2} e^{\left (2 \, x\right )} + a b e^{x} + a c e^{x} + \frac{1}{2} \,{\left (2 \, a^{2} + b^{2} - c^{2}\right )} x - \frac{1}{8} \,{\left (b^{2} - 2 \, b c + c^{2} + 8 \,{\left (a b - a c\right )} e^{x}\right )} e^{\left (-2 \, x\right )} \end{align*}

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

[In]

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

[Out]

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