\(\int (a+b \text {sech}^2(x))^{3/2} \tanh ^2(x) \, dx\) [188]

Optimal result
Mathematica [A] (verified)
Rubi [A] (verified)
Maple [F]
Fricas [B] (verification not implemented)
Sympy [F]
Maxima [F]
Giac [F(-2)]
Mupad [F(-1)]
Reduce [F]

Optimal result

Integrand size = 17, antiderivative size = 125 \[ \int \left (a+b \text {sech}^2(x)\right )^{3/2} \tanh ^2(x) \, dx=-\frac {\left (3 a^2-6 a b-b^2\right ) \arctan \left (\frac {\sqrt {b} \tanh (x)}{\sqrt {a+b-b \tanh ^2(x)}}\right )}{8 \sqrt {b}}+a^{3/2} \text {arctanh}\left (\frac {\sqrt {a} \tanh (x)}{\sqrt {a+b-b \tanh ^2(x)}}\right )-\frac {1}{8} (5 a+b) \tanh (x) \sqrt {a+b-b \tanh ^2(x)}+\frac {1}{4} b \tanh ^3(x) \sqrt {a+b-b \tanh ^2(x)} \] Output:

-1/8*(3*a^2-6*a*b-b^2)*arctan(b^(1/2)*tanh(x)/(a+b-b*tanh(x)^2)^(1/2))/b^( 
1/2)+a^(3/2)*arctanh(a^(1/2)*tanh(x)/(a+b-b*tanh(x)^2)^(1/2))-1/8*(5*a+b)* 
tanh(x)*(a+b-b*tanh(x)^2)^(1/2)+1/4*b*tanh(x)^3*(a+b-b*tanh(x)^2)^(1/2)
 

Mathematica [A] (verified)

Time = 0.53 (sec) , antiderivative size = 197, normalized size of antiderivative = 1.58 \[ \int \left (a+b \text {sech}^2(x)\right )^{3/2} \tanh ^2(x) \, dx=-\frac {\cosh ^3(x) \left (a+b \text {sech}^2(x)\right )^{3/2} \left (\sqrt {2} \left (3 a^2-6 a b-b^2\right ) \arctan \left (\frac {\sqrt {2} \sqrt {b} \sinh (x)}{\sqrt {a+2 b+a \cosh (2 x)}}\right )-8 \sqrt {2} a^{3/2} \sqrt {b} \text {arctanh}\left (\frac {\sqrt {2} \sqrt {a} \sinh (x)}{\sqrt {a+2 b+a \cosh (2 x)}}\right )+(5 a-b) \sqrt {b} \sqrt {a+2 b+a \cosh (2 x)} \text {sech}(x) \tanh (x)+2 b^{3/2} \sqrt {a+2 b+a \cosh (2 x)} \text {sech}^3(x) \tanh (x)\right )}{4 \sqrt {b} (a+2 b+a \cosh (2 x))^{3/2}} \] Input:

Integrate[(a + b*Sech[x]^2)^(3/2)*Tanh[x]^2,x]
 

Output:

-1/4*(Cosh[x]^3*(a + b*Sech[x]^2)^(3/2)*(Sqrt[2]*(3*a^2 - 6*a*b - b^2)*Arc 
Tan[(Sqrt[2]*Sqrt[b]*Sinh[x])/Sqrt[a + 2*b + a*Cosh[2*x]]] - 8*Sqrt[2]*a^( 
3/2)*Sqrt[b]*ArcTanh[(Sqrt[2]*Sqrt[a]*Sinh[x])/Sqrt[a + 2*b + a*Cosh[2*x]] 
] + (5*a - b)*Sqrt[b]*Sqrt[a + 2*b + a*Cosh[2*x]]*Sech[x]*Tanh[x] + 2*b^(3 
/2)*Sqrt[a + 2*b + a*Cosh[2*x]]*Sech[x]^3*Tanh[x]))/(Sqrt[b]*(a + 2*b + a* 
Cosh[2*x])^(3/2))
 

Rubi [A] (verified)

Time = 0.55 (sec) , antiderivative size = 134, normalized size of antiderivative = 1.07, number of steps used = 16, number of rules used = 15, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.882, Rules used = {3042, 25, 4629, 25, 2075, 379, 25, 444, 25, 27, 398, 224, 216, 291, 219}

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 \tanh ^2(x) \left (a+b \text {sech}^2(x)\right )^{3/2} \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \tan (i x)^2 \left (-\left (a+b \sec (i x)^2\right )^{3/2}\right )dx\)

