\(\int (a+b \tanh (c+d x))^5 \, dx\) [57]

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

Optimal result

Integrand size = 12, antiderivative size = 142 \[ \int (a+b \tanh (c+d x))^5 \, dx=a \left (a^4+10 a^2 b^2+5 b^4\right ) x+\frac {b \left (5 a^4+10 a^2 b^2+b^4\right ) \log (\cosh (c+d x))}{d}-\frac {4 a b^2 \left (a^2+b^2\right ) \tanh (c+d x)}{d}-\frac {b \left (3 a^2+b^2\right ) (a+b \tanh (c+d x))^2}{2 d}-\frac {2 a b (a+b \tanh (c+d x))^3}{3 d}-\frac {b (a+b \tanh (c+d x))^4}{4 d} \] Output:

a*(a^4+10*a^2*b^2+5*b^4)*x+b*(5*a^4+10*a^2*b^2+b^4)*ln(cosh(d*x+c))/d-4*a* 
b^2*(a^2+b^2)*tanh(d*x+c)/d-1/2*b*(3*a^2+b^2)*(a+b*tanh(d*x+c))^2/d-2/3*a* 
b*(a+b*tanh(d*x+c))^3/d-1/4*b*(a+b*tanh(d*x+c))^4/d
 

Mathematica [A] (verified)

Time = 0.44 (sec) , antiderivative size = 114, normalized size of antiderivative = 0.80 \[ \int (a+b \tanh (c+d x))^5 \, dx=-\frac {6 (a+b)^5 \log (1-\tanh (c+d x))-6 (a-b)^5 \log (1+\tanh (c+d x))+60 a b^2 \left (2 a^2+b^2\right ) \tanh (c+d x)+6 b^3 \left (10 a^2+b^2\right ) \tanh ^2(c+d x)+20 a b^4 \tanh ^3(c+d x)+3 b^5 \tanh ^4(c+d x)}{12 d} \] Input:

Integrate[(a + b*Tanh[c + d*x])^5,x]
 

Output:

-1/12*(6*(a + b)^5*Log[1 - Tanh[c + d*x]] - 6*(a - b)^5*Log[1 + Tanh[c + d 
*x]] + 60*a*b^2*(2*a^2 + b^2)*Tanh[c + d*x] + 6*b^3*(10*a^2 + b^2)*Tanh[c 
+ d*x]^2 + 20*a*b^4*Tanh[c + d*x]^3 + 3*b^5*Tanh[c + d*x]^4)/d
 

Rubi [A] (verified)

Time = 0.83 (sec) , antiderivative size = 142, normalized size of antiderivative = 1.00, number of steps used = 12, number of rules used = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 1.000, Rules used = {3042, 3963, 3042, 4011, 3042, 4011, 3042, 4008, 26, 3042, 26, 3956}

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+b \tanh (c+d x))^5 \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int (a-i b \tan (i c+i d x))^5dx\)

\(\Big \downarrow \) 3963

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

\(\Big \downarrow \) 3042

\(\displaystyle -\frac {b (a+b \tanh (c+d x))^4}{4 d}+\int (a-i b \tan (i c+i d x))^3 \left (a^2-2 i b \tan (i c+i d x) a+b^2\right )dx\)

\(\Big \downarrow \) 4011

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

\(\Big \downarrow \) 3042

\(\displaystyle \int (a-i b \tan (i c+i d x))^2 \left (a \left (a^2+3 b^2\right )-i b \left (3 a^2+b^2\right ) \tan (i c+i d x)\right )dx-\frac {b (a+b \tanh (c+d x))^4}{4 d}-\frac {2 a b (a+b \tanh (c+d x))^3}{3 d}\)

\(\Big \downarrow \) 4011

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

\(\Big \downarrow \) 3042

\(\displaystyle \int (a-i b \tan (i c+i d x)) \left (a^4+6 b^2 a^2-4 i b \left (a^2+b^2\right ) \tan (i c+i d x) a+b^4\right )dx-\frac {b \left (3 a^2+b^2\right ) (a+b \tanh (c+d x))^2}{2 d}-\frac {b (a+b \tanh (c+d x))^4}{4 d}-\frac {2 a b (a+b \tanh (c+d x))^3}{3 d}\)

