Integrand size = 27, antiderivative size = 72 \[ \int e^{a+b x} (g \cosh (d+b x)+f \sinh (d+b x))^2 \, dx=-\frac {e^{a-2 d-b x} (f-g)^2}{4 b}+\frac {e^{a+2 d+3 b x} (f+g)^2}{12 b}-\frac {e^{a+b x} \left (f^2-g^2\right )}{2 b} \] Output:
-1/4*exp(-b*x+a-2*d)*(f-g)^2/b+1/12*exp(3*b*x+a+2*d)*(f+g)^2/b-1/2*exp(b*x +a)*(f^2-g^2)/b
Time = 0.42 (sec) , antiderivative size = 69, normalized size of antiderivative = 0.96 \[ \int e^{a+b x} (g \cosh (d+b x)+f \sinh (d+b x))^2 \, dx=\frac {e^{a-d} \left (-e^{-d-b x} (f-g)^2-2 e^{d+b x} (f-g) (f+g)+\frac {1}{3} e^{3 (d+b x)} (f+g)^2\right )}{4 b} \] Input:
Integrate[E^(a + b*x)*(g*Cosh[d + b*x] + f*Sinh[d + b*x])^2,x]
Output:
(E^(a - d)*(-(E^(-d - b*x)*(f - g)^2) - 2*E^(d + b*x)*(f - g)*(f + g) + (E ^(3*(d + b*x))*(f + g)^2)/3))/(4*b)
Time = 0.35 (sec) , antiderivative size = 57, normalized size of antiderivative = 0.79, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.148, Rules used = {2720, 27, 244, 2009}
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 e^{a+b x} (f \sinh (b x+d)+g \cosh (b x+d))^2 \, dx\) |
\(\Big \downarrow \) 2720 |
\(\displaystyle \frac {\int \frac {1}{4} e^{a-2 b x} \left (f-g-e^{2 b x} (f+g)\right )^2de^{b x}}{b}\) |
\(\Big \downarrow \) 27 |
\(\displaystyle \frac {e^a \int e^{-2 b x} \left (f-g-e^{2 b x} (f+g)\right )^2de^{b x}}{4 b}\) |
\(\Big \downarrow \) 244 |
\(\displaystyle \frac {e^a \int \left (e^{-2 b x} (f-g)^2+e^{2 b x} (f+g)^2-2 \left (f^2-g^2\right )\right )de^{b x}}{4 b}\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {e^a \left (-2 e^{b x} \left (f^2-g^2\right )-e^{-b x} (f-g)^2+\frac {1}{3} e^{3 b x} (f+g)^2\right )}{4 b}\) |
Input:
Int[E^(a + b*x)*(g*Cosh[d + b*x] + f*Sinh[d + b*x])^2,x]
Output:
(E^a*(-((f - g)^2/E^(b*x)) + (E^(3*b*x)*(f + g)^2)/3 - 2*E^(b*x)*(f^2 - g^ 2)))/(4*b)
Int[(a_)*(Fx_), x_Symbol] :> Simp[a Int[Fx, x], x] /; FreeQ[a, x] && !Ma tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
Int[((c_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^2)^(p_.), x_Symbol] :> Int[Expand Integrand[(c*x)^m*(a + b*x^2)^p, x], x] /; FreeQ[{a, b, c, m}, x] && IGtQ[p , 0]
Int[u_, x_Symbol] :> With[{v = FunctionOfExponential[u, x]}, Simp[v/D[v, x] Subst[Int[FunctionOfExponentialFunction[u, x]/x, x], x, v], x]] /; Funct ionOfExponentialQ[u, x] && !MatchQ[u, (w_)*((a_.)*(v_)^(n_))^(m_) /; FreeQ [{a, m, n}, x] && IntegerQ[m*n]] && !MatchQ[u, E^((c_.)*((a_.) + (b_.)*x)) *(F_)[v_] /; FreeQ[{a, b, c}, x] && InverseFunctionQ[F[x]]]
Leaf count of result is larger than twice the leaf count of optimal. \(135\) vs. \(2(63)=126\).
Time = 28.40 (sec) , antiderivative size = 136, normalized size of antiderivative = 1.89
method | result | size |
risch | \(\frac {{\mathrm e}^{3 b x +a +2 d} f^{2}}{12 b}+\frac {{\mathrm e}^{3 b x +a +2 d} f g}{6 b}+\frac {{\mathrm e}^{3 b x +a +2 d} g^{2}}{12 b}-\frac {{\mathrm e}^{b x +a} f^{2}}{2 b}+\frac {{\mathrm e}^{b x +a} g^{2}}{2 b}-\frac {{\mathrm e}^{-b x +a -2 d} f^{2}}{4 b}+\frac {{\mathrm e}^{-b x +a -2 d} f g}{2 b}-\frac {{\mathrm e}^{-b x +a -2 d} g^{2}}{4 b}\) | \(136\) |
default | \(\frac {\left (\frac {g^{2}}{2}-\frac {f^{2}}{2}\right ) \sinh \left (b x +a \right )}{b}+\frac {\left (\frac {g^{2}}{2}-\frac {f^{2}}{2}\right ) \cosh \left (b x +a \right )}{b}-\frac {\left (\frac {1}{4} g^{2}+\frac {1}{4} f^{2}-\frac {1}{2} f g \right ) \sinh \left (-b x +a -2 d \right )}{b}+\frac {\left (-\frac {1}{4} f^{2}+\frac {1}{2} f g -\frac {1}{4} g^{2}\right ) \cosh \left (-b x +a -2 d \right )}{b}+\frac {\left (\frac {1}{4} g^{2}+\frac {1}{4} f^{2}+\frac {1}{2} f g \right ) \sinh \left (3 b x +a +2 d \right )}{3 b}+\frac {\left (\frac {1}{4} g^{2}+\frac {1}{4} f^{2}+\frac {1}{2} f g \right ) \cosh \left (3 b x +a +2 d \right )}{3 b}\) | \(163\) |
parts | \(f^{2} \left (-\frac {\sinh \left (b x +a \right )}{2 b}-\frac {\sinh \left (-b x +a -2 d \right )}{4 b}+\frac {\sinh \left (3 b x +a +2 d \right )}{12 b}-\frac {\cosh \left (b x +a \right )}{2 b}-\frac {\cosh \left (-b x +a -2 d \right )}{4 b}+\frac {\cosh \left (3 b x +a +2 d \right )}{12 b}\right )+g^{2} \left (\frac {\sinh \left (b x +a \right )}{2 b}-\frac {\sinh \left (-b x +a -2 d \right )}{4 b}+\frac {\sinh \left (3 b x +a +2 d \right )}{12 b}+\frac {\cosh \left (b x +a \right )}{2 b}-\frac {\cosh \left (-b x +a -2 d \right )}{4 b}+\frac {\cosh \left (3 b x +a +2 d \right )}{12 b}\right )+2 f g \left (\frac {\sinh \left (-b x +a -2 d \right )}{4 b}+\frac {\sinh \left (3 b x +a +2 d \right )}{12 b}+\frac {\cosh \left (-b x +a -2 d \right )}{4 b}+\frac {\cosh \left (3 b x +a +2 d \right )}{12 b}\right )\) | \(241\) |
orering | \(\frac {{\mathrm e}^{b x +a} \left (g \cosh \left (b x +d \right )+f \sinh \left (b x +d \right )\right )^{2}}{3 b}+\frac {b \,{\mathrm e}^{b x +a} \left (g \cosh \left (b x +d \right )+f \sinh \left (b x +d \right )\right )^{2}+2 \,{\mathrm e}^{b x +a} \left (g \cosh \left (b x +d \right )+f \sinh \left (b x +d \right )\right ) \left (g b \sinh \left (b x +d \right )+f b \cosh \left (b x +d \right )\right )}{b^{2}}-\frac {b^{2} {\mathrm e}^{b x +a} \left (g \cosh \left (b x +d \right )+f \sinh \left (b x +d \right )\right )^{2}+4 b \,{\mathrm e}^{b x +a} \left (g \cosh \left (b x +d \right )+f \sinh \left (b x +d \right )\right ) \left (g b \sinh \left (b x +d \right )+f b \cosh \left (b x +d \right )\right )+2 \,{\mathrm e}^{b x +a} \left (g b \sinh \left (b x +d \right )+f b \cosh \left (b x +d \right )\right )^{2}+2 \,{\mathrm e}^{b x +a} \left (g \cosh \left (b x +d \right )+f \sinh \left (b x +d \right )\right ) \left (g \,b^{2} \cosh \left (b x +d \right )+f \,b^{2} \sinh \left (b x +d \right )\right )}{3 b^{3}}\) | \(265\) |
Input:
int(exp(b*x+a)*(g*cosh(b*x+d)+f*sinh(b*x+d))^2,x,method=_RETURNVERBOSE)
Output:
1/12/b*exp(3*b*x+a+2*d)*f^2+1/6/b*exp(3*b*x+a+2*d)*f*g+1/12/b*exp(3*b*x+a+ 2*d)*g^2-1/2*exp(b*x+a)/b*f^2+1/2*exp(b*x+a)/b*g^2-1/4/b*exp(-b*x+a-2*d)*f ^2+1/2/b*exp(-b*x+a-2*d)*f*g-1/4/b*exp(-b*x+a-2*d)*g^2
Leaf count of result is larger than twice the leaf count of optimal. 210 vs. \(2 (63) = 126\).
Time = 0.08 (sec) , antiderivative size = 210, normalized size of antiderivative = 2.92 \[ \int e^{a+b x} (g \cosh (d+b x)+f \sinh (d+b x))^2 \, dx=-\frac {{\left (f^{2} - 4 \, f g + g^{2}\right )} \cosh \left (b x + d\right )^{2} \cosh \left (-a + d\right ) + {\left ({\left (f^{2} - 4 \, f g + g^{2}\right )} \cosh \left (-a + d\right ) - {\left (f^{2} - 4 \, f g + g^{2}\right )} \sinh \left (-a + d\right )\right )} \sinh \left (b x + d\right )^{2} + 3 \, {\left (f^{2} - g^{2}\right )} \cosh \left (-a + d\right ) - 4 \, {\left ({\left (f^{2} - f g + g^{2}\right )} \cosh \left (b x + d\right ) \cosh \left (-a + d\right ) - {\left (f^{2} - f g + g^{2}\right )} \cosh \left (b x + d\right ) \sinh \left (-a + d\right )\right )} \sinh \left (b x + d\right ) - {\left ({\left (f^{2} - 4 \, f g + g^{2}\right )} \cosh \left (b x + d\right )^{2} + 3 \, f^{2} - 3 \, g^{2}\right )} \sinh \left (-a + d\right )}{6 \, {\left (b \cosh \left (b x + d\right ) - b \sinh \left (b x + d\right )\right )}} \] Input:
integrate(exp(b*x+a)*(g*cosh(b*x+d)+f*sinh(b*x+d))^2,x, algorithm="fricas" )
Output:
-1/6*((f^2 - 4*f*g + g^2)*cosh(b*x + d)^2*cosh(-a + d) + ((f^2 - 4*f*g + g ^2)*cosh(-a + d) - (f^2 - 4*f*g + g^2)*sinh(-a + d))*sinh(b*x + d)^2 + 3*( f^2 - g^2)*cosh(-a + d) - 4*((f^2 - f*g + g^2)*cosh(b*x + d)*cosh(-a + d) - (f^2 - f*g + g^2)*cosh(b*x + d)*sinh(-a + d))*sinh(b*x + d) - ((f^2 - 4* f*g + g^2)*cosh(b*x + d)^2 + 3*f^2 - 3*g^2)*sinh(-a + d))/(b*cosh(b*x + d) - b*sinh(b*x + d))
Leaf count of result is larger than twice the leaf count of optimal. 257 vs. \(2 (54) = 108\).
Time = 0.49 (sec) , antiderivative size = 257, normalized size of antiderivative = 3.57 \[ \int e^{a+b x} (g \cosh (d+b x)+f \sinh (d+b x))^2 \, dx=\begin {cases} \frac {f^{2} e^{a} e^{b x} \sinh ^{2}{\left (b x + d \right )}}{3 b} + \frac {2 f^{2} e^{a} e^{b x} \sinh {\left (b x + d \right )} \cosh {\left (b x + d \right )}}{3 b} - \frac {2 f^{2} e^{a} e^{b x} \cosh ^{2}{\left (b x + d \right )}}{3 b} + \frac {2 f g e^{a} e^{b x} \sinh ^{2}{\left (b x + d \right )}}{3 b} - \frac {2 f g e^{a} e^{b x} \sinh {\left (b x + d \right )} \cosh {\left (b x + d \right )}}{3 b} + \frac {2 f g e^{a} e^{b x} \cosh ^{2}{\left (b x + d \right )}}{3 b} - \frac {2 g^{2} e^{a} e^{b x} \sinh ^{2}{\left (b x + d \right )}}{3 b} + \frac {2 g^{2} e^{a} e^{b x} \sinh {\left (b x + d \right )} \cosh {\left (b x + d \right )}}{3 b} + \frac {g^{2} e^{a} e^{b x} \cosh ^{2}{\left (b x + d \right )}}{3 b} & \text {for}\: b \neq 0 \\x \left (f \sinh {\left (d \right )} + g \cosh {\left (d \right )}\right )^{2} e^{a} & \text {otherwise} \end {cases} \] Input:
integrate(exp(b*x+a)*(g*cosh(b*x+d)+f*sinh(b*x+d))**2,x)
Output:
Piecewise((f**2*exp(a)*exp(b*x)*sinh(b*x + d)**2/(3*b) + 2*f**2*exp(a)*exp (b*x)*sinh(b*x + d)*cosh(b*x + d)/(3*b) - 2*f**2*exp(a)*exp(b*x)*cosh(b*x + d)**2/(3*b) + 2*f*g*exp(a)*exp(b*x)*sinh(b*x + d)**2/(3*b) - 2*f*g*exp(a )*exp(b*x)*sinh(b*x + d)*cosh(b*x + d)/(3*b) + 2*f*g*exp(a)*exp(b*x)*cosh( b*x + d)**2/(3*b) - 2*g**2*exp(a)*exp(b*x)*sinh(b*x + d)**2/(3*b) + 2*g**2 *exp(a)*exp(b*x)*sinh(b*x + d)*cosh(b*x + d)/(3*b) + g**2*exp(a)*exp(b*x)* cosh(b*x + d)**2/(3*b), Ne(b, 0)), (x*(f*sinh(d) + g*cosh(d))**2*exp(a), T rue))
Leaf count of result is larger than twice the leaf count of optimal. 127 vs. \(2 (63) = 126\).
Time = 0.04 (sec) , antiderivative size = 127, normalized size of antiderivative = 1.76 \[ \int e^{a+b x} (g \cosh (d+b x)+f \sinh (d+b x))^2 \, dx=\frac {1}{12} \, g^{2} {\left (\frac {e^{\left (3 \, b x + a + 2 \, d\right )}}{b} + \frac {6 \, e^{\left (b x + a\right )}}{b} - \frac {3 \, e^{\left (-b x + a - 2 \, d\right )}}{b}\right )} + \frac {1}{12} \, f^{2} {\left (\frac {e^{\left (3 \, b x + a + 2 \, d\right )}}{b} - \frac {6 \, e^{\left (b x + a\right )}}{b} - \frac {3 \, e^{\left (-b x + a - 2 \, d\right )}}{b}\right )} + \frac {1}{6} \, f g {\left (\frac {e^{\left (3 \, b x + a + 2 \, d\right )}}{b} + \frac {3 \, e^{\left (-b x + a - 2 \, d\right )}}{b}\right )} \] Input:
integrate(exp(b*x+a)*(g*cosh(b*x+d)+f*sinh(b*x+d))^2,x, algorithm="maxima" )
Output:
1/12*g^2*(e^(3*b*x + a + 2*d)/b + 6*e^(b*x + a)/b - 3*e^(-b*x + a - 2*d)/b ) + 1/12*f^2*(e^(3*b*x + a + 2*d)/b - 6*e^(b*x + a)/b - 3*e^(-b*x + a - 2* d)/b) + 1/6*f*g*(e^(3*b*x + a + 2*d)/b + 3*e^(-b*x + a - 2*d)/b)
Time = 0.12 (sec) , antiderivative size = 106, normalized size of antiderivative = 1.47 \[ \int e^{a+b x} (g \cosh (d+b x)+f \sinh (d+b x))^2 \, dx=\frac {{\left (f^{2} e^{\left (3 \, b x + a + 4 \, d\right )} + 2 \, f g e^{\left (3 \, b x + a + 4 \, d\right )} + g^{2} e^{\left (3 \, b x + a + 4 \, d\right )} - 6 \, f^{2} e^{\left (b x + a + 2 \, d\right )} + 6 \, g^{2} e^{\left (b x + a + 2 \, d\right )} - 3 \, {\left (f^{2} e^{a} - 2 \, f g e^{a} + g^{2} e^{a}\right )} e^{\left (-b x\right )}\right )} e^{\left (-2 \, d\right )}}{12 \, b} \] Input:
integrate(exp(b*x+a)*(g*cosh(b*x+d)+f*sinh(b*x+d))^2,x, algorithm="giac")
Output:
1/12*(f^2*e^(3*b*x + a + 4*d) + 2*f*g*e^(3*b*x + a + 4*d) + g^2*e^(3*b*x + a + 4*d) - 6*f^2*e^(b*x + a + 2*d) + 6*g^2*e^(b*x + a + 2*d) - 3*(f^2*e^a - 2*f*g*e^a + g^2*e^a)*e^(-b*x))*e^(-2*d)/b
Time = 2.77 (sec) , antiderivative size = 97, normalized size of antiderivative = 1.35 \[ \int e^{a+b x} (g \cosh (d+b x)+f \sinh (d+b x))^2 \, dx=\frac {{\mathrm {e}}^{a-2\,d-b\,x}\,\left (6\,f\,g-3\,f^2-3\,g^2-6\,f^2\,{\mathrm {e}}^{2\,d+2\,b\,x}+f^2\,{\mathrm {e}}^{4\,d+4\,b\,x}+6\,g^2\,{\mathrm {e}}^{2\,d+2\,b\,x}+g^2\,{\mathrm {e}}^{4\,d+4\,b\,x}+2\,f\,g\,{\mathrm {e}}^{4\,d+4\,b\,x}\right )}{12\,b} \] Input:
int(exp(a + b*x)*(g*cosh(d + b*x) + f*sinh(d + b*x))^2,x)
Output:
(exp(a - 2*d - b*x)*(6*f*g - 3*f^2 - 3*g^2 - 6*f^2*exp(2*d + 2*b*x) + f^2* exp(4*d + 4*b*x) + 6*g^2*exp(2*d + 2*b*x) + g^2*exp(4*d + 4*b*x) + 2*f*g*e xp(4*d + 4*b*x)))/(12*b)
Time = 0.24 (sec) , antiderivative size = 137, normalized size of antiderivative = 1.90 \[ \int e^{a+b x} (g \cosh (d+b x)+f \sinh (d+b x))^2 \, dx=\frac {e^{b x +a} \left (-2 \cosh \left (b x +d \right )^{2} f^{2}+2 \cosh \left (b x +d \right )^{2} f g +\cosh \left (b x +d \right )^{2} g^{2}+2 \cosh \left (b x +d \right ) \sinh \left (b x +d \right ) f^{2}-2 \cosh \left (b x +d \right ) \sinh \left (b x +d \right ) f g +2 \cosh \left (b x +d \right ) \sinh \left (b x +d \right ) g^{2}+\sinh \left (b x +d \right )^{2} f^{2}+2 \sinh \left (b x +d \right )^{2} f g -2 \sinh \left (b x +d \right )^{2} g^{2}\right )}{3 b} \] Input:
int(exp(b*x+a)*(g*cosh(b*x+d)+f*sinh(b*x+d))^2,x)
Output:
(e**(a + b*x)*( - 2*cosh(b*x + d)**2*f**2 + 2*cosh(b*x + d)**2*f*g + cosh( b*x + d)**2*g**2 + 2*cosh(b*x + d)*sinh(b*x + d)*f**2 - 2*cosh(b*x + d)*si nh(b*x + d)*f*g + 2*cosh(b*x + d)*sinh(b*x + d)*g**2 + sinh(b*x + d)**2*f* *2 + 2*sinh(b*x + d)**2*f*g - 2*sinh(b*x + d)**2*g**2))/(3*b)