\(\Big \downarrow \) 25

\(\displaystyle -\int \left (b \sec (i x)^2+a\right )^{3/2} \tan (i x)^2dx\)

\(\Big \downarrow \) 4629

\(\displaystyle -\int -\frac {\tanh ^2(x) \left (a+b \left (1-\tanh ^2(x)\right )\right )^{3/2}}{1-\tanh ^2(x)}d\tanh (x)\)

\(\Big \downarrow \) 25

\(\displaystyle \int \frac {\tanh ^2(x) \left (a+b \left (1-\tanh ^2(x)\right )\right )^{3/2}}{1-\tanh ^2(x)}d\tanh (x)\)

\(\Big \downarrow \) 2075

\(\displaystyle \int \frac {\tanh ^2(x) \left (a-b \tanh ^2(x)+b\right )^{3/2}}{1-\tanh ^2(x)}d\tanh (x)\)

\(\Big \downarrow \) 379

\(\displaystyle \frac {1}{4} b \tanh ^3(x) \sqrt {a-b \tanh ^2(x)+b}-\frac {1}{4} \int -\frac {\tanh ^2(x) \left ((a+b) (4 a+b)-b (5 a+b) \tanh ^2(x)\right )}{\left (1-\tanh ^2(x)\right ) \sqrt {-b \tanh ^2(x)+a+b}}d\tanh (x)\)

\(\Big \downarrow \) 25

\(\displaystyle \frac {1}{4} \int \frac {\tanh ^2(x) \left ((a+b) (4 a+b)-b (5 a+b) \tanh ^2(x)\right )}{\left (1-\tanh ^2(x)\right ) \sqrt {-b \tanh ^2(x)+a+b}}d\tanh (x)+\frac {1}{4} b \tanh ^3(x) \sqrt {a-b \tanh ^2(x)+b}\)

\(\Big \downarrow \) 444

\(\displaystyle \frac {1}{4} \left (-\frac {\int -\frac {b \left (\left (3 a^2-6 b a-b^2\right ) \tanh ^2(x)+(a+b) (5 a+b)\right )}{\left (1-\tanh ^2(x)\right ) \sqrt {-b \tanh ^2(x)+a+b}}d\tanh (x)}{2 b}-\frac {1}{2} (5 a+b) \tanh (x) \sqrt {a-b \tanh ^2(x)+b}\right )+\frac {1}{4} b \tanh ^3(x) \sqrt {a-b \tanh ^2(x)+b}\)

\(\Big \downarrow \) 25

\(\displaystyle \frac {1}{4} \left (\frac {\int \frac {b \left (\left (3 a^2-6 b a-b^2\right ) \tanh ^2(x)+(a+b) (5 a+b)\right )}{\left (1-\tanh ^2(x)\right ) \sqrt {-b \tanh ^2(x)+a+b}}d\tanh (x)}{2 b}-\frac {1}{2} (5 a+b) \tanh (x) \sqrt {a-b \tanh ^2(x)+b}\right )+\frac {1}{4} b \tanh ^3(x) \sqrt {a-b \tanh ^2(x)+b}\)

\(\Big \downarrow \) 27

\(\displaystyle \frac {1}{4} \left (\frac {1}{2} \int \frac {\left (3 a^2-6 b a-b^2\right ) \tanh ^2(x)+(a+b) (5 a+b)}{\left (1-\tanh ^2(x)\right ) \sqrt {-b \tanh ^2(x)+a+b}}d\tanh (x)-\frac {1}{2} (5 a+b) \tanh (x) \sqrt {a-b \tanh ^2(x)+b}\right )+\frac {1}{4} b \tanh ^3(x) \sqrt {a-b \tanh ^2(x)+b}\)

\(\Big \downarrow \) 398

