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

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

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.0345935, antiderivative size = 57, 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 (3 a^2-c^2\right )+\frac{3}{2} a^2 \sinh (x)+\frac{3}{2} a c \cosh (x)+\frac{1}{2} (a \sinh (x)+c \cosh (x)) (a \cosh (x)+a+c \sinh (x))$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

((3*a^2 - c^2)*x)/2 + (3*a*c*Cosh[x])/2 + (3*a^2*Sinh[x])/2 + ((c*Cosh[x] + a*Sinh[x])*(a + a*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+a \cosh (x)+c \sinh (x))^2 \, dx &=\frac{1}{2} (c \cosh (x)+a \sinh (x)) (a+a \cosh (x)+c \sinh (x))+\frac{1}{2} \int \left (3 a^2-c^2+3 a^2 \cosh (x)+3 a c \sinh (x)\right ) \, dx\\ &=\frac{1}{2} \left (3 a^2-c^2\right ) x+\frac{1}{2} (c \cosh (x)+a \sinh (x)) (a+a \cosh (x)+c \sinh (x))+\frac{1}{2} \left (3 a^2\right ) \int \cosh (x) \, dx+\frac{1}{2} (3 a c) \int \sinh (x) \, dx\\ &=\frac{1}{2} \left (3 a^2-c^2\right ) x+\frac{3}{2} a c \cosh (x)+\frac{3}{2} a^2 \sinh (x)+\frac{1}{2} (c \cosh (x)+a \sinh (x)) (a+a \cosh (x)+c \sinh (x))\\ \end{align*}

Mathematica [A]  time = 0.0697247, size = 55, normalized size = 0.96 $\frac{1}{2} x \left (3 a^2-c^2\right )+\frac{1}{4} \left (a^2+c^2\right ) \sinh (2 x)+2 a^2 \sinh (x)+2 a c \cosh (x)+\frac{1}{2} a c \cosh (2 x)$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [A]  time = 0.02, size = 55, normalized size = 1. \begin{align*}{a}^{2}x+2\,{a}^{2}\sinh \left ( x \right ) +2\,ac\cosh \left ( x \right ) +{a}^{2} \left ({\frac{\cosh \left ( x \right ) \sinh \left ( x \right ) }{2}}+{\frac{x}{2}} \right ) +ac \left ( \cosh \left ( x \right ) \right ) ^{2}+{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+a*cosh(x)+c*sinh(x))^2,x)

[Out]

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

________________________________________________________________________________________

Maxima [A]  time = 0.98096, size = 85, normalized size = 1.49 \begin{align*} a c \cosh \left (x\right )^{2} + \frac{1}{8} \, a^{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 ) + a \sinh \left (x\right )\right )} a \end{align*}

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

[In]

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

[Out]

a*c*cosh(x)^2 + 1/8*a^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)
+ a*sinh(x))*a

________________________________________________________________________________________

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

[Out]

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

________________________________________________________________________________________

Sympy [A]  time = 0.433168, size = 100, normalized size = 1.75 \begin{align*} - \frac{a^{2} x \sinh ^{2}{\left (x \right )}}{2} + \frac{a^{2} x \cosh ^{2}{\left (x \right )}}{2} + a^{2} x + \frac{a^{2} \sinh{\left (x \right )} \cosh{\left (x \right )}}{2} + 2 a^{2} \sinh{\left (x \right )} + a c \sinh ^{2}{\left (x \right )} + 2 a c \cosh{\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+a*cosh(x)+c*sinh(x))**2,x)

[Out]

-a**2*x*sinh(x)**2/2 + a**2*x*cosh(x)**2/2 + a**2*x + a**2*sinh(x)*cosh(x)/2 + 2*a**2*sinh(x) + a*c*sinh(x)**2
+ 2*a*c*cosh(x) + 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.14582, size = 109, normalized size = 1.91 \begin{align*} \frac{1}{8} \, a^{2} e^{\left (2 \, x\right )} + \frac{1}{4} \, a c e^{\left (2 \, x\right )} + \frac{1}{8} \, c^{2} e^{\left (2 \, x\right )} + a^{2} e^{x} + a c e^{x} + \frac{1}{2} \,{\left (3 \, a^{2} - c^{2}\right )} x - \frac{1}{8} \,{\left (a^{2} - 2 \, a c + c^{2} + 8 \,{\left (a^{2} - 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+a*cosh(x)+c*sinh(x))^2,x, algorithm="giac")

[Out]

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