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

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 = 101 \[ \int (a+b \tanh (c+d x))^4 \, dx=\left (a^4+6 a^2 b^2+b^4\right ) x+\frac {4 a b \left (a^2+b^2\right ) \log (\cosh (c+d x))}{d}-\frac {b^2 \left (3 a^2+b^2\right ) \tanh (c+d x)}{d}-\frac {a b (a+b \tanh (c+d x))^2}{d}-\frac {b (a+b \tanh (c+d x))^3}{3 d} \] Output:

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

Mathematica [A] (verified)

Time = 0.24 (sec) , antiderivative size = 91, normalized size of antiderivative = 0.90 \[ \int (a+b \tanh (c+d x))^4 \, dx=-\frac {3 (a+b)^4 \log (1-\tanh (c+d x))-3 (a-b)^4 \log (1+\tanh (c+d x))+6 b^2 \left (6 a^2+b^2\right ) \tanh (c+d x)+12 a b^3 \tanh ^2(c+d x)+2 b^4 \tanh ^3(c+d x)}{6 d} \] Input:

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

Output:

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

Rubi [A] (verified)

Time = 0.59 (sec) , antiderivative size = 101, normalized size of antiderivative = 1.00, number of steps used = 10, number of rules used = 10, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.833, Rules used = {3042, 3963, 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))^4 \, dx\)

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 3963

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

\(\Big \downarrow \) 3042

\(\displaystyle -\frac {b (a+b \tanh (c+d x))^3}{3 d}+\int (a-i b \tan (i c+i d x))^2 \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)) \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))^3}{3 d}-\frac {a b (a+b \tanh (c+d x))^2}{d}\)

\(\Big \downarrow \) 3042

\(\displaystyle \int (a-i b \tan (i c+i d x)) \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))^3}{3 d}-\frac {a b (a+b \tanh (c+d x))^2}{d}\)

\(\Big \downarrow \) 4008

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

\(\Big \downarrow \) 26

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 26

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

\(\Big \downarrow \) 3956

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

Input:

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

Output:

(a^4 + 6*a^2*b^2 + b^4)*x + (4*a*b*(a^2 + b^2)*Log[Cosh[c + d*x]])/d - (b^ 
2*(3*a^2 + b^2)*Tanh[c + d*x])/d - (a*b*(a + b*Tanh[c + d*x])^2)/d - (b*(a 
 + b*Tanh[c + d*x])^3)/(3*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.25 (sec) , antiderivative size = 132, normalized size of antiderivative = 1.31

method result size
parallelrisch \(-\frac {b^{4} \tanh \left (d x +c \right )^{3}-3 a^{4} d x +12 a^{3} b d x -18 a^{2} b^{2} d x +12 a \,b^{3} d x -3 b^{4} d x +6 a \,b^{3} \tanh \left (d x +c \right )^{2}+12 \ln \left (1-\tanh \left (d x +c \right )\right ) a^{3} b +12 \ln \left (1-\tanh \left (d x +c \right )\right ) a \,b^{3}+18 a^{2} b^{2} \tanh \left (d x +c \right )+3 b^{4} \tanh \left (d x +c \right )}{3 d}\) \(132\)
derivativedivides \(\frac {-\frac {b^{4} \tanh \left (d x +c \right )^{3}}{3}-2 a \,b^{3} \tanh \left (d x +c \right )^{2}-6 a^{2} b^{2} \tanh \left (d x +c \right )-b^{4} \tanh \left (d x +c \right )-\frac {\left (a^{4}+4 a^{3} b +6 a^{2} b^{2}+4 a \,b^{3}+b^{4}\right ) \ln \left (\tanh \left (d x +c \right )-1\right )}{2}+\frac {\left (a^{4}-4 a^{3} b +6 a^{2} b^{2}-4 a \,b^{3}+b^{4}\right ) \ln \left (\tanh \left (d x +c \right )+1\right )}{2}}{d}\) \(134\)
default \(\frac {-\frac {b^{4} \tanh \left (d x +c \right )^{3}}{3}-2 a \,b^{3} \tanh \left (d x +c \right )^{2}-6 a^{2} b^{2} \tanh \left (d x +c \right )-b^{4} \tanh \left (d x +c \right )-\frac {\left (a^{4}+4 a^{3} b +6 a^{2} b^{2}+4 a \,b^{3}+b^{4}\right ) \ln \left (\tanh \left (d x +c \right )-1\right )}{2}+\frac {\left (a^{4}-4 a^{3} b +6 a^{2} b^{2}-4 a \,b^{3}+b^{4}\right ) \ln \left (\tanh \left (d x +c \right )+1\right )}{2}}{d}\) \(134\)
parts \(a^{4} x +\frac {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 {4 a \,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 {6 a^{2} 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 {4 a^{3} b \ln \left (\cosh \left (d x +c \right )\right )}{d}\) \(155\)
risch \(a^{4} x -4 a^{3} b x +6 a^{2} b^{2} x -4 a \,b^{3} x +b^{4} x -\frac {8 a^{3} b c}{d}-\frac {8 a \,b^{3} c}{d}+\frac {4 b^{2} \left (9 \,{\mathrm e}^{4 d x +4 c} a^{2}+6 \,{\mathrm e}^{4 d x +4 c} a b +3 \,{\mathrm e}^{4 d x +4 c} b^{2}+18 \,{\mathrm e}^{2 d x +2 c} a^{2}+6 \,{\mathrm e}^{2 d x +2 c} b a +3 b^{2} {\mathrm e}^{2 d x +2 c}+9 a^{2}+2 b^{2}\right )}{3 d \left ({\mathrm e}^{2 d x +2 c}+1\right )^{3}}+\frac {4 b \,a^{3} \ln \left ({\mathrm e}^{2 d x +2 c}+1\right )}{d}+\frac {4 b^{3} a \ln \left ({\mathrm e}^{2 d x +2 c}+1\right )}{d}\) \(211\)

Input:

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

Output:

-1/3*(b^4*tanh(d*x+c)^3-3*a^4*d*x+12*a^3*b*d*x-18*a^2*b^2*d*x+12*a*b^3*d*x 
-3*b^4*d*x+6*a*b^3*tanh(d*x+c)^2+12*ln(1-tanh(d*x+c))*a^3*b+12*ln(1-tanh(d 
*x+c))*a*b^3+18*a^2*b^2*tanh(d*x+c)+3*b^4*tanh(d*x+c))/d
 

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 1389 vs. \(2 (99) = 198\).

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

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

Output:

1/3*(3*(a^4 - 4*a^3*b + 6*a^2*b^2 - 4*a*b^3 + b^4)*d*x*cosh(d*x + c)^6 + 1 
8*(a^4 - 4*a^3*b + 6*a^2*b^2 - 4*a*b^3 + b^4)*d*x*cosh(d*x + c)*sinh(d*x + 
 c)^5 + 3*(a^4 - 4*a^3*b + 6*a^2*b^2 - 4*a*b^3 + b^4)*d*x*sinh(d*x + c)^6 
+ 3*(12*a^2*b^2 + 8*a*b^3 + 4*b^4 + 3*(a^4 - 4*a^3*b + 6*a^2*b^2 - 4*a*b^3 
 + b^4)*d*x)*cosh(d*x + c)^4 + 3*(15*(a^4 - 4*a^3*b + 6*a^2*b^2 - 4*a*b^3 
+ b^4)*d*x*cosh(d*x + c)^2 + 12*a^2*b^2 + 8*a*b^3 + 4*b^4 + 3*(a^4 - 4*a^3 
*b + 6*a^2*b^2 - 4*a*b^3 + b^4)*d*x)*sinh(d*x + c)^4 + 36*a^2*b^2 + 8*b^4 
+ 12*(5*(a^4 - 4*a^3*b + 6*a^2*b^2 - 4*a*b^3 + b^4)*d*x*cosh(d*x + c)^3 + 
(12*a^2*b^2 + 8*a*b^3 + 4*b^4 + 3*(a^4 - 4*a^3*b + 6*a^2*b^2 - 4*a*b^3 + b 
^4)*d*x)*cosh(d*x + c))*sinh(d*x + c)^3 + 3*(a^4 - 4*a^3*b + 6*a^2*b^2 - 4 
*a*b^3 + b^4)*d*x + 3*(24*a^2*b^2 + 8*a*b^3 + 4*b^4 + 3*(a^4 - 4*a^3*b + 6 
*a^2*b^2 - 4*a*b^3 + b^4)*d*x)*cosh(d*x + c)^2 + 3*(15*(a^4 - 4*a^3*b + 6* 
a^2*b^2 - 4*a*b^3 + b^4)*d*x*cosh(d*x + c)^4 + 24*a^2*b^2 + 8*a*b^3 + 4*b^ 
4 + 3*(a^4 - 4*a^3*b + 6*a^2*b^2 - 4*a*b^3 + b^4)*d*x + 6*(12*a^2*b^2 + 8* 
a*b^3 + 4*b^4 + 3*(a^4 - 4*a^3*b + 6*a^2*b^2 - 4*a*b^3 + b^4)*d*x)*cosh(d* 
x + c)^2)*sinh(d*x + c)^2 + 12*((a^3*b + a*b^3)*cosh(d*x + c)^6 + 6*(a^3*b 
 + a*b^3)*cosh(d*x + c)*sinh(d*x + c)^5 + (a^3*b + a*b^3)*sinh(d*x + c)^6 
+ 3*(a^3*b + a*b^3)*cosh(d*x + c)^4 + 3*(a^3*b + a*b^3 + 5*(a^3*b + a*b^3) 
*cosh(d*x + c)^2)*sinh(d*x + c)^4 + a^3*b + a*b^3 + 4*(5*(a^3*b + a*b^3)*c 
osh(d*x + c)^3 + 3*(a^3*b + a*b^3)*cosh(d*x + c))*sinh(d*x + c)^3 + 3*(...
 

Sympy [A] (verification not implemented)

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

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

Output:

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

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 201 vs. \(2 (99) = 198\).

Time = 0.12 (sec) , antiderivative size = 201, normalized size of antiderivative = 1.99 \[ \int (a+b \tanh (c+d x))^4 \, dx=\frac {1}{3} \, 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 )} + 4 \, a 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 )} + 6 \, a^{2} b^{2} {\left (x + \frac {c}{d} - \frac {2}{d {\left (e^{\left (-2 \, d x - 2 \, c\right )} + 1\right )}}\right )} + a^{4} x + \frac {4 \, a^{3} b \log \left (\cosh \left (d x + c\right )\right )}{d} \] Input:

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

Output:

1/3*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))) + 4*a*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))) + 6*a^2*b^2*(x + c/d - 2/(d*(e^(-2*d 
*x - 2*c) + 1))) + a^4*x + 4*a^3*b*log(cosh(d*x + c))/d
 