\(\Big \downarrow \) 4008

\(\displaystyle -i b \left (5 a^4+10 a^2 b^2+b^4\right ) \int i \tanh (c+d x)dx-\frac {b \left (3 a^2+b^2\right ) (a+b \tanh (c+d x))^2}{2 d}-\frac {4 a b^2 \left (a^2+b^2\right ) \tanh (c+d x)}{d}+a x \left (a^4+10 a^2 b^2+5 b^4\right )-\frac {b (a+b \tanh (c+d x))^4}{4 d}-\frac {2 a b (a+b \tanh (c+d x))^3}{3 d}\)

\(\Big \downarrow \) 26

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

\(\Big \downarrow \) 3042

\(\displaystyle b \left (5 a^4+10 a^2 b^2+b^4\right ) \int -i \tan (i c+i d x)dx-\frac {b \left (3 a^2+b^2\right ) (a+b \tanh (c+d x))^2}{2 d}-\frac {4 a b^2 \left (a^2+b^2\right ) \tanh (c+d x)}{d}+a x \left (a^4+10 a^2 b^2+5 b^4\right )-\frac {b (a+b \tanh (c+d x))^4}{4 d}-\frac {2 a b (a+b \tanh (c+d x))^3}{3 d}\)

\(\Big \downarrow \) 26

\(\displaystyle -i b \left (5 a^4+10 a^2 b^2+b^4\right ) \int \tan (i c+i d x)dx-\frac {b \left (3 a^2+b^2\right ) (a+b \tanh (c+d x))^2}{2 d}-\frac {4 a b^2 \left (a^2+b^2\right ) \tanh (c+d x)}{d}+a x \left (a^4+10 a^2 b^2+5 b^4\right )-\frac {b (a+b \tanh (c+d x))^4}{4 d}-\frac {2 a b (a+b \tanh (c+d x))^3}{3 d}\)

\(\Big \downarrow \) 3956

\(\displaystyle -\frac {b \left (3 a^2+b^2\right ) (a+b \tanh (c+d x))^2}{2 d}-\frac {4 a b^2 \left (a^2+b^2\right ) \tanh (c+d x)}{d}+\frac {b \left (5 a^4+10 a^2 b^2+b^4\right ) \log (\cosh (c+d x))}{d}+a x \left (a^4+10 a^2 b^2+5 b^4\right )-\frac {b (a+b \tanh (c+d x))^4}{4 d}-\frac {2 a b (a+b \tanh (c+d x))^3}{3 d}\)

Input:

Int[(a + b*Tanh[c + d*x])^5,x]
 

Output:

a*(a^4 + 10*a^2*b^2 + 5*b^4)*x + (b*(5*a^4 + 10*a^2*b^2 + b^4)*Log[Cosh[c 
+ d*x]])/d - (4*a*b^2*(a^2 + b^2)*Tanh[c + d*x])/d - (b*(3*a^2 + b^2)*(a + 
 b*Tanh[c + d*x])^2)/(2*d) - (2*a*b*(a + b*Tanh[c + d*x])^3)/(3*d) - (b*(a 
 + b*Tanh[c + d*x])^4)/(4*d)
 

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 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 3956
Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-Log[RemoveContent[Cos[c + d 
*x], x]]/d, x] /; FreeQ[{c, d}, x]
 

