\(\int \tanh ^5(x) \sqrt {a+b \tanh ^2(x)} \, dx\) [208]

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

Optimal result

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

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

Mathematica [A] (verified)

Time = 0.35 (sec) , antiderivative size = 85, normalized size of antiderivative = 0.98 \[ \int \tanh ^5(x) \sqrt {a+b \tanh ^2(x)} \, dx=\sqrt {a+b} \text {arctanh}\left (\frac {\sqrt {a+b \tanh ^2(x)}}{\sqrt {a+b}}\right )+\frac {\sqrt {a+b \tanh ^2(x)} \left (2 a^2-5 a b-15 b^2-b (a+5 b) \tanh ^2(x)-3 b^2 \tanh ^4(x)\right )}{15 b^2} \] Input:

Integrate[Tanh[x]^5*Sqrt[a + b*Tanh[x]^2],x]
 

Output:

Sqrt[a + b]*ArcTanh[Sqrt[a + b*Tanh[x]^2]/Sqrt[a + b]] + (Sqrt[a + b*Tanh[ 
x]^2]*(2*a^2 - 5*a*b - 15*b^2 - b*(a + 5*b)*Tanh[x]^2 - 3*b^2*Tanh[x]^4))/ 
(15*b^2)
 

Rubi [A] (verified)

Time = 0.35 (sec) , antiderivative size = 92, normalized size of antiderivative = 1.06, number of steps used = 8, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.412, Rules used = {3042, 26, 4153, 26, 354, 99, 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 \tanh ^5(x) \sqrt {a+b \tanh ^2(x)} \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int -i \tan (i x)^5 \sqrt {a-b \tan (i x)^2}dx\)

\(\Big \downarrow \) 26

\(\displaystyle -i \int \tan (i x)^5 \sqrt {a-b \tan (i x)^2}dx\)

\(\Big \downarrow \) 4153

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

\(\Big \downarrow \) 26

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

\(\Big \downarrow \) 354

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

\(\Big \downarrow \) 99

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

\(\Big \downarrow \) 2009

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

Input:

Int[Tanh[x]^5*Sqrt[a + b*Tanh[x]^2],x]
 

Output:

(2*Sqrt[a + b]*ArcTanh[Sqrt[a + b*Tanh[x]^2]/Sqrt[a + b]] - 2*Sqrt[a + b*T 
anh[x]^2] + (2*(a - b)*(a + b*Tanh[x]^2)^(3/2))/(3*b^2) - (2*(a + b*Tanh[x 
]^2)^(5/2))/(5*b^2))/2
 

Defintions of rubi rules used

rule 26
Int[(Complex[0, a_])*(Fx_), x_Symbol] :> Simp[(Complex[Identity[0], a])   I 
nt[Fx, x], x] /; FreeQ[a, x] && EqQ[a^2, 1]
 

rule 99
Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_)*((e_.) + (f_.)*(x_) 
)^(p_), x_] :> Int[ExpandIntegrand[(a + b*x)^m*(c + d*x)^n*(e + f*x)^p, x], 
 x] /; FreeQ[{a, b, c, d, e, f, p}, x] && IntegersQ[m, n] && (IntegerQ[p] | 
| (GtQ[m, 0] && GeQ[n, -1]))
 

rule 354
Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^2)^(p_.)*((c_) + (d_.)*(x_)^2)^(q_.), x_S 
ymbol] :> Simp[1/2   Subst[Int[x^((m - 1)/2)*(a + b*x)^p*(c + d*x)^q, x], x 
, x^2], x] /; FreeQ[{a, b, c, d, p, q}, x] && NeQ[b*c - a*d, 0] && IntegerQ 
[(m - 1)/2]
 

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

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