Giac [A] (verification not implemented)

Time = 0.13 (sec) , antiderivative size = 152, normalized size of antiderivative = 1.50 \[ \int (a+b \tanh (c+d x))^4 \, dx=\frac {3 \, {\left (a^{4} - 4 \, a^{3} b + 6 \, a^{2} b^{2} - 4 \, a b^{3} + b^{4}\right )} {\left (d x + c\right )} + 12 \, {\left (a^{3} b + a b^{3}\right )} \log \left (e^{\left (2 \, d x + 2 \, c\right )} + 1\right ) + \frac {4 \, {\left (9 \, a^{2} b^{2} + 2 \, b^{4} + 3 \, {\left (3 \, a^{2} b^{2} + 2 \, a b^{3} + b^{4}\right )} e^{\left (4 \, d x + 4 \, c\right )} + 3 \, {\left (6 \, a^{2} b^{2} + 2 \, a b^{3} + b^{4}\right )} e^{\left (2 \, d x + 2 \, c\right )}\right )}}{{\left (e^{\left (2 \, d x + 2 \, c\right )} + 1\right )}^{3}}}{3 \, d} \] Input:

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

Output:

1/3*(3*(a^4 - 4*a^3*b + 6*a^2*b^2 - 4*a*b^3 + b^4)*(d*x + c) + 12*(a^3*b + 
 a*b^3)*log(e^(2*d*x + 2*c) + 1) + 4*(9*a^2*b^2 + 2*b^4 + 3*(3*a^2*b^2 + 2 
*a*b^3 + b^4)*e^(4*d*x + 4*c) + 3*(6*a^2*b^2 + 2*a*b^3 + b^4)*e^(2*d*x + 2 
*c))/(e^(2*d*x + 2*c) + 1)^3)/d
 

Mupad [B] (verification not implemented)

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

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

Output:

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

Reduce [B] (verification not implemented)