rule 3963
Int[((a_) + (b_.)*tan[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[b*((a + 
b*Tan[c + d*x])^(n - 1)/(d*(n - 1))), x] + Int[(a^2 - b^2 + 2*a*b*Tan[c + d 
*x])*(a + b*Tan[c + d*x])^(n - 2), x] /; FreeQ[{a, b, c, d}, x] && NeQ[a^2 
+ b^2, 0] && GtQ[n, 1]
 

rule 4008
Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*tan[(e_.) + (f_.) 
*(x_)]), x_Symbol] :> Simp[(a*c - b*d)*x, x] + (Simp[b*d*(Tan[e + f*x]/f), 
x] + Simp[(b*c + a*d)   Int[Tan[e + f*x], x], x]) /; FreeQ[{a, b, c, d, e, 
f}, x] && NeQ[b*c - a*d, 0] && NeQ[b*c + a*d, 0]
 

rule 4011
Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + 
 (f_.)*(x_)]), x_Symbol] :> Simp[d*((a + b*Tan[e + f*x])^m/(f*m)), x] + Int 
[(a + b*Tan[e + f*x])^(m - 1)*Simp[a*c - b*d + (b*c + a*d)*Tan[e + f*x], x] 
, x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 
 0] && GtQ[m, 0]
 
Maple [A] (verified)

Time = 0.33 (sec) , antiderivative size = 182, normalized size of antiderivative = 1.28

method result size
derivativedivides \(\frac {\frac {\left (a^{5}-5 a^{4} b +10 a^{3} b^{2}-10 a^{2} b^{3}+5 a \,b^{4}-b^{5}\right ) \ln \left (\tanh \left (d x +c \right )+1\right )}{2}-\frac {b^{5} \tanh \left (d x +c \right )^{4}}{4}-\frac {5 a \,b^{4} \tanh \left (d x +c \right )^{3}}{3}-5 a^{2} b^{3} \tanh \left (d x +c \right )^{2}-5 a \,b^{4} \tanh \left (d x +c \right )-\frac {\left (a^{5}+5 a^{4} b +10 a^{3} b^{2}+10 a^{2} b^{3}+5 a \,b^{4}+b^{5}\right ) \ln \left (\tanh \left (d x +c \right )-1\right )}{2}-\frac {b^{5} \tanh \left (d x +c \right )^{2}}{2}-10 a^{3} b^{2} \tanh \left (d x +c \right )}{d}\) \(182\)
default \(\frac {\frac {\left (a^{5}-5 a^{4} b +10 a^{3} b^{2}-10 a^{2} b^{3}+5 a \,b^{4}-b^{5}\right ) \ln \left (\tanh \left (d x +c \right )+1\right )}{2}-\frac {b^{5} \tanh \left (d x +c \right )^{4}}{4}-\frac {5 a \,b^{4} \tanh \left (d x +c \right )^{3}}{3}-5 a^{2} b^{3} \tanh \left (d x +c \right )^{2}-5 a \,b^{4} \tanh \left (d x +c \right )-\frac {\left (a^{5}+5 a^{4} b +10 a^{3} b^{2}+10 a^{2} b^{3}+5 a \,b^{4}+b^{5}\right ) \ln \left (\tanh \left (d x +c \right )-1\right )}{2}-\frac {b^{5} \tanh \left (d x +c \right )^{2}}{2}-10 a^{3} b^{2} \tanh \left (d x +c \right )}{d}\) \(182\)
parallelrisch \(-\frac {3 b^{5} \tanh \left (d x +c \right )^{4}+20 a \,b^{4} \tanh \left (d x +c \right )^{3}-12 a^{5} d x +60 a^{4} b d x -120 a^{3} b^{2} d x +120 a^{2} b^{3} d x -60 a \,b^{4} d x +12 b^{5} d x +60 a^{2} b^{3} \tanh \left (d x +c \right )^{2}+6 b^{5} \tanh \left (d x +c \right )^{2}+60 \ln \left (1-\tanh \left (d x +c \right )\right ) a^{4} b +120 \ln \left (1-\tanh \left (d x +c \right )\right ) a^{2} b^{3}+12 \ln \left (1-\tanh \left (d x +c \right )\right ) b^{5}+120 a^{3} b^{2} \tanh \left (d x +c \right )+60 a \,b^{4} \tanh \left (d x +c \right )}{12 d}\) \(191\)
parts \(a^{5} x +\frac {b^{5} \left (-\frac {\tanh \left (d x +c \right )^{4}}{4}-\frac {\tanh \left (d x +c \right )^{2}}{2}-\frac {\ln \left (\tanh \left (d x +c \right )-1\right )}{2}-\frac {\ln \left (\tanh \left (d x +c \right )+1\right )}{2}\right )}{d}+\frac {5 a \,b^{4} \left (-\frac {\tanh \left (d x +c \right )^{3}}{3}-\tanh \left (d x +c \right )-\frac {\ln \left (\tanh \left (d x +c \right )-1\right )}{2}+\frac {\ln \left (\tanh \left (d x +c \right )+1\right )}{2}\right )}{d}+\frac {10 a^{2} b^{3} \left (-\frac {\tanh \left (d x +c \right )^{2}}{2}-\frac {\ln \left (\tanh \left (d x +c \right )-1\right )}{2}-\frac {\ln \left (\tanh \left (d x +c \right )+1\right )}{2}\right )}{d}+\frac {10 a^{3} b^{2} \left (-\tanh \left (d x +c \right )-\frac {\ln \left (\tanh \left (d x +c \right )-1\right )}{2}+\frac {\ln \left (\tanh \left (d x +c \right )+1\right )}{2}\right )}{d}+\frac {5 a^{4} b \ln \left (\cosh \left (d x +c \right )\right )}{d}\) \(209\)
risch \(a^{5} x -5 b \,a^{4} x +10 a^{3} b^{2} x -10 b^{3} a^{2} x +5 a \,b^{4} x -b^{5} x -\frac {10 b \,a^{4} c}{d}-\frac {20 b^{3} a^{2} c}{d}-\frac {2 b^{5} c}{d}+\frac {4 b^{2} \left (15 a^{3} {\mathrm e}^{6 d x +6 c}+15 a^{2} b \,{\mathrm e}^{6 d x +6 c}+15 a \,b^{2} {\mathrm e}^{6 d x +6 c}+3 b^{3} {\mathrm e}^{6 d x +6 c}+45 \,{\mathrm e}^{4 d x +4 c} a^{3}+30 a^{2} b \,{\mathrm e}^{4 d x +4 c}+30 a \,b^{2} {\mathrm e}^{4 d x +4 c}+3 b^{3} {\mathrm e}^{4 d x +4 c}+45 \,{\mathrm e}^{2 d x +2 c} a^{3}+15 a^{2} b \,{\mathrm e}^{2 d x +2 c}+25 a \,b^{2} {\mathrm e}^{2 d x +2 c}+3 b^{3} {\mathrm e}^{2 d x +2 c}+15 a^{3}+10 b^{2} a \right )}{3 d \left ({\mathrm e}^{2 d x +2 c}+1\right )^{4}}+\frac {5 b \ln \left ({\mathrm e}^{2 d x +2 c}+1\right ) a^{4}}{d}+\frac {10 b^{3} \ln \left ({\mathrm e}^{2 d x +2 c}+1\right ) a^{2}}{d}+\frac {b^{5} \ln \left ({\mathrm e}^{2 d x +2 c}+1\right )}{d}\) \(346\)