\(\displaystyle \frac {1}{4} \left (\frac {1}{2} \left (8 a^2 \int \frac {1}{\left (1-\tanh ^2(x)\right ) \sqrt {-b \tanh ^2(x)+a+b}}d\tanh (x)-\left (3 a^2-6 a b-b^2\right ) \int \frac {1}{\sqrt {-b \tanh ^2(x)+a+b}}d\tanh (x)\right )-\frac {1}{2} (5 a+b) \tanh (x) \sqrt {a-b \tanh ^2(x)+b}\right )+\frac {1}{4} b \tanh ^3(x) \sqrt {a-b \tanh ^2(x)+b}\)

\(\Big \downarrow \) 224

\(\displaystyle \frac {1}{4} \left (\frac {1}{2} \left (8 a^2 \int \frac {1}{\left (1-\tanh ^2(x)\right ) \sqrt {-b \tanh ^2(x)+a+b}}d\tanh (x)-\left (3 a^2-6 a b-b^2\right ) \int \frac {1}{\frac {b \tanh ^2(x)}{-b \tanh ^2(x)+a+b}+1}d\frac {\tanh (x)}{\sqrt {-b \tanh ^2(x)+a+b}}\right )-\frac {1}{2} (5 a+b) \tanh (x) \sqrt {a-b \tanh ^2(x)+b}\right )+\frac {1}{4} b \tanh ^3(x) \sqrt {a-b \tanh ^2(x)+b}\)

\(\Big \downarrow \) 216

\(\displaystyle \frac {1}{4} \left (\frac {1}{2} \left (8 a^2 \int \frac {1}{\left (1-\tanh ^2(x)\right ) \sqrt {-b \tanh ^2(x)+a+b}}d\tanh (x)-\frac {\left (3 a^2-6 a b-b^2\right ) \arctan \left (\frac {\sqrt {b} \tanh (x)}{\sqrt {a-b \tanh ^2(x)+b}}\right )}{\sqrt {b}}\right )-\frac {1}{2} (5 a+b) \tanh (x) \sqrt {a-b \tanh ^2(x)+b}\right )+\frac {1}{4} b \tanh ^3(x) \sqrt {a-b \tanh ^2(x)+b}\)

\(\Big \downarrow \) 291

\(\displaystyle \frac {1}{4} \left (\frac {1}{2} \left (8 a^2 \int \frac {1}{1-\frac {a \tanh ^2(x)}{-b \tanh ^2(x)+a+b}}d\frac {\tanh (x)}{\sqrt {-b \tanh ^2(x)+a+b}}-\frac {\left (3 a^2-6 a b-b^2\right ) \arctan \left (\frac {\sqrt {b} \tanh (x)}{\sqrt {a-b \tanh ^2(x)+b}}\right )}{\sqrt {b}}\right )-\frac {1}{2} (5 a+b) \tanh (x) \sqrt {a-b \tanh ^2(x)+b}\right )+\frac {1}{4} b \tanh ^3(x) \sqrt {a-b \tanh ^2(x)+b}\)

\(\Big \downarrow \) 219

\(\displaystyle \frac {1}{4} \left (\frac {1}{2} \left (8 a^{3/2} \text {arctanh}\left (\frac {\sqrt {a} \tanh (x)}{\sqrt {a-b \tanh ^2(x)+b}}\right )-\frac {\left (3 a^2-6 a b-b^2\right ) \arctan \left (\frac {\sqrt {b} \tanh (x)}{\sqrt {a-b \tanh ^2(x)+b}}\right )}{\sqrt {b}}\right )-\frac {1}{2} (5 a+b) \tanh (x) \sqrt {a-b \tanh ^2(x)+b}\right )+\frac {1}{4} b \tanh ^3(x) \sqrt {a-b \tanh ^2(x)+b}\)

Input:

Int[(a + b*Sech[x]^2)^(3/2)*Tanh[x]^2,x]
 

Output:

(b*Tanh[x]^3*Sqrt[a + b - b*Tanh[x]^2])/4 + ((-(((3*a^2 - 6*a*b - b^2)*Arc 
Tan[(Sqrt[b]*Tanh[x])/Sqrt[a + b - b*Tanh[x]^2]])/Sqrt[b]) + 8*a^(3/2)*Arc 
Tanh[(Sqrt[a]*Tanh[x])/Sqrt[a + b - b*Tanh[x]^2]])/2 - ((5*a + b)*Tanh[x]* 
Sqrt[a + b - b*Tanh[x]^2])/2)/4
 

Defintions of rubi rules used

rule 25
Int[-(Fx_), x_Symbol] :> Simp[Identity[-1]   Int[Fx, x], x]
 