Time = 0.23 (sec) , antiderivative size = 652, normalized size of antiderivative = 6.46 \[ \int (a+b \tanh (c+d x))^4 \, dx=\frac {3 a^{4} d x +3 b^{4} d x +4 b^{4}-12 e^{6 d x +6 c} a^{3} b d x +18 e^{6 d x +6 c} a^{2} b^{2} d x -12 e^{6 d x +6 c} a \,b^{3} d x -36 e^{4 d x +4 c} a^{3} b d x +54 e^{4 d x +4 c} a^{2} b^{2} d x -36 e^{4 d x +4 c} a \,b^{3} d x -36 e^{2 d x +2 c} a^{3} b d x +54 e^{2 d x +2 c} a^{2} b^{2} d x -36 e^{2 d x +2 c} a \,b^{3} d x +12 e^{6 d x +6 c} \mathrm {log}\left (e^{2 d x +2 c}+1\right ) a^{3} b +12 e^{6 d x +6 c} \mathrm {log}\left (e^{2 d x +2 c}+1\right ) a \,b^{3}+3 e^{6 d x +6 c} a^{4} d x +3 e^{6 d x +6 c} b^{4} d x +36 e^{4 d x +4 c} \mathrm {log}\left (e^{2 d x +2 c}+1\right ) a^{3} b +9 e^{4 d x +4 c} b^{4} d x +24 a^{2} b^{2}+36 e^{4 d x +4 c} \mathrm {log}\left (e^{2 d x +2 c}+1\right ) a \,b^{3}+9 e^{4 d x +4 c} a^{4} d x +36 e^{2 d x +2 c} \mathrm {log}\left (e^{2 d x +2 c}+1\right ) a^{3} b +36 e^{2 d x +2 c} \mathrm {log}\left (e^{2 d x +2 c}+1\right ) a \,b^{3}+9 e^{2 d x +2 c} a^{4} d x +9 e^{2 d x +2 c} b^{4} d x -12 a^{3} b d x -12 a \,b^{3} d x +36 e^{2 d x +2 c} a^{2} b^{2}+12 \,\mathrm {log}\left (e^{2 d x +2 c}+1\right ) a^{3} b +12 \,\mathrm {log}\left (e^{2 d x +2 c}+1\right ) a \,b^{3}+18 a^{2} b^{2} d x -4 e^{6 d x +6 c} b^{4}-12 e^{6 d x +6 c} a^{2} b^{2}-8 e^{6 d x +6 c} a \,b^{3}-8 a \,b^{3}}{3 d \left (e^{6 d x +6 c}+3 e^{4 d x +4 c}+3 e^{2 d x +2 c}+1\right )} \] Input:

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

Output:

(12*e**(6*c + 6*d*x)*log(e**(2*c + 2*d*x) + 1)*a**3*b + 12*e**(6*c + 6*d*x 
)*log(e**(2*c + 2*d*x) + 1)*a*b**3 + 3*e**(6*c + 6*d*x)*a**4*d*x - 12*e**( 
6*c + 6*d*x)*a**3*b*d*x + 18*e**(6*c + 6*d*x)*a**2*b**2*d*x - 12*e**(6*c + 
 6*d*x)*a**2*b**2 - 12*e**(6*c + 6*d*x)*a*b**3*d*x - 8*e**(6*c + 6*d*x)*a* 
b**3 + 3*e**(6*c + 6*d*x)*b**4*d*x - 4*e**(6*c + 6*d*x)*b**4 + 36*e**(4*c 
+ 4*d*x)*log(e**(2*c + 2*d*x) + 1)*a**3*b + 36*e**(4*c + 4*d*x)*log(e**(2* 
c + 2*d*x) + 1)*a*b**3 + 9*e**(4*c + 4*d*x)*a**4*d*x - 36*e**(4*c + 4*d*x) 
*a**3*b*d*x + 54*e**(4*c + 4*d*x)*a**2*b**2*d*x - 36*e**(4*c + 4*d*x)*a*b* 
*3*d*x + 9*e**(4*c + 4*d*x)*b**4*d*x + 36*e**(2*c + 2*d*x)*log(e**(2*c + 2 
*d*x) + 1)*a**3*b + 36*e**(2*c + 2*d*x)*log(e**(2*c + 2*d*x) + 1)*a*b**3 + 
 9*e**(2*c + 2*d*x)*a**4*d*x - 36*e**(2*c + 2*d*x)*a**3*b*d*x + 54*e**(2*c 
 + 2*d*x)*a**2*b**2*d*x + 36*e**(2*c + 2*d*x)*a**2*b**2 - 36*e**(2*c + 2*d 
*x)*a*b**3*d*x + 9*e**(2*c + 2*d*x)*b**4*d*x + 12*log(e**(2*c + 2*d*x) + 1 
)*a**3*b + 12*log(e**(2*c + 2*d*x) + 1)*a*b**3 + 3*a**4*d*x - 12*a**3*b*d* 
x + 18*a**2*b**2*d*x + 24*a**2*b**2 - 12*a*b**3*d*x - 8*a*b**3 + 3*b**4*d* 
x + 4*b**4)/(3*d*(e**(6*c + 6*d*x) + 3*e**(4*c + 4*d*x) + 3*e**(2*c + 2*d* 
x) + 1))