Input:

int((a+b*tanh(d*x+c))^5,x,method=_RETURNVERBOSE)
 

Output:

1/d*(1/2*(a^5-5*a^4*b+10*a^3*b^2-10*a^2*b^3+5*a*b^4-b^5)*ln(tanh(d*x+c)+1) 
-1/4*b^5*tanh(d*x+c)^4-5/3*a*b^4*tanh(d*x+c)^3-5*a^2*b^3*tanh(d*x+c)^2-5*a 
*b^4*tanh(d*x+c)-1/2*(a^5+5*a^4*b+10*a^3*b^2+10*a^2*b^3+5*a*b^4+b^5)*ln(ta 
nh(d*x+c)-1)-1/2*b^5*tanh(d*x+c)^2-10*a^3*b^2*tanh(d*x+c))
 

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 2739 vs. \(2 (136) = 272\).

Time = 0.10 (sec) , antiderivative size = 2739, normalized size of antiderivative = 19.29 \[ \int (a+b \tanh (c+d x))^5 \, dx=\text {Too large to display} \] Input:

integrate((a+b*tanh(d*x+c))^5,x, algorithm="fricas")
 

Output:

1/3*(3*(a^5 - 5*a^4*b + 10*a^3*b^2 - 10*a^2*b^3 + 5*a*b^4 - b^5)*d*x*cosh( 
d*x + c)^8 + 24*(a^5 - 5*a^4*b + 10*a^3*b^2 - 10*a^2*b^3 + 5*a*b^4 - b^5)* 
d*x*cosh(d*x + c)*sinh(d*x + c)^7 + 3*(a^5 - 5*a^4*b + 10*a^3*b^2 - 10*a^2 
*b^3 + 5*a*b^4 - b^5)*d*x*sinh(d*x + c)^8 + 12*(5*a^3*b^2 + 5*a^2*b^3 + 5* 
a*b^4 + b^5 + (a^5 - 5*a^4*b + 10*a^3*b^2 - 10*a^2*b^3 + 5*a*b^4 - b^5)*d* 
x)*cosh(d*x + c)^6 + 12*(5*a^3*b^2 + 5*a^2*b^3 + 5*a*b^4 + b^5 + 7*(a^5 - 
5*a^4*b + 10*a^3*b^2 - 10*a^2*b^3 + 5*a*b^4 - b^5)*d*x*cosh(d*x + c)^2 + ( 
a^5 - 5*a^4*b + 10*a^3*b^2 - 10*a^2*b^3 + 5*a*b^4 - b^5)*d*x)*sinh(d*x + c 
)^6 + 24*(7*(a^5 - 5*a^4*b + 10*a^3*b^2 - 10*a^2*b^3 + 5*a*b^4 - b^5)*d*x* 
cosh(d*x + c)^3 + 3*(5*a^3*b^2 + 5*a^2*b^3 + 5*a*b^4 + b^5 + (a^5 - 5*a^4* 
b + 10*a^3*b^2 - 10*a^2*b^3 + 5*a*b^4 - b^5)*d*x)*cosh(d*x + c))*sinh(d*x 
+ c)^5 + 60*a^3*b^2 + 40*a*b^4 + 6*(30*a^3*b^2 + 20*a^2*b^3 + 20*a*b^4 + 2 
*b^5 + 3*(a^5 - 5*a^4*b + 10*a^3*b^2 - 10*a^2*b^3 + 5*a*b^4 - b^5)*d*x)*co 
sh(d*x + c)^4 + 6*(35*(a^5 - 5*a^4*b + 10*a^3*b^2 - 10*a^2*b^3 + 5*a*b^4 - 
 b^5)*d*x*cosh(d*x + c)^4 + 30*a^3*b^2 + 20*a^2*b^3 + 20*a*b^4 + 2*b^5 + 3 
*(a^5 - 5*a^4*b + 10*a^3*b^2 - 10*a^2*b^3 + 5*a*b^4 - b^5)*d*x + 30*(5*a^3 
*b^2 + 5*a^2*b^3 + 5*a*b^4 + b^5 + (a^5 - 5*a^4*b + 10*a^3*b^2 - 10*a^2*b^ 
3 + 5*a*b^4 - b^5)*d*x)*cosh(d*x + c)^2)*sinh(d*x + c)^4 + 24*(7*(a^5 - 5* 
a^4*b + 10*a^3*b^2 - 10*a^2*b^3 + 5*a*b^4 - b^5)*d*x*cosh(d*x + c)^5 + 10* 
(5*a^3*b^2 + 5*a^2*b^3 + 5*a*b^4 + b^5 + (a^5 - 5*a^4*b + 10*a^3*b^2 - ...
 

Sympy [A] (verification not implemented)

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

integrate((a+b*tanh(d*x+c))**5,x)
 

Output:

Piecewise((a**5*x + 5*a**4*b*x - 5*a**4*b*log(tanh(c + d*x) + 1)/d + 10*a* 
*3*b**2*x - 10*a**3*b**2*tanh(c + d*x)/d + 10*a**2*b**3*x - 10*a**2*b**3*l 
og(tanh(c + d*x) + 1)/d - 5*a**2*b**3*tanh(c + d*x)**2/d + 5*a*b**4*x - 5* 
a*b**4*tanh(c + d*x)**3/(3*d) - 5*a*b**4*tanh(c + d*x)/d + b**5*x - b**5*l 
og(tanh(c + d*x) + 1)/d - b**5*tanh(c + d*x)**4/(4*d) - b**5*tanh(c + d*x) 
**2/(2*d), Ne(d, 0)), (x*(a + b*tanh(c))**5, True))
 

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 310 vs. \(2 (136) = 272\).

Time = 0.15 (sec) , antiderivative size = 310, normalized size of antiderivative = 2.18 \[ \int (a+b \tanh (c+d x))^5 \, dx=\frac {5}{3} \, a b^{4} {\left (3 \, x + \frac {3 \, c}{d} - \frac {4 \, {\left (3 \, e^{\left (-2 \, d x - 2 \, c\right )} + 3 \, e^{\left (-4 \, d x - 4 \, c\right )} + 2\right )}}{d {\left (3 \, e^{\left (-2 \, d x - 2 \, c\right )} + 3 \, e^{\left (-4 \, d x - 4 \, c\right )} + e^{\left (-6 \, d x - 6 \, c\right )} + 1\right )}}\right )} + b^{5} {\left (x + \frac {c}{d} + \frac {\log \left (e^{\left (-2 \, d x - 2 \, c\right )} + 1\right )}{d} + \frac {4 \, {\left (e^{\left (-2 \, d x - 2 \, c\right )} + e^{\left (-4 \, d x - 4 \, c\right )} + e^{\left (-6 \, d x - 6 \, c\right )}\right )}}{d {\left (4 \, e^{\left (-2 \, d x - 2 \, c\right )} + 6 \, e^{\left (-4 \, d x - 4 \, c\right )} + 4 \, e^{\left (-6 \, d x - 6 \, c\right )} + e^{\left (-8 \, d x - 8 \, c\right )} + 1\right )}}\right )} + 10 \, a^{2} b^{3} {\left (x + \frac {c}{d} + \frac {\log \left (e^{\left (-2 \, d x - 2 \, c\right )} + 1\right )}{d} + \frac {2 \, e^{\left (-2 \, d x - 2 \, c\right )}}{d {\left (2 \, e^{\left (-2 \, d x - 2 \, c\right )} + e^{\left (-4 \, d x - 4 \, c\right )} + 1\right )}}\right )} + 10 \, a^{3} b^{2} {\left (x + \frac {c}{d} - \frac {2}{d {\left (e^{\left (-2 \, d x - 2 \, c\right )} + 1\right )}}\right )} + a^{5} x + \frac {5 \, a^{4} b \log \left (\cosh \left (d x + c\right )\right )}{d} \] Input:

integrate((a+b*tanh(d*x+c))^5,x, algorithm="maxima")
 

Output:

5/3*a*b^4*(3*x + 3*c/d - 4*(3*e^(-2*d*x - 2*c) + 3*e^(-4*d*x - 4*c) + 2)/( 
d*(3*e^(-2*d*x - 2*c) + 3*e^(-4*d*x - 4*c) + e^(-6*d*x - 6*c) + 1))) + b^5 
*(x + c/d + log(e^(-2*d*x - 2*c) + 1)/d + 4*(e^(-2*d*x - 2*c) + e^(-4*d*x 
- 4*c) + e^(-6*d*x - 6*c))/(d*(4*e^(-2*d*x - 2*c) + 6*e^(-4*d*x - 4*c) + 4 
*e^(-6*d*x - 6*c) + e^(-8*d*x - 8*c) + 1))) + 10*a^2*b^3*(x + c/d + log(e^ 
(-2*d*x - 2*c) + 1)/d + 2*e^(-2*d*x - 2*c)/(d*(2*e^(-2*d*x - 2*c) + e^(-4* 
d*x - 4*c) + 1))) + 10*a^3*b^2*(x + c/d - 2/(d*(e^(-2*d*x - 2*c) + 1))) + 
a^5*x + 5*a^4*b*log(cosh(d*x + c))/d
 

Giac [A] (verification not implemented)

Time = 0.14 (sec) , antiderivative size = 224, normalized size of antiderivative = 1.58 \[ \int (a+b \tanh (c+d x))^5 \, dx=\frac {3 \, {\left (a^{5} - 5 \, a^{4} b + 10 \, a^{3} b^{2} - 10 \, a^{2} b^{3} + 5 \, a b^{4} - b^{5}\right )} {\left (d x + c\right )} + 3 \, {\left (5 \, a^{4} b + 10 \, a^{2} b^{3} + b^{5}\right )} \log \left (e^{\left (2 \, d x + 2 \, c\right )} + 1\right ) + \frac {4 \, {\left (15 \, a^{3} b^{2} + 10 \, a b^{4} + 3 \, {\left (5 \, a^{3} b^{2} + 5 \, a^{2} b^{3} + 5 \, a b^{4} + b^{5}\right )} e^{\left (6 \, d x + 6 \, c\right )} + 3 \, {\left (15 \, a^{3} b^{2} + 10 \, a^{2} b^{3} + 10 \, a b^{4} + b^{5}\right )} e^{\left (4 \, d x + 4 \, c\right )} + {\left (45 \, a^{3} b^{2} + 15 \, a^{2} b^{3} + 25 \, a b^{4} + 3 \, b^{5}\right )} e^{\left (2 \, d x + 2 \, c\right )}\right )}}{{\left (e^{\left (2 \, d x + 2 \, c\right )} + 1\right )}^{4}}}{3 \, d} \] Input:

integrate((a+b*tanh(d*x+c))^5,x, algorithm="giac")
 

Output:

1/3*(3*(a^5 - 5*a^4*b + 10*a^3*b^2 - 10*a^2*b^3 + 5*a*b^4 - b^5)*(d*x + c) 
 + 3*(5*a^4*b + 10*a^2*b^3 + b^5)*log(e^(2*d*x + 2*c) + 1) + 4*(15*a^3*b^2 
 + 10*a*b^4 + 3*(5*a^3*b^2 + 5*a^2*b^3 + 5*a*b^4 + b^5)*e^(6*d*x + 6*c) + 
3*(15*a^3*b^2 + 10*a^2*b^3 + 10*a*b^4 + b^5)*e^(4*d*x + 4*c) + (45*a^3*b^2 
 + 15*a^2*b^3 + 25*a*b^4 + 3*b^5)*e^(2*d*x + 2*c))/(e^(2*d*x + 2*c) + 1)^4 
)/d
 

Mupad [B] (verification not implemented)

Time = 2.07 (sec) , antiderivative size = 153, normalized size of antiderivative = 1.08 \[ \int (a+b \tanh (c+d x))^5 \, dx=x\,\left (a^5+5\,a^4\,b+10\,a^3\,b^2+10\,a^2\,b^3+5\,a\,b^4+b^5\right )-\frac {5\,\mathrm {tanh}\left (c+d\,x\right )\,\left (2\,a^3\,b^2+a\,b^4\right )}{d}-\frac {b^5\,{\mathrm {tanh}\left (c+d\,x\right )}^4}{4\,d}-\frac {\ln \left (\mathrm {tanh}\left (c+d\,x\right )+1\right )\,\left (5\,a^4\,b+10\,a^2\,b^3+b^5\right )}{d}-\frac {{\mathrm {tanh}\left (c+d\,x\right )}^2\,\left (10\,a^2\,b^3+b^5\right )}{2\,d}-\frac {5\,a\,b^4\,{\mathrm {tanh}\left (c+d\,x\right )}^3}{3\,d} \] Input:

int((a + b*tanh(c + d*x))^5,x)
                                                                                    
                                                                                    
 

Output:

x*(5*a*b^4 + 5*a^4*b + a^5 + b^5 + 10*a^2*b^3 + 10*a^3*b^2) - (5*tanh(c + 
d*x)*(a*b^4 + 2*a^3*b^2))/d - (b^5*tanh(c + d*x)^4)/(4*d) - (log(tanh(c + 
d*x) + 1)*(5*a^4*b + b^5 + 10*a^2*b^3))/d - (tanh(c + d*x)^2*(b^5 + 10*a^2 
*b^3))/(2*d) - (5*a*b^4*tanh(c + d*x)^3)/(3*d)
 

Reduce [B] (verification not implemented)

Time = 0.32 (sec) , antiderivative size = 1151, normalized size of antiderivative = 8.11 \[ \int (a+b \tanh (c+d x))^5 \, dx =\text {Too large to display} \] Input:

int((a+b*tanh(d*x+c))^5,x)
 

Output:

(15*e**(8*c + 8*d*x)*log(e**(2*c + 2*d*x) + 1)*a**4*b + 30*e**(8*c + 8*d*x 
)*log(e**(2*c + 2*d*x) + 1)*a**2*b**3 + 3*e**(8*c + 8*d*x)*log(e**(2*c + 2 
*d*x) + 1)*b**5 + 3*e**(8*c + 8*d*x)*a**5*d*x - 15*e**(8*c + 8*d*x)*a**4*b 
*d*x + 30*e**(8*c + 8*d*x)*a**3*b**2*d*x - 15*e**(8*c + 8*d*x)*a**3*b**2 - 
 30*e**(8*c + 8*d*x)*a**2*b**3*d*x - 15*e**(8*c + 8*d*x)*a**2*b**3 + 15*e* 
*(8*c + 8*d*x)*a*b**4*d*x - 15*e**(8*c + 8*d*x)*a*b**4 - 3*e**(8*c + 8*d*x 
)*b**5*d*x - 3*e**(8*c + 8*d*x)*b**5 + 60*e**(6*c + 6*d*x)*log(e**(2*c + 2 
*d*x) + 1)*a**4*b + 120*e**(6*c + 6*d*x)*log(e**(2*c + 2*d*x) + 1)*a**2*b* 
*3 + 12*e**(6*c + 6*d*x)*log(e**(2*c + 2*d*x) + 1)*b**5 + 12*e**(6*c + 6*d 
*x)*a**5*d*x - 60*e**(6*c + 6*d*x)*a**4*b*d*x + 120*e**(6*c + 6*d*x)*a**3* 
b**2*d*x - 120*e**(6*c + 6*d*x)*a**2*b**3*d*x + 60*e**(6*c + 6*d*x)*a*b**4 
*d*x - 12*e**(6*c + 6*d*x)*b**5*d*x + 90*e**(4*c + 4*d*x)*log(e**(2*c + 2* 
d*x) + 1)*a**4*b + 180*e**(4*c + 4*d*x)*log(e**(2*c + 2*d*x) + 1)*a**2*b** 
3 + 18*e**(4*c + 4*d*x)*log(e**(2*c + 2*d*x) + 1)*b**5 + 18*e**(4*c + 4*d* 
x)*a**5*d*x - 90*e**(4*c + 4*d*x)*a**4*b*d*x + 180*e**(4*c + 4*d*x)*a**3*b 
**2*d*x + 90*e**(4*c + 4*d*x)*a**3*b**2 - 180*e**(4*c + 4*d*x)*a**2*b**3*d 
*x + 30*e**(4*c + 4*d*x)*a**2*b**3 + 90*e**(4*c + 4*d*x)*a*b**4*d*x + 30*e 
**(4*c + 4*d*x)*a*b**4 - 18*e**(4*c + 4*d*x)*b**5*d*x - 6*e**(4*c + 4*d*x) 
*b**5 + 60*e**(2*c + 2*d*x)*log(e**(2*c + 2*d*x) + 1)*a**4*b + 120*e**(2*c 
 + 2*d*x)*log(e**(2*c + 2*d*x) + 1)*a**2*b**3 + 12*e**(2*c + 2*d*x)*log...