rule 27
Int[(a_)*(Fx_), x_Symbol] :> Simp[a   Int[Fx, x], x] /; FreeQ[a, x] &&  !Ma 
tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
 

rule 216
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*A 
rcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /; FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a 
, 0] || GtQ[b, 0])
 

rule 219
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))* 
ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x] /; FreeQ[{a, b}, x] && NegQ[a/b] && (Gt 
Q[a, 0] || LtQ[b, 0])
 

rule 224
Int[1/Sqrt[(a_) + (b_.)*(x_)^2], x_Symbol] :> Subst[Int[1/(1 - b*x^2), x], 
x, x/Sqrt[a + b*x^2]] /; FreeQ[{a, b}, x] &&  !GtQ[a, 0]
 

rule 291
Int[1/(Sqrt[(a_) + (b_.)*(x_)^2]*((c_) + (d_.)*(x_)^2)), x_Symbol] :> Subst 
[Int[1/(c - (b*c - a*d)*x^2), x], x, x/Sqrt[a + b*x^2]] /; FreeQ[{a, b, c, 
d}, x] && NeQ[b*c - a*d, 0]
 

rule 379
Int[((e_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^2)^(p_)*((c_) + (d_.)*(x_)^2)^(q_ 
), x_Symbol] :> Simp[d*(e*x)^(m + 1)*(a + b*x^2)^(p + 1)*((c + d*x^2)^(q - 
1)/(b*e*(m + 2*(p + q) + 1))), x] + Simp[1/(b*(m + 2*(p + q) + 1))   Int[(e 
*x)^m*(a + b*x^2)^p*(c + d*x^2)^(q - 2)*Simp[c*((b*c - a*d)*(m + 1) + b*c*2 
*(p + q)) + (d*(b*c - a*d)*(m + 1) + d*2*(q - 1)*(b*c - a*d) + b*c*d*2*(p + 
 q))*x^2, x], x], x] /; FreeQ[{a, b, c, d, e, m, p}, x] && NeQ[b*c - a*d, 0 
] && GtQ[q, 1] && IntBinomialQ[a, b, c, d, e, m, 2, p, q, x]
 

rule 398
Int[((e_) + (f_.)*(x_)^2)/(((a_) + (b_.)*(x_)^2)*Sqrt[(c_) + (d_.)*(x_)^2]) 
, x_Symbol] :> Simp[f/b   Int[1/Sqrt[c + d*x^2], x], x] + Simp[(b*e - a*f)/ 
b   Int[1/((a + b*x^2)*Sqrt[c + d*x^2]), x], x] /; FreeQ[{a, b, c, d, e, f} 
, x]
 

rule 444
Int[((g_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^2)^(p_.)*((c_) + (d_.)*(x_)^2)^(q 
_.)*((e_) + (f_.)*(x_)^2), x_Symbol] :> Simp[f*g*(g*x)^(m - 1)*(a + b*x^2)^ 
(p + 1)*((c + d*x^2)^(q + 1)/(b*d*(m + 2*(p + q + 1) + 1))), x] - Simp[g^2/ 
(b*d*(m + 2*(p + q + 1) + 1))   Int[(g*x)^(m - 2)*(a + b*x^2)^p*(c + d*x^2) 
^q*Simp[a*f*c*(m - 1) + (a*f*d*(m + 2*q + 1) + b*(f*c*(m + 2*p + 1) - e*d*( 
m + 2*(p + q + 1) + 1)))*x^2, x], x], x] /; FreeQ[{a, b, c, d, e, f, g, p, 
q}, x] && GtQ[m, 1]
 

rule 2075
Int[(u_)^(p_.)*(v_)^(q_.)*((e_.)*(x_))^(m_.), x_Symbol] :> Int[(e*x)^m*Expa 
ndToSum[u, x]^p*ExpandToSum[v, x]^q, x] /; FreeQ[{e, m, p, q}, x] && Binomi 
alQ[{u, v}, x] && EqQ[BinomialDegree[u, x] - BinomialDegree[v, x], 0] &&  ! 
BinomialMatchQ[{u, v}, x]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 4629
Int[((a_) + (b_.)*sec[(e_.) + (f_.)*(x_)]^(n_))^(p_.)*((d_.)*tan[(e_.) + (f 
_.)*(x_)])^(m_), x_Symbol] :> With[{ff = FreeFactors[Tan[e + f*x], x]}, Sim 
p[ff/f   Subst[Int[(d*ff*x)^m*((a + b*(1 + ff^2*x^2)^(n/2))^p/(1 + ff^2*x^2 
)), x], x, Tan[e + f*x]/ff], x]] /; FreeQ[{a, b, d, e, f, m, p}, x] && Inte 
gerQ[n/2] && (IntegerQ[m/2] || EqQ[n, 2])
 
Maple [F]

\[\int \left (a +\operatorname {sech}\left (x \right )^{2} b \right )^{\frac {3}{2}} \tanh \left (x \right )^{2}d x\]

Input:

int((a+sech(x)^2*b)^(3/2)*tanh(x)^2,x)
 

Output:

int((a+sech(x)^2*b)^(3/2)*tanh(x)^2,x)
 

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 1826 vs. \(2 (103) = 206\).

Time = 0.36 (sec) , antiderivative size = 8582, normalized size of antiderivative = 68.66 \[ \int \left (a+b \text {sech}^2(x)\right )^{3/2} \tanh ^2(x) \, dx=\text {Too large to display} \] Input:

integrate((a+b*sech(x)^2)^(3/2)*tanh(x)^2,x, algorithm="fricas")
 

Output:

Too large to include
 

Sympy [F]

\[ \int \left (a+b \text {sech}^2(x)\right )^{3/2} \tanh ^2(x) \, dx=\int \left (a + b \operatorname {sech}^{2}{\left (x \right )}\right )^{\frac {3}{2}} \tanh ^{2}{\left (x \right )}\, dx \] Input:

integrate((a+b*sech(x)**2)**(3/2)*tanh(x)**2,x)
 

Output:

Integral((a + b*sech(x)**2)**(3/2)*tanh(x)**2, x)
 

Maxima [F]

\[ \int \left (a+b \text {sech}^2(x)\right )^{3/2} \tanh ^2(x) \, dx=\int { {\left (b \operatorname {sech}\left (x\right )^{2} + a\right )}^{\frac {3}{2}} \tanh \left (x\right )^{2} \,d x } \] Input:

integrate((a+b*sech(x)^2)^(3/2)*tanh(x)^2,x, algorithm="maxima")
 

Output:

integrate((b*sech(x)^2 + a)^(3/2)*tanh(x)^2, x)
 

Giac [F(-2)]

Exception generated. \[ \int \left (a+b \text {sech}^2(x)\right )^{3/2} \tanh ^2(x) \, dx=\text {Exception raised: TypeError} \] Input:

integrate((a+b*sech(x)^2)^(3/2)*tanh(x)^2,x, algorithm="giac")
 

Output:

Exception raised: TypeError >> an error occurred running a Giac command:IN 
PUT:sage2:=int(sage0,sageVARx):;OUTPUT:Error: Bad Argument Type
 

Mupad [F(-1)]

Timed out. \[ \int \left (a+b \text {sech}^2(x)\right )^{3/2} \tanh ^2(x) \, dx=\int {\mathrm {tanh}\left (x\right )}^2\,{\left (a+\frac {b}{{\mathrm {cosh}\left (x\right )}^2}\right )}^{3/2} \,d x \] Input:

int(tanh(x)^2*(a + b/cosh(x)^2)^(3/2),x)
 

Output:

int(tanh(x)^2*(a + b/cosh(x)^2)^(3/2), x)
 

Reduce [F]

\[ \int \left (a+b \text {sech}^2(x)\right )^{3/2} \tanh ^2(x) \, dx=\left (\int \sqrt {\mathrm {sech}\left (x \right )^{2} b +a}\, \mathrm {sech}\left (x \right )^{2} \tanh \left (x \right )^{2}d x \right ) b +\left (\int \sqrt {\mathrm {sech}\left (x \right )^{2} b +a}\, \tanh \left (x \right )^{2}d x \right ) a \] Input:

int((a+b*sech(x)^2)^(3/2)*tanh(x)^2,x)
 

Output:

int(sqrt(sech(x)**2*b + a)*sech(x)**2*tanh(x)**2,x)*b + int(sqrt(sech(x)** 
2*b + a)*tanh(x)**2,x)*a