rule 4153
Int[((d_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*((c_.)*tan[(e_.) + 
(f_.)*(x_)])^(n_))^(p_.), x_Symbol] :> With[{ff = FreeFactors[Tan[e + f*x], 
 x]}, Simp[c*(ff/f)   Subst[Int[(d*ff*(x/c))^m*((a + b*(ff*x)^n)^p/(c^2 + f 
f^2*x^2)), x], x, c*(Tan[e + f*x]/ff)], x]] /; FreeQ[{a, b, c, d, e, f, m, 
n, p}, x] && (IGtQ[p, 0] || EqQ[n, 2] || EqQ[n, 4] || (IntegerQ[p] && Ratio 
nalQ[n]))
 
Maple [B] (verified)

Leaf count of result is larger than twice the leaf count of optimal. \(287\) vs. \(2(71)=142\).

Time = 0.18 (sec) , antiderivative size = 288, normalized size of antiderivative = 3.31

method result size
derivativedivides \(-\frac {\left (a +b \tanh \left (x \right )^{2}\right )^{\frac {3}{2}}}{3 b}-\frac {\tanh \left (x \right )^{2} \left (a +b \tanh \left (x \right )^{2}\right )^{\frac {3}{2}}}{5 b}+\frac {2 a \left (a +b \tanh \left (x \right )^{2}\right )^{\frac {3}{2}}}{15 b^{2}}-\frac {\sqrt {b \left (\tanh \left (x \right )-1\right )^{2}+2 b \left (\tanh \left (x \right )-1\right )+a +b}}{2}-\frac {\sqrt {b}\, \ln \left (\frac {b \left (\tanh \left (x \right )-1\right )+b}{\sqrt {b}}+\sqrt {b \left (\tanh \left (x \right )-1\right )^{2}+2 b \left (\tanh \left (x \right )-1\right )+a +b}\right )}{2}+\frac {\sqrt {a +b}\, \ln \left (\frac {2 a +2 b +2 b \left (\tanh \left (x \right )-1\right )+2 \sqrt {a +b}\, \sqrt {b \left (\tanh \left (x \right )-1\right )^{2}+2 b \left (\tanh \left (x \right )-1\right )+a +b}}{\tanh \left (x \right )-1}\right )}{2}-\frac {\sqrt {b \left (\tanh \left (x \right )+1\right )^{2}-2 b \left (\tanh \left (x \right )+1\right )+a +b}}{2}+\frac {\sqrt {b}\, \ln \left (\frac {b \left (\tanh \left (x \right )+1\right )-b}{\sqrt {b}}+\sqrt {b \left (\tanh \left (x \right )+1\right )^{2}-2 b \left (\tanh \left (x \right )+1\right )+a +b}\right )}{2}+\frac {\sqrt {a +b}\, \ln \left (\frac {2 a +2 b -2 b \left (\tanh \left (x \right )+1\right )+2 \sqrt {a +b}\, \sqrt {b \left (\tanh \left (x \right )+1\right )^{2}-2 b \left (\tanh \left (x \right )+1\right )+a +b}}{\tanh \left (x \right )+1}\right )}{2}\) \(288\)
default \(-\frac {\left (a +b \tanh \left (x \right )^{2}\right )^{\frac {3}{2}}}{3 b}-\frac {\tanh \left (x \right )^{2} \left (a +b \tanh \left (x \right )^{2}\right )^{\frac {3}{2}}}{5 b}+\frac {2 a \left (a +b \tanh \left (x \right )^{2}\right )^{\frac {3}{2}}}{15 b^{2}}-\frac {\sqrt {b \left (\tanh \left (x \right )-1\right )^{2}+2 b \left (\tanh \left (x \right )-1\right )+a +b}}{2}-\frac {\sqrt {b}\, \ln \left (\frac {b \left (\tanh \left (x \right )-1\right )+b}{\sqrt {b}}+\sqrt {b \left (\tanh \left (x \right )-1\right )^{2}+2 b \left (\tanh \left (x \right )-1\right )+a +b}\right )}{2}+\frac {\sqrt {a +b}\, \ln \left (\frac {2 a +2 b +2 b \left (\tanh \left (x \right )-1\right )+2 \sqrt {a +b}\, \sqrt {b \left (\tanh \left (x \right )-1\right )^{2}+2 b \left (\tanh \left (x \right )-1\right )+a +b}}{\tanh \left (x \right )-1}\right )}{2}-\frac {\sqrt {b \left (\tanh \left (x \right )+1\right )^{2}-2 b \left (\tanh \left (x \right )+1\right )+a +b}}{2}+\frac {\sqrt {b}\, \ln \left (\frac {b \left (\tanh \left (x \right )+1\right )-b}{\sqrt {b}}+\sqrt {b \left (\tanh \left (x \right )+1\right )^{2}-2 b \left (\tanh \left (x \right )+1\right )+a +b}\right )}{2}+\frac {\sqrt {a +b}\, \ln \left (\frac {2 a +2 b -2 b \left (\tanh \left (x \right )+1\right )+2 \sqrt {a +b}\, \sqrt {b \left (\tanh \left (x \right )+1\right )^{2}-2 b \left (\tanh \left (x \right )+1\right )+a +b}}{\tanh \left (x \right )+1}\right )}{2}\) \(288\)

Input:

int(tanh(x)^5*(a+b*tanh(x)^2)^(1/2),x,method=_RETURNVERBOSE)
 

Output:

-1/3*(a+b*tanh(x)^2)^(3/2)/b-1/5*tanh(x)^2*(a+b*tanh(x)^2)^(3/2)/b+2/15*a/ 
b^2*(a+b*tanh(x)^2)^(3/2)-1/2*(b*(tanh(x)-1)^2+2*b*(tanh(x)-1)+a+b)^(1/2)- 
1/2*b^(1/2)*ln((b*(tanh(x)-1)+b)/b^(1/2)+(b*(tanh(x)-1)^2+2*b*(tanh(x)-1)+ 
a+b)^(1/2))+1/2*(a+b)^(1/2)*ln((2*a+2*b+2*b*(tanh(x)-1)+2*(a+b)^(1/2)*(b*( 
tanh(x)-1)^2+2*b*(tanh(x)-1)+a+b)^(1/2))/(tanh(x)-1))-1/2*(b*(tanh(x)+1)^2 
-2*b*(tanh(x)+1)+a+b)^(1/2)+1/2*b^(1/2)*ln((b*(tanh(x)+1)-b)/b^(1/2)+(b*(t 
anh(x)+1)^2-2*b*(tanh(x)+1)+a+b)^(1/2))+1/2*(a+b)^(1/2)*ln((2*a+2*b-2*b*(t 
anh(x)+1)+2*(a+b)^(1/2)*(b*(tanh(x)+1)^2-2*b*(tanh(x)+1)+a+b)^(1/2))/(tanh 
(x)+1))
 

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 1982 vs. \(2 (71) = 142\).

Time = 0.33 (sec) , antiderivative size = 4529, normalized size of antiderivative = 52.06 \[ \int \tanh ^5(x) \sqrt {a+b \tanh ^2(x)} \, dx=\text {Too large to display} \] Input:

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

Output:

Too large to include
 

Sympy [A] (verification not implemented)

Time = 2.12 (sec) , antiderivative size = 126, normalized size of antiderivative = 1.45 \[ \int \tanh ^5(x) \sqrt {a+b \tanh ^2(x)} \, dx=- \begin {cases} \frac {2 \left (\frac {b^{3} \sqrt {a + b \tanh ^{2}{\left (x \right )}}}{2} + \frac {b^{3} \left (a + b\right ) \operatorname {atan}{\left (\frac {\sqrt {a + b \tanh ^{2}{\left (x \right )}}}{\sqrt {- a - b}} \right )}}{2 \sqrt {- a - b}} + \frac {b \left (a + b \tanh ^{2}{\left (x \right )}\right )^{\frac {5}{2}}}{10} + \frac {\left (a + b \tanh ^{2}{\left (x \right )}\right )^{\frac {3}{2}} \left (- \frac {a b}{2} + \frac {b^{2}}{2}\right )}{3}\right )}{b^{3}} & \text {for}\: b \neq 0 \\\sqrt {a} \left (\frac {\log {\left (\tanh ^{2}{\left (x \right )} - 1 \right )}}{2} + \frac {\tanh ^{4}{\left (x \right )}}{4} + \frac {\tanh ^{2}{\left (x \right )}}{2}\right ) & \text {otherwise} \end {cases} \] Input:

integrate(tanh(x)**5*(a+b*tanh(x)**2)**(1/2),x)
 

Output:

-Piecewise((2*(b**3*sqrt(a + b*tanh(x)**2)/2 + b**3*(a + b)*atan(sqrt(a + 
b*tanh(x)**2)/sqrt(-a - b))/(2*sqrt(-a - b)) + b*(a + b*tanh(x)**2)**(5/2) 
/10 + (a + b*tanh(x)**2)**(3/2)*(-a*b/2 + b**2/2)/3)/b**3, Ne(b, 0)), (sqr 
t(a)*(log(tanh(x)**2 - 1)/2 + tanh(x)**4/4 + tanh(x)**2/2), True))
 

Maxima [F]

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

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

Output:

integrate(sqrt(b*tanh(x)^2 + a)*tanh(x)^5, x)
 

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 980 vs. \(2 (71) = 142\).

Time = 0.84 (sec) , antiderivative size = 980, normalized size of antiderivative = 11.26 \[ \int \tanh ^5(x) \sqrt {a+b \tanh ^2(x)} \, dx=\text {Too large to display} \] Input:

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

Output:

-1/2*sqrt(a + b)*log(abs(-(sqrt(a + b)*e^(2*x) - sqrt(a*e^(4*x) + b*e^(4*x 
) + 2*a*e^(2*x) - 2*b*e^(2*x) + a + b))*(a + b) - sqrt(a + b)*(a - b))) + 
1/2*sqrt(a + b)*log(abs(-sqrt(a + b)*e^(2*x) + sqrt(a*e^(4*x) + b*e^(4*x) 
+ 2*a*e^(2*x) - 2*b*e^(2*x) + a + b) + sqrt(a + b))) - 1/2*sqrt(a + b)*log 
(abs(-sqrt(a + b)*e^(2*x) + sqrt(a*e^(4*x) + b*e^(4*x) + 2*a*e^(2*x) - 2*b 
*e^(2*x) + a + b) - sqrt(a + b))) - 4/15*(15*(sqrt(a + b)*e^(2*x) - sqrt(a 
*e^(4*x) + b*e^(4*x) + 2*a*e^(2*x) - 2*b*e^(2*x) + a + b))^9*(2*a + 3*b) + 
 15*(sqrt(a + b)*e^(2*x) - sqrt(a*e^(4*x) + b*e^(4*x) + 2*a*e^(2*x) - 2*b* 
e^(2*x) + a + b))^8*(10*a + 9*b)*sqrt(a + b) + 20*(18*a^2 + 23*a*b + b^2)* 
(sqrt(a + b)*e^(2*x) - sqrt(a*e^(4*x) + b*e^(4*x) + 2*a*e^(2*x) - 2*b*e^(2 
*x) + a + b))^7 + 20*(30*a^2 - 7*a*b - 65*b^2)*(sqrt(a + b)*e^(2*x) - sqrt 
(a*e^(4*x) + b*e^(4*x) + 2*a*e^(2*x) - 2*b*e^(2*x) + a + b))^6*sqrt(a + b) 
 + 2*(330*a^3 - 705*a^2*b - 1480*a*b^2 + 19*b^3)*(sqrt(a + b)*e^(2*x) - sq 
rt(a*e^(4*x) + b*e^(4*x) + 2*a*e^(2*x) - 2*b*e^(2*x) + a + b))^5 + 10*(18* 
a^3 - 279*a^2*b + 68*a*b^2 + 349*b^3)*(sqrt(a + b)*e^(2*x) - sqrt(a*e^(4*x 
) + b*e^(4*x) + 2*a*e^(2*x) - 2*b*e^(2*x) + a + b))^4*sqrt(a + b) - 20*(30 
*a^4 + 81*a^3*b - 149*a^2*b^2 - 245*a*b^3 + 19*b^4)*(sqrt(a + b)*e^(2*x) - 
 sqrt(a*e^(4*x) + b*e^(4*x) + 2*a*e^(2*x) - 2*b*e^(2*x) + a + b))^3 - 20*( 
42*a^4 - 33*a^3*b - 139*a^2*b^2 + 69*a*b^3 + 325*b^4)*(sqrt(a + b)*e^(2*x) 
 - sqrt(a*e^(4*x) + b*e^(4*x) + 2*a*e^(2*x) - 2*b*e^(2*x) + a + b))^2*s...
 

Mupad [B] (verification not implemented)

Time = 9.84 (sec) , antiderivative size = 119, normalized size of antiderivative = 1.37 \[ \int \tanh ^5(x) \sqrt {a+b \tanh ^2(x)} \, dx=-\frac {{\left (b\,{\mathrm {tanh}\left (x\right )}^2+a\right )}^{5/2}}{5\,b^2}-2\,\mathrm {atan}\left (\frac {2\,\sqrt {b\,{\mathrm {tanh}\left (x\right )}^2+a}\,\sqrt {-\frac {a}{4}-\frac {b}{4}}}{a+b}\right )\,\sqrt {-\frac {a}{4}-\frac {b}{4}}-\sqrt {b\,{\mathrm {tanh}\left (x\right )}^2+a}\,\left (\left (a+b\right )\,\left (\frac {a+b}{b^2}-\frac {2\,a}{b^2}\right )+\frac {a^2}{b^2}\right )-\left (\frac {a+b}{3\,b^2}-\frac {2\,a}{3\,b^2}\right )\,{\left (b\,{\mathrm {tanh}\left (x\right )}^2+a\right )}^{3/2} \] Input:

int(tanh(x)^5*(a + b*tanh(x)^2)^(1/2),x)
                                                                                    
                                                                                    
 

Output:

- (a + b*tanh(x)^2)^(5/2)/(5*b^2) - 2*atan((2*(a + b*tanh(x)^2)^(1/2)*(- a 
/4 - b/4)^(1/2))/(a + b))*(- a/4 - b/4)^(1/2) - (a + b*tanh(x)^2)^(1/2)*(( 
a + b)*((a + b)/b^2 - (2*a)/b^2) + a^2/b^2) - ((a + b)/(3*b^2) - (2*a)/(3* 
b^2))*(a + b*tanh(x)^2)^(3/2)
 

Reduce [F]

\[ \int \tanh ^5(x) \sqrt {a+b \tanh ^2(x)} \, dx=\frac {-3 \sqrt {\tanh \left (x \right )^{2} b +a}\, \tanh \left (x \right )^{4} b^{2}-\sqrt {\tanh \left (x \right )^{2} b +a}\, \tanh \left (x \right )^{2} a b -5 \sqrt {\tanh \left (x \right )^{2} b +a}\, \tanh \left (x \right )^{2} b^{2}+2 \sqrt {\tanh \left (x \right )^{2} b +a}\, a^{2}+10 \sqrt {\tanh \left (x \right )^{2} b +a}\, a b +15 \left (\int \frac {\sqrt {\tanh \left (x \right )^{2} b +a}\, \tanh \left (x \right )^{3}}{\tanh \left (x \right )^{2} b +a}d x \right ) a \,b^{2}+15 \left (\int \frac {\sqrt {\tanh \left (x \right )^{2} b +a}\, \tanh \left (x \right )^{3}}{\tanh \left (x \right )^{2} b +a}d x \right ) b^{3}}{15 b^{2}} \] Input:

int(tanh(x)^5*(a+b*tanh(x)^2)^(1/2),x)
 

Output:

( - 3*sqrt(tanh(x)**2*b + a)*tanh(x)**4*b**2 - sqrt(tanh(x)**2*b + a)*tanh 
(x)**2*a*b - 5*sqrt(tanh(x)**2*b + a)*tanh(x)**2*b**2 + 2*sqrt(tanh(x)**2* 
b + a)*a**2 + 10*sqrt(tanh(x)**2*b + a)*a*b + 15*int((sqrt(tanh(x)**2*b + 
a)*tanh(x)**3)/(tanh(x)**2*b + a),x)*a*b**2 + 15*int((sqrt(tanh(x)**2*b + 
a)*tanh(x)**3)/(tanh(x)**2*b + a),x)*b**3)/(15*b**2)