Integrand size = 11, antiderivative size = 100 \[ \int (a \text {sech}(x)+b \tanh (x))^4 \, dx=b^4 x-\frac {4}{3} a b \left (a^2+2 b^2\right ) \cosh (x)-\frac {1}{3} b^2 \left (2 a^2+3 b^2\right ) \cosh (x) \sinh (x)-\frac {1}{3} \text {sech}^3(x) (b-a \sinh (x)) (a+b \sinh (x))^3+\frac {1}{3} \text {sech}(x) (a+b \sinh (x))^2 \left (a b+\left (2 a^2+3 b^2\right ) \sinh (x)\right ) \]
b^4*x-4/3*a*b*(a^2+2*b^2)*cosh(x)-1/3*b^2*(2*a^2+3*b^2)*cosh(x)*sinh(x)-1/ 3*sech(x)^3*(b-a*sinh(x))*(a+b*sinh(x))^3+1/3*sech(x)*(a+b*sinh(x))^2*(a*b +(2*a^2+3*b^2)*sinh(x))
Time = 0.24 (sec) , antiderivative size = 79, normalized size of antiderivative = 0.79 \[ \int (a \text {sech}(x)+b \tanh (x))^4 \, dx=\frac {1}{3} \left (3 b^4 x-12 a b^3 \text {sech}(x)-4 a b \left (a^2-b^2\right ) \text {sech}^3(x)+2 \left (a^4+3 a^2 b^2-2 b^4\right ) \tanh (x)+\left (a^4-6 a^2 b^2+b^4\right ) \text {sech}^2(x) \tanh (x)\right ) \]
(3*b^4*x - 12*a*b^3*Sech[x] - 4*a*b*(a^2 - b^2)*Sech[x]^3 + 2*(a^4 + 3*a^2 *b^2 - 2*b^4)*Tanh[x] + (a^4 - 6*a^2*b^2 + b^4)*Sech[x]^2*Tanh[x])/3
Time = 0.59 (sec) , antiderivative size = 106, normalized size of antiderivative = 1.06, number of steps used = 10, number of rules used = 10, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.909, Rules used = {3042, 4891, 3042, 3170, 25, 3042, 3340, 27, 3042, 3213}
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 (a \text {sech}(x)+b \tanh (x))^4 \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int (a \sec (i x)-i b \tan (i x))^4dx\) |
\(\Big \downarrow \) 4891 |
\(\displaystyle \int \text {sech}^4(x) (a+b \sinh (x))^4dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {(a-i b \sin (i x))^4}{\cos (i x)^4}dx\) |
\(\Big \downarrow \) 3170 |
\(\displaystyle -\frac {1}{3} \int -\text {sech}^2(x) (a+b \sinh (x))^2 \left (2 a^2-b \sinh (x) a+3 b^2\right )dx-\frac {1}{3} \text {sech}^3(x) (b-a \sinh (x)) (a+b \sinh (x))^3\) |
\(\Big \downarrow \) 25 |
\(\displaystyle \frac {1}{3} \int \text {sech}^2(x) (a+b \sinh (x))^2 \left (2 a^2-b \sinh (x) a+3 b^2\right )dx-\frac {1}{3} \text {sech}^3(x) (b-a \sinh (x)) (a+b \sinh (x))^3\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle -\frac {1}{3} \text {sech}^3(x) (b-a \sinh (x)) (a+b \sinh (x))^3+\frac {1}{3} \int \frac {(a-i b \sin (i x))^2 \left (2 a^2+i b \sin (i x) a+3 b^2\right )}{\cos (i x)^2}dx\) |
\(\Big \downarrow \) 3340 |
\(\displaystyle \frac {1}{3} \left (\text {sech}(x) (a+b \sinh (x))^2 \left (\left (2 a^2+3 b^2\right ) \sinh (x)+a b\right )-\int 2 (a+b \sinh (x)) \left (a b^2+\left (2 a^2+3 b^2\right ) \sinh (x) b\right )dx\right )-\frac {1}{3} \text {sech}^3(x) (b-a \sinh (x)) (a+b \sinh (x))^3\) |
\(\Big \downarrow \) 27 |
\(\displaystyle \frac {1}{3} \left (\text {sech}(x) (a+b \sinh (x))^2 \left (\left (2 a^2+3 b^2\right ) \sinh (x)+a b\right )-2 \int (a+b \sinh (x)) \left (a b^2+\left (2 a^2+3 b^2\right ) \sinh (x) b\right )dx\right )-\frac {1}{3} \text {sech}^3(x) (b-a \sinh (x)) (a+b \sinh (x))^3\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle -\frac {1}{3} \text {sech}^3(x) (b-a \sinh (x)) (a+b \sinh (x))^3+\frac {1}{3} \left (\text {sech}(x) (a+b \sinh (x))^2 \left (\left (2 a^2+3 b^2\right ) \sinh (x)+a b\right )-2 \int (a-i b \sin (i x)) \left (a b^2-i b \left (2 a^2+3 b^2\right ) \sin (i x)\right )dx\right )\) |
\(\Big \downarrow \) 3213 |
\(\displaystyle \frac {1}{3} \left (\text {sech}(x) (a+b \sinh (x))^2 \left (\left (2 a^2+3 b^2\right ) \sinh (x)+a b\right )-2 \left (2 a b \left (a^2+2 b^2\right ) \cosh (x)+\frac {1}{2} b^2 \left (2 a^2+3 b^2\right ) \sinh (x) \cosh (x)-\frac {3 b^4 x}{2}\right )\right )-\frac {1}{3} \text {sech}^3(x) (b-a \sinh (x)) (a+b \sinh (x))^3\) |
-1/3*(Sech[x]^3*(b - a*Sinh[x])*(a + b*Sinh[x])^3) + (Sech[x]*(a + b*Sinh[ x])^2*(a*b + (2*a^2 + 3*b^2)*Sinh[x]) - 2*((-3*b^4*x)/2 + 2*a*b*(a^2 + 2*b ^2)*Cosh[x] + (b^2*(2*a^2 + 3*b^2)*Cosh[x]*Sinh[x])/2))/3
3.7.15.3.1 Defintions of rubi rules used
Int[(a_)*(Fx_), x_Symbol] :> Simp[a Int[Fx, x], x] /; FreeQ[a, x] && !Ma tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x _)])^(m_), x_Symbol] :> Simp[(-(g*Cos[e + f*x])^(p + 1))*(a + b*Sin[e + f*x ])^(m - 1)*((b + a*Sin[e + f*x])/(f*g*(p + 1))), x] + Simp[1/(g^2*(p + 1)) Int[(g*Cos[e + f*x])^(p + 2)*(a + b*Sin[e + f*x])^(m - 2)*(b^2*(m - 1) + a^2*(p + 2) + a*b*(m + p + 1)*Sin[e + f*x]), x], x] /; FreeQ[{a, b, e, f, g }, x] && NeQ[a^2 - b^2, 0] && GtQ[m, 1] && LtQ[p, -1] && (IntegersQ[2*m, 2* p] || IntegerQ[m])
Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*sin[(e_.) + (f_.) *(x_)]), x_Symbol] :> Simp[(2*a*c + b*d)*(x/2), x] + (-Simp[(b*c + a*d)*(Co s[e + f*x]/f), x] - Simp[b*d*Cos[e + f*x]*(Sin[e + f*x]/(2*f)), x]) /; Free Q[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0]
Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x _)])^(m_.)*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(-(g* Cos[e + f*x])^(p + 1))*(a + b*Sin[e + f*x])^m*((d + c*Sin[e + f*x])/(f*g*(p + 1))), x] + Simp[1/(g^2*(p + 1)) Int[(g*Cos[e + f*x])^(p + 2)*(a + b*Si n[e + f*x])^(m - 1)*Simp[a*c*(p + 2) + b*d*m + b*c*(m + p + 2)*Sin[e + f*x] , x], x], x] /; FreeQ[{a, b, c, d, e, f, g}, x] && NeQ[a^2 - b^2, 0] && GtQ [m, 0] && LtQ[p, -1] && IntegerQ[2*m] && !(EqQ[m, 1] && NeQ[c^2 - d^2, 0] && SimplerQ[c + d*x, a + b*x])
Int[(u_.)*((b_.)*sec[(c_.) + (d_.)*(x_)]^(n_.) + (a_.)*tan[(c_.) + (d_.)*(x _)]^(n_.))^(p_), x_Symbol] :> Int[ActivateTrig[u]*Sec[c + d*x]^(n*p)*(b + a *Sin[c + d*x]^n)^p, x] /; FreeQ[{a, b, c, d}, x] && IntegersQ[n, p]
Time = 52.87 (sec) , antiderivative size = 84, normalized size of antiderivative = 0.84
method | result | size |
parts | \(a^{4} \left (\frac {2}{3}+\frac {\operatorname {sech}\left (x \right )^{2}}{3}\right ) \tanh \left (x \right )+b^{4} \left (-\frac {\tanh \left (x \right )^{3}}{3}-\tanh \left (x \right )-\frac {\ln \left (\tanh \left (x \right )-1\right )}{2}+\frac {\ln \left (1+\tanh \left (x \right )\right )}{2}\right )-\frac {4 a^{3} b \operatorname {sech}\left (x \right )^{3}}{3}+2 a^{2} b^{2} \tanh \left (x \right )^{3}+4 a \,b^{3} \left (\frac {\operatorname {sech}\left (x \right )^{3}}{3}-\operatorname {sech}\left (x \right )\right )\) | \(84\) |
default | \(a^{4} \left (\frac {2}{3}+\frac {\operatorname {sech}\left (x \right )^{2}}{3}\right ) \tanh \left (x \right )-\frac {4 a^{3} b}{3 \cosh \left (x \right )^{3}}+6 a^{2} b^{2} \left (-\frac {\sinh \left (x \right )}{2 \cosh \left (x \right )^{3}}+\frac {\left (\frac {2}{3}+\frac {\operatorname {sech}\left (x \right )^{2}}{3}\right ) \tanh \left (x \right )}{2}\right )+4 a \,b^{3} \left (-\frac {\sinh \left (x \right )^{2}}{\cosh \left (x \right )^{3}}-\frac {2}{3 \cosh \left (x \right )^{3}}\right )+b^{4} \left (x -\tanh \left (x \right )-\frac {\tanh \left (x \right )^{3}}{3}\right )\) | \(94\) |
risch | \(b^{4} x -\frac {4 \left (6 a \,b^{3} {\mathrm e}^{5 x}+9 \,{\mathrm e}^{4 x} a^{2} b^{2}-3 \,{\mathrm e}^{4 x} b^{4}+8 a^{3} b \,{\mathrm e}^{3 x}+4 a \,b^{3} {\mathrm e}^{3 x}+3 \,{\mathrm e}^{2 x} a^{4}-3 \,{\mathrm e}^{2 x} b^{4}+6 a \,b^{3} {\mathrm e}^{x}+a^{4}+3 a^{2} b^{2}-2 b^{4}\right )}{3 \left (1+{\mathrm e}^{2 x}\right )^{3}}\) | \(111\) |
a^4*(2/3+1/3*sech(x)^2)*tanh(x)+b^4*(-1/3*tanh(x)^3-tanh(x)-1/2*ln(tanh(x) -1)+1/2*ln(1+tanh(x)))-4/3*a^3*b*sech(x)^3+2*a^2*b^2*tanh(x)^3+4*a*b^3*(1/ 3*sech(x)^3-sech(x))
Leaf count of result is larger than twice the leaf count of optimal. 207 vs. \(2 (93) = 186\).
Time = 0.25 (sec) , antiderivative size = 207, normalized size of antiderivative = 2.07 \[ \int (a \text {sech}(x)+b \tanh (x))^4 \, dx=-\frac {24 \, a b^{3} \cosh \left (x\right )^{2} + 16 \, a^{3} b + 8 \, a b^{3} - {\left (3 \, b^{4} x - 2 \, a^{4} - 6 \, a^{2} b^{2} + 4 \, b^{4}\right )} \cosh \left (x\right )^{3} - 2 \, {\left (a^{4} + 3 \, a^{2} b^{2} - 2 \, b^{4}\right )} \sinh \left (x\right )^{3} + 3 \, {\left (8 \, a b^{3} - {\left (3 \, b^{4} x - 2 \, a^{4} - 6 \, a^{2} b^{2} + 4 \, b^{4}\right )} \cosh \left (x\right )\right )} \sinh \left (x\right )^{2} - 3 \, {\left (3 \, b^{4} x - 2 \, a^{4} - 6 \, a^{2} b^{2} + 4 \, b^{4}\right )} \cosh \left (x\right ) - 6 \, {\left (a^{4} - 3 \, a^{2} b^{2} + {\left (a^{4} + 3 \, a^{2} b^{2} - 2 \, b^{4}\right )} \cosh \left (x\right )^{2}\right )} \sinh \left (x\right )}{3 \, {\left (\cosh \left (x\right )^{3} + 3 \, \cosh \left (x\right ) \sinh \left (x\right )^{2} + 3 \, \cosh \left (x\right )\right )}} \]
-1/3*(24*a*b^3*cosh(x)^2 + 16*a^3*b + 8*a*b^3 - (3*b^4*x - 2*a^4 - 6*a^2*b ^2 + 4*b^4)*cosh(x)^3 - 2*(a^4 + 3*a^2*b^2 - 2*b^4)*sinh(x)^3 + 3*(8*a*b^3 - (3*b^4*x - 2*a^4 - 6*a^2*b^2 + 4*b^4)*cosh(x))*sinh(x)^2 - 3*(3*b^4*x - 2*a^4 - 6*a^2*b^2 + 4*b^4)*cosh(x) - 6*(a^4 - 3*a^2*b^2 + (a^4 + 3*a^2*b^ 2 - 2*b^4)*cosh(x)^2)*sinh(x))/(cosh(x)^3 + 3*cosh(x)*sinh(x)^2 + 3*cosh(x ))
\[ \int (a \text {sech}(x)+b \tanh (x))^4 \, dx=\int \left (a \operatorname {sech}{\left (x \right )} + b \tanh {\left (x \right )}\right )^{4}\, dx \]
Leaf count of result is larger than twice the leaf count of optimal. 210 vs. \(2 (93) = 186\).
Time = 0.22 (sec) , antiderivative size = 210, normalized size of antiderivative = 2.10 \[ \int (a \text {sech}(x)+b \tanh (x))^4 \, dx=2 \, a^{2} b^{2} \tanh \left (x\right )^{3} + \frac {1}{3} \, b^{4} {\left (3 \, x - \frac {4 \, {\left (3 \, e^{\left (-2 \, x\right )} + 3 \, e^{\left (-4 \, x\right )} + 2\right )}}{3 \, e^{\left (-2 \, x\right )} + 3 \, e^{\left (-4 \, x\right )} + e^{\left (-6 \, x\right )} + 1}\right )} - \frac {8}{3} \, a b^{3} {\left (\frac {3 \, e^{\left (-x\right )}}{3 \, e^{\left (-2 \, x\right )} + 3 \, e^{\left (-4 \, x\right )} + e^{\left (-6 \, x\right )} + 1} + \frac {2 \, e^{\left (-3 \, x\right )}}{3 \, e^{\left (-2 \, x\right )} + 3 \, e^{\left (-4 \, x\right )} + e^{\left (-6 \, x\right )} + 1} + \frac {3 \, e^{\left (-5 \, x\right )}}{3 \, e^{\left (-2 \, x\right )} + 3 \, e^{\left (-4 \, x\right )} + e^{\left (-6 \, x\right )} + 1}\right )} + \frac {4}{3} \, a^{4} {\left (\frac {3 \, e^{\left (-2 \, x\right )}}{3 \, e^{\left (-2 \, x\right )} + 3 \, e^{\left (-4 \, x\right )} + e^{\left (-6 \, x\right )} + 1} + \frac {1}{3 \, e^{\left (-2 \, x\right )} + 3 \, e^{\left (-4 \, x\right )} + e^{\left (-6 \, x\right )} + 1}\right )} - \frac {32 \, a^{3} b}{3 \, {\left (e^{\left (-x\right )} + e^{x}\right )}^{3}} \]
2*a^2*b^2*tanh(x)^3 + 1/3*b^4*(3*x - 4*(3*e^(-2*x) + 3*e^(-4*x) + 2)/(3*e^ (-2*x) + 3*e^(-4*x) + e^(-6*x) + 1)) - 8/3*a*b^3*(3*e^(-x)/(3*e^(-2*x) + 3 *e^(-4*x) + e^(-6*x) + 1) + 2*e^(-3*x)/(3*e^(-2*x) + 3*e^(-4*x) + e^(-6*x) + 1) + 3*e^(-5*x)/(3*e^(-2*x) + 3*e^(-4*x) + e^(-6*x) + 1)) + 4/3*a^4*(3* e^(-2*x)/(3*e^(-2*x) + 3*e^(-4*x) + e^(-6*x) + 1) + 1/(3*e^(-2*x) + 3*e^(- 4*x) + e^(-6*x) + 1)) - 32/3*a^3*b/(e^(-x) + e^x)^3
Time = 0.27 (sec) , antiderivative size = 110, normalized size of antiderivative = 1.10 \[ \int (a \text {sech}(x)+b \tanh (x))^4 \, dx=b^{4} x - \frac {4 \, {\left (6 \, a b^{3} e^{\left (5 \, x\right )} + 9 \, a^{2} b^{2} e^{\left (4 \, x\right )} - 3 \, b^{4} e^{\left (4 \, x\right )} + 8 \, a^{3} b e^{\left (3 \, x\right )} + 4 \, a b^{3} e^{\left (3 \, x\right )} + 3 \, a^{4} e^{\left (2 \, x\right )} - 3 \, b^{4} e^{\left (2 \, x\right )} + 6 \, a b^{3} e^{x} + a^{4} + 3 \, a^{2} b^{2} - 2 \, b^{4}\right )}}{3 \, {\left (e^{\left (2 \, x\right )} + 1\right )}^{3}} \]
b^4*x - 4/3*(6*a*b^3*e^(5*x) + 9*a^2*b^2*e^(4*x) - 3*b^4*e^(4*x) + 8*a^3*b *e^(3*x) + 4*a*b^3*e^(3*x) + 3*a^4*e^(2*x) - 3*b^4*e^(2*x) + 6*a*b^3*e^x + a^4 + 3*a^2*b^2 - 2*b^4)/(e^(2*x) + 1)^3
Time = 2.36 (sec) , antiderivative size = 145, normalized size of antiderivative = 1.45 \[ \int (a \text {sech}(x)+b \tanh (x))^4 \, dx=\frac {{\mathrm {e}}^x\,\left (\frac {32\,a\,b^3}{3}-\frac {32\,a^3\,b}{3}\right )-4\,a^4-4\,b^4+24\,a^2\,b^2}{2\,{\mathrm {e}}^{2\,x}+{\mathrm {e}}^{4\,x}+1}-\frac {12\,a^2\,b^2+8\,{\mathrm {e}}^x\,a\,b^3-4\,b^4}{{\mathrm {e}}^{2\,x}+1}+b^4\,x-\frac {{\mathrm {e}}^x\,\left (\frac {32\,a\,b^3}{3}-\frac {32\,a^3\,b}{3}\right )-\frac {8\,a^4}{3}-\frac {8\,b^4}{3}+16\,a^2\,b^2}{3\,{\mathrm {e}}^{2\,x}+3\,{\mathrm {e}}^{4\,x}+{\mathrm {e}}^{6\,x}+1} \]