\(\int \frac {1}{(a+b \tanh (c+d x))^4} \, dx\) [64]

Optimal result
Mathematica [A] (verified)
Rubi [A] (verified)
Maple [A] (verified)
Fricas [B] (verification not implemented)
Sympy [B] (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 = 169 \[ \int \frac {1}{(a+b \tanh (c+d x))^4} \, dx=\frac {\left (a^4+6 a^2 b^2+b^4\right ) x}{\left (a^2-b^2\right )^4}-\frac {4 a b \left (a^2+b^2\right ) \log (a \cosh (c+d x)+b \sinh (c+d x))}{\left (a^2-b^2\right )^4 d}+\frac {b}{3 \left (a^2-b^2\right ) d (a+b \tanh (c+d x))^3}+\frac {a b}{\left (a^2-b^2\right )^2 d (a+b \tanh (c+d x))^2}+\frac {b \left (3 a^2+b^2\right )}{\left (a^2-b^2\right )^3 d (a+b \tanh (c+d x))} \] Output:

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

Mathematica [A] (verified)

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

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

Output:

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

Rubi [A] (verified)

Time = 1.00 (sec) , antiderivative size = 208, normalized size of antiderivative = 1.23, number of steps used = 11, number of rules used = 11, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.917, Rules used = {3042, 3964, 3042, 4012, 3042, 4012, 3042, 4014, 26, 3042, 4013}

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 \frac {1}{(a+b \tanh (c+d x))^4} \, dx\)

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 3964

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4012

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4012

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4014

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

\(\Big \downarrow \) 26

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4013

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

Input:

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

Output:

b/(3*(a^2 - b^2)*d*(a + b*Tanh[c + d*x])^3) + ((a*b)/((a^2 - b^2)*d*(a + b 
*Tanh[c + d*x])^2) + ((((a^4 + 6*a^2*b^2 + b^4)*x)/(a^2 - b^2) - (4*a*b*(a 
^2 + b^2)*Log[a*Cosh[c + d*x] + b*Sinh[c + d*x]])/((a^2 - b^2)*d))/(a^2 - 
b^2) + (b*(3*a^2 + b^2))/((a^2 - b^2)*d*(a + b*Tanh[c + d*x])))/(a^2 - b^2 
))/(a^2 - b^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 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

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

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

rule 4013
Int[((c_) + (d_.)*tan[(e_.) + (f_.)*(x_)])/((a_) + (b_.)*tan[(e_.) + (f_.)* 
(x_)]), x_Symbol] :> Simp[(c/(b*f))*Log[RemoveContent[a*Cos[e + f*x] + b*Si 
n[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] && EqQ[a*c + b*d, 0]
 

rule 4014
Int[((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])/((a_.) + (b_.)*tan[(e_.) + (f_. 
)*(x_)]), x_Symbol] :> Simp[(a*c + b*d)*(x/(a^2 + b^2)), x] + Simp[(b*c - a 
*d)/(a^2 + b^2)   Int[(b - a*Tan[e + f*x])/(a + b*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] && N 
eQ[a*c + b*d, 0]
 
Maple [A] (verified)

Time = 0.35 (sec) , antiderivative size = 163, normalized size of antiderivative = 0.96

method result size
derivativedivides \(\frac {\frac {b}{3 \left (a -b \right ) \left (a +b \right ) \left (a +b \tanh \left (d x +c \right )\right )^{3}}+\frac {a b}{\left (a +b \right )^{2} \left (a -b \right )^{2} \left (a +b \tanh \left (d x +c \right )\right )^{2}}+\frac {b \left (3 a^{2}+b^{2}\right )}{\left (a +b \right )^{3} \left (a -b \right )^{3} \left (a +b \tanh \left (d x +c \right )\right )}-\frac {4 b a \left (a^{2}+b^{2}\right ) \ln \left (a +b \tanh \left (d x +c \right )\right )}{\left (a +b \right )^{4} \left (a -b \right )^{4}}+\frac {\ln \left (\tanh \left (d x +c \right )+1\right )}{2 \left (a -b \right )^{4}}-\frac {\ln \left (\tanh \left (d x +c \right )-1\right )}{2 \left (a +b \right )^{4}}}{d}\) \(163\)
default \(\frac {\frac {b}{3 \left (a -b \right ) \left (a +b \right ) \left (a +b \tanh \left (d x +c \right )\right )^{3}}+\frac {a b}{\left (a +b \right )^{2} \left (a -b \right )^{2} \left (a +b \tanh \left (d x +c \right )\right )^{2}}+\frac {b \left (3 a^{2}+b^{2}\right )}{\left (a +b \right )^{3} \left (a -b \right )^{3} \left (a +b \tanh \left (d x +c \right )\right )}-\frac {4 b a \left (a^{2}+b^{2}\right ) \ln \left (a +b \tanh \left (d x +c \right )\right )}{\left (a +b \right )^{4} \left (a -b \right )^{4}}+\frac {\ln \left (\tanh \left (d x +c \right )+1\right )}{2 \left (a -b \right )^{4}}-\frac {\ln \left (\tanh \left (d x +c \right )-1\right )}{2 \left (a +b \right )^{4}}}{d}\) \(163\)
risch \(\frac {x}{a^{4}+4 a^{3} b +6 a^{2} b^{2}+4 a \,b^{3}+b^{4}}+\frac {8 b \,a^{3} x}{a^{8}-4 a^{6} b^{2}+6 a^{4} b^{4}-4 a^{2} b^{6}+b^{8}}+\frac {8 b^{3} a x}{a^{8}-4 a^{6} b^{2}+6 a^{4} b^{4}-4 a^{2} b^{6}+b^{8}}+\frac {8 b \,a^{3} c}{d \left (a^{8}-4 a^{6} b^{2}+6 a^{4} b^{4}-4 a^{2} b^{6}+b^{8}\right )}+\frac {8 b^{3} a c}{d \left (a^{8}-4 a^{6} b^{2}+6 a^{4} b^{4}-4 a^{2} b^{6}+b^{8}\right )}+\frac {4 b^{2} \left (9 \,{\mathrm e}^{4 d x +4 c} a^{4}+12 \,{\mathrm e}^{4 d x +4 c} a^{3} b +3 b^{4} {\mathrm e}^{4 d x +4 c}+18 a^{4} {\mathrm e}^{2 d x +2 c}-6 \,{\mathrm e}^{2 d x +2 c} a^{3} b -15 \,{\mathrm e}^{2 d x +2 c} a^{2} b^{2}+6 a \,b^{3} {\mathrm e}^{2 d x +2 c}-3 b^{4} {\mathrm e}^{2 d x +2 c}+9 a^{4}-18 a^{3} b +11 a^{2} b^{2}-4 a \,b^{3}+2 b^{4}\right )}{3 \left (a^{4}+4 a^{3} b +6 a^{2} b^{2}+4 a \,b^{3}+b^{4}\right ) \left ({\mathrm e}^{2 d x +2 c} a +{\mathrm e}^{2 d x +2 c} b +a -b \right )^{3} d \left (a -b \right )^{3}}-\frac {4 b \,a^{3} \ln \left ({\mathrm e}^{2 d x +2 c}+\frac {a -b}{a +b}\right )}{d \left (a^{8}-4 a^{6} b^{2}+6 a^{4} b^{4}-4 a^{2} b^{6}+b^{8}\right )}-\frac {4 b^{3} a \ln \left ({\mathrm e}^{2 d x +2 c}+\frac {a -b}{a +b}\right )}{d \left (a^{8}-4 a^{6} b^{2}+6 a^{4} b^{4}-4 a^{2} b^{6}+b^{8}\right )}\) \(549\)
parallelrisch \(-\frac {-3 a^{9} b d x -12 a^{8} b^{2} d x -18 a^{7} b^{3} d x -12 a^{6} b^{4} d x -3 a^{5} b^{5} d x +9 a^{6} b^{4}-4 a^{4} b^{6}+a^{2} b^{8}-6 a^{8} b^{2}-3 x \tanh \left (d x +c \right )^{3} a^{6} b^{4} d -12 x \tanh \left (d x +c \right )^{3} a^{5} b^{5} d -18 x \tanh \left (d x +c \right )^{3} a^{4} b^{6} d -12 x \tanh \left (d x +c \right )^{3} a^{3} b^{7} d -3 x \tanh \left (d x +c \right )^{3} a^{2} b^{8} d -9 x \tanh \left (d x +c \right )^{2} a^{7} b^{3} d -36 x \tanh \left (d x +c \right )^{2} a^{6} b^{4} d -54 x \tanh \left (d x +c \right )^{2} a^{5} b^{5} d -36 x \tanh \left (d x +c \right )^{2} a^{4} b^{6} d -9 x \tanh \left (d x +c \right )^{2} a^{3} b^{7} d -9 x \tanh \left (d x +c \right ) a^{8} b^{2} d -36 x \tanh \left (d x +c \right ) a^{7} b^{3} d -54 x \tanh \left (d x +c \right ) a^{6} b^{4} d -36 x \tanh \left (d x +c \right ) a^{5} b^{5} d -9 x \tanh \left (d x +c \right ) a^{4} b^{6} d +12 \ln \left (a +b \tanh \left (d x +c \right )\right ) \tanh \left (d x +c \right )^{3} a^{5} b^{5}+12 \ln \left (a +b \tanh \left (d x +c \right )\right ) \tanh \left (d x +c \right )^{3} a^{3} b^{7}-36 \ln \left (1-\tanh \left (d x +c \right )\right ) \tanh \left (d x +c \right )^{2} a^{6} b^{4}-36 \ln \left (1-\tanh \left (d x +c \right )\right ) \tanh \left (d x +c \right )^{2} a^{4} b^{6}+36 \ln \left (a +b \tanh \left (d x +c \right )\right ) \tanh \left (d x +c \right )^{2} a^{6} b^{4}+36 \ln \left (a +b \tanh \left (d x +c \right )\right ) \tanh \left (d x +c \right )^{2} a^{4} b^{6}-36 \ln \left (1-\tanh \left (d x +c \right )\right ) \tanh \left (d x +c \right ) a^{7} b^{3}-36 \ln \left (1-\tanh \left (d x +c \right )\right ) \tanh \left (d x +c \right ) a^{5} b^{5}+36 \ln \left (a +b \tanh \left (d x +c \right )\right ) \tanh \left (d x +c \right ) a^{7} b^{3}+36 \ln \left (a +b \tanh \left (d x +c \right )\right ) \tanh \left (d x +c \right ) a^{5} b^{5}-12 \ln \left (1-\tanh \left (d x +c \right )\right ) \tanh \left (d x +c \right )^{3} a^{5} b^{5}-12 \ln \left (1-\tanh \left (d x +c \right )\right ) \tanh \left (d x +c \right )^{3} a^{3} b^{7}-12 \ln \left (1-\tanh \left (d x +c \right )\right ) a^{6} b^{4}+12 \ln \left (a +b \tanh \left (d x +c \right )\right ) a^{8} b^{2}+12 \ln \left (a +b \tanh \left (d x +c \right )\right ) a^{6} b^{4}+7 \tanh \left (d x +c \right )^{3} a^{5} b^{5}-6 \tanh \left (d x +c \right )^{3} a^{3} b^{7}-\tanh \left (d x +c \right )^{3} a \,b^{9}+12 \tanh \left (d x +c \right )^{2} a^{6} b^{4}-12 \tanh \left (d x +c \right )^{2} a^{4} b^{6}-12 \ln \left (1-\tanh \left (d x +c \right )\right ) a^{8} b^{2}}{3 \left (a^{8}-4 a^{6} b^{2}+6 a^{4} b^{4}-4 a^{2} b^{6}+b^{8}\right ) \left (a +b \tanh \left (d x +c \right )\right )^{3} d \,a^{2} b}\) \(867\)

Input:

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

Output:

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

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 3693 vs. \(2 (167) = 334\).

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

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

Output:

Too large to include
 

Sympy [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 16643 vs. \(2 (144) = 288\).

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

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

Output:

Piecewise((zoo*x/tanh(c)**4, Eq(a, 0) & Eq(b, 0) & Eq(d, 0)), (x/a**4, Eq( 
b, 0)), (3*d*x*tanh(c + d*x)**4/(48*b**4*d*tanh(c + d*x)**4 - 192*b**4*d*t 
anh(c + d*x)**3 + 288*b**4*d*tanh(c + d*x)**2 - 192*b**4*d*tanh(c + d*x) + 
 48*b**4*d) - 12*d*x*tanh(c + d*x)**3/(48*b**4*d*tanh(c + d*x)**4 - 192*b* 
*4*d*tanh(c + d*x)**3 + 288*b**4*d*tanh(c + d*x)**2 - 192*b**4*d*tanh(c + 
d*x) + 48*b**4*d) + 18*d*x*tanh(c + d*x)**2/(48*b**4*d*tanh(c + d*x)**4 - 
192*b**4*d*tanh(c + d*x)**3 + 288*b**4*d*tanh(c + d*x)**2 - 192*b**4*d*tan 
h(c + d*x) + 48*b**4*d) - 12*d*x*tanh(c + d*x)/(48*b**4*d*tanh(c + d*x)**4 
 - 192*b**4*d*tanh(c + d*x)**3 + 288*b**4*d*tanh(c + d*x)**2 - 192*b**4*d* 
tanh(c + d*x) + 48*b**4*d) + 3*d*x/(48*b**4*d*tanh(c + d*x)**4 - 192*b**4* 
d*tanh(c + d*x)**3 + 288*b**4*d*tanh(c + d*x)**2 - 192*b**4*d*tanh(c + d*x 
) + 48*b**4*d) - 3*tanh(c + d*x)**3/(48*b**4*d*tanh(c + d*x)**4 - 192*b**4 
*d*tanh(c + d*x)**3 + 288*b**4*d*tanh(c + d*x)**2 - 192*b**4*d*tanh(c + d* 
x) + 48*b**4*d) + 12*tanh(c + d*x)**2/(48*b**4*d*tanh(c + d*x)**4 - 192*b* 
*4*d*tanh(c + d*x)**3 + 288*b**4*d*tanh(c + d*x)**2 - 192*b**4*d*tanh(c + 
d*x) + 48*b**4*d) - 19*tanh(c + d*x)/(48*b**4*d*tanh(c + d*x)**4 - 192*b** 
4*d*tanh(c + d*x)**3 + 288*b**4*d*tanh(c + d*x)**2 - 192*b**4*d*tanh(c + d 
*x) + 48*b**4*d) + 16/(48*b**4*d*tanh(c + d*x)**4 - 192*b**4*d*tanh(c + d* 
x)**3 + 288*b**4*d*tanh(c + d*x)**2 - 192*b**4*d*tanh(c + d*x) + 48*b**4*d 
), Eq(a, -b)), (3*d*x*tanh(c + d*x)**4/(48*b**4*d*tanh(c + d*x)**4 + 19...
 

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 525 vs. \(2 (167) = 334\).

Time = 0.08 (sec) , antiderivative size = 525, normalized size of antiderivative = 3.11 \[ \int \frac {1}{(a+b \tanh (c+d x))^4} \, dx=-\frac {4 \, {\left (a^{3} b + a b^{3}\right )} \log \left (-{\left (a - b\right )} e^{\left (-2 \, d x - 2 \, c\right )} - a - b\right )}{{\left (a^{8} - 4 \, a^{6} b^{2} + 6 \, a^{4} b^{4} - 4 \, a^{2} b^{6} + b^{8}\right )} d} - \frac {4 \, {\left (9 \, a^{4} b^{2} + 18 \, a^{3} b^{3} + 11 \, a^{2} b^{4} + 4 \, a b^{5} + 2 \, b^{6} + 3 \, {\left (6 \, a^{4} b^{2} + 2 \, a^{3} b^{3} - 5 \, a^{2} b^{4} - 2 \, a b^{5} - b^{6}\right )} e^{\left (-2 \, d x - 2 \, c\right )} + 3 \, {\left (3 \, a^{4} b^{2} - 4 \, a^{3} b^{3} + b^{6}\right )} e^{\left (-4 \, d x - 4 \, c\right )}\right )}}{3 \, {\left (a^{10} + 2 \, a^{9} b - 3 \, a^{8} b^{2} - 8 \, a^{7} b^{3} + 2 \, a^{6} b^{4} + 12 \, a^{5} b^{5} + 2 \, a^{4} b^{6} - 8 \, a^{3} b^{7} - 3 \, a^{2} b^{8} + 2 \, a b^{9} + b^{10} + 3 \, {\left (a^{10} - 5 \, a^{8} b^{2} + 10 \, a^{6} b^{4} - 10 \, a^{4} b^{6} + 5 \, a^{2} b^{8} - b^{10}\right )} e^{\left (-2 \, d x - 2 \, c\right )} + 3 \, {\left (a^{10} - 2 \, a^{9} b - 3 \, a^{8} b^{2} + 8 \, a^{7} b^{3} + 2 \, a^{6} b^{4} - 12 \, a^{5} b^{5} + 2 \, a^{4} b^{6} + 8 \, a^{3} b^{7} - 3 \, a^{2} b^{8} - 2 \, a b^{9} + b^{10}\right )} e^{\left (-4 \, d x - 4 \, c\right )} + {\left (a^{10} - 4 \, a^{9} b + 3 \, a^{8} b^{2} + 8 \, a^{7} b^{3} - 14 \, a^{6} b^{4} + 14 \, a^{4} b^{6} - 8 \, a^{3} b^{7} - 3 \, a^{2} b^{8} + 4 \, a b^{9} - b^{10}\right )} e^{\left (-6 \, d x - 6 \, c\right )}\right )} d} + \frac {d x + c}{{\left (a^{4} + 4 \, a^{3} b + 6 \, a^{2} b^{2} + 4 \, a b^{3} + b^{4}\right )} d} \] Input:

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

Output:

-4*(a^3*b + a*b^3)*log(-(a - b)*e^(-2*d*x - 2*c) - a - b)/((a^8 - 4*a^6*b^ 
2 + 6*a^4*b^4 - 4*a^2*b^6 + b^8)*d) - 4/3*(9*a^4*b^2 + 18*a^3*b^3 + 11*a^2 
*b^4 + 4*a*b^5 + 2*b^6 + 3*(6*a^4*b^2 + 2*a^3*b^3 - 5*a^2*b^4 - 2*a*b^5 - 
b^6)*e^(-2*d*x - 2*c) + 3*(3*a^4*b^2 - 4*a^3*b^3 + b^6)*e^(-4*d*x - 4*c))/ 
((a^10 + 2*a^9*b - 3*a^8*b^2 - 8*a^7*b^3 + 2*a^6*b^4 + 12*a^5*b^5 + 2*a^4* 
b^6 - 8*a^3*b^7 - 3*a^2*b^8 + 2*a*b^9 + b^10 + 3*(a^10 - 5*a^8*b^2 + 10*a^ 
6*b^4 - 10*a^4*b^6 + 5*a^2*b^8 - b^10)*e^(-2*d*x - 2*c) + 3*(a^10 - 2*a^9* 
b - 3*a^8*b^2 + 8*a^7*b^3 + 2*a^6*b^4 - 12*a^5*b^5 + 2*a^4*b^6 + 8*a^3*b^7 
 - 3*a^2*b^8 - 2*a*b^9 + b^10)*e^(-4*d*x - 4*c) + (a^10 - 4*a^9*b + 3*a^8* 
b^2 + 8*a^7*b^3 - 14*a^6*b^4 + 14*a^4*b^6 - 8*a^3*b^7 - 3*a^2*b^8 + 4*a*b^ 
9 - b^10)*e^(-6*d*x - 6*c))*d) + (d*x + c)/((a^4 + 4*a^3*b + 6*a^2*b^2 + 4 
*a*b^3 + b^4)*d)
 

Giac [A] (verification not implemented)

Time = 0.16 (sec) , antiderivative size = 305, normalized size of antiderivative = 1.80 \[ \int \frac {1}{(a+b \tanh (c+d x))^4} \, dx=-\frac {\frac {12 \, {\left (a^{3} b + a b^{3}\right )} \log \left ({\left | -a e^{\left (2 \, d x + 2 \, c\right )} - b e^{\left (2 \, d x + 2 \, c\right )} - a + b \right |}\right )}{a^{8} - 4 \, a^{6} b^{2} + 6 \, a^{4} b^{4} - 4 \, a^{2} b^{6} + b^{8}} - \frac {3 \, {\left (d x + c\right )}}{a^{4} - 4 \, a^{3} b + 6 \, a^{2} b^{2} - 4 \, a b^{3} + b^{4}} - \frac {4 \, {\left (3 \, {\left (3 \, a^{4} b^{2} - 2 \, a^{3} b^{3} - 2 \, a^{2} b^{4} + 2 \, a b^{5} - b^{6}\right )} e^{\left (4 \, d x + 4 \, c\right )} + 3 \, {\left (6 \, a^{4} b^{2} - 14 \, a^{3} b^{3} + 11 \, a^{2} b^{4} - 4 \, a b^{5} + b^{6}\right )} e^{\left (2 \, d x + 2 \, c\right )} + \frac {9 \, a^{5} b^{2} - 27 \, a^{4} b^{3} + 29 \, a^{3} b^{4} - 15 \, a^{2} b^{5} + 6 \, a b^{6} - 2 \, b^{7}}{a + b}\right )}}{{\left (a e^{\left (2 \, d x + 2 \, c\right )} + b e^{\left (2 \, d x + 2 \, c\right )} + a - b\right )}^{3} {\left (a + b\right )}^{3} {\left (a - b\right )}^{4}}}{3 \, d} \] Input:

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

Output:

-1/3*(12*(a^3*b + a*b^3)*log(abs(-a*e^(2*d*x + 2*c) - b*e^(2*d*x + 2*c) - 
a + b))/(a^8 - 4*a^6*b^2 + 6*a^4*b^4 - 4*a^2*b^6 + b^8) - 3*(d*x + c)/(a^4 
 - 4*a^3*b + 6*a^2*b^2 - 4*a*b^3 + b^4) - 4*(3*(3*a^4*b^2 - 2*a^3*b^3 - 2* 
a^2*b^4 + 2*a*b^5 - b^6)*e^(4*d*x + 4*c) + 3*(6*a^4*b^2 - 14*a^3*b^3 + 11* 
a^2*b^4 - 4*a*b^5 + b^6)*e^(2*d*x + 2*c) + (9*a^5*b^2 - 27*a^4*b^3 + 29*a^ 
3*b^4 - 15*a^2*b^5 + 6*a*b^6 - 2*b^7)/(a + b))/((a*e^(2*d*x + 2*c) + b*e^( 
2*d*x + 2*c) + a - b)^3*(a + b)^3*(a - b)^4))/d
 

Mupad [B] (verification not implemented)

Time = 3.98 (sec) , antiderivative size = 452, normalized size of antiderivative = 2.67 \[ \int \frac {1}{(a+b \tanh (c+d x))^4} \, dx=\frac {\ln \left (\mathrm {tanh}\left (c+d\,x\right )+1\right )}{2\,d\,a^4-8\,d\,a^3\,b+12\,d\,a^2\,b^2-8\,d\,a\,b^3+2\,d\,b^4}-\frac {\frac {\mathrm {tanh}\left (c+d\,x\right )\,\left (6\,a^4\,b^2-3\,a^2\,b^4+b^6\right )}{a\,d\,\left (a^6-3\,a^4\,b^2+3\,a^2\,b^4-b^6\right )}+\frac {{\mathrm {tanh}\left (c+d\,x\right )}^2\,\left (10\,a^4\,b^3-3\,a^2\,b^5+b^7\right )}{a^2\,d\,\left (a^3-3\,a^2\,b+3\,a\,b^2-b^3\right )\,\left (a^3+3\,a^2\,b+3\,a\,b^2+b^3\right )}+\frac {{\mathrm {tanh}\left (c+d\,x\right )}^3\,\left (\frac {13\,a^4\,b^4}{3}-\frac {2\,a^2\,b^6}{3}+\frac {b^8}{3}\right )}{a^3\,d\,\left (a^3-3\,a^2\,b+3\,a\,b^2-b^3\right )\,\left (a^3+3\,a^2\,b+3\,a\,b^2+b^3\right )}}{a^3+3\,a^2\,b\,\mathrm {tanh}\left (c+d\,x\right )+3\,a\,b^2\,{\mathrm {tanh}\left (c+d\,x\right )}^2+b^3\,{\mathrm {tanh}\left (c+d\,x\right )}^3}-\frac {\ln \left (1-\mathrm {tanh}\left (c+d\,x\right )\right )}{2\,d\,a^4+8\,d\,a^3\,b+12\,d\,a^2\,b^2+8\,d\,a\,b^3+2\,d\,b^4}-\frac {4\,\ln \left (a+b\,\mathrm {tanh}\left (c+d\,x\right )\right )\,\left (a^3\,b+a\,b^3\right )}{d\,\left (a^4-4\,a^3\,b+6\,a^2\,b^2-4\,a\,b^3+b^4\right )\,\left (a^4+4\,a^3\,b+6\,a^2\,b^2+4\,a\,b^3+b^4\right )} \] Input:

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

Output:

log(tanh(c + d*x) + 1)/(2*a^4*d + 2*b^4*d + 12*a^2*b^2*d - 8*a*b^3*d - 8*a 
^3*b*d) - ((tanh(c + d*x)*(b^6 - 3*a^2*b^4 + 6*a^4*b^2))/(a*d*(a^6 - b^6 + 
 3*a^2*b^4 - 3*a^4*b^2)) + (tanh(c + d*x)^2*(b^7 - 3*a^2*b^5 + 10*a^4*b^3) 
)/(a^2*d*(3*a*b^2 - 3*a^2*b + a^3 - b^3)*(3*a*b^2 + 3*a^2*b + a^3 + b^3)) 
+ (tanh(c + d*x)^3*(b^8/3 - (2*a^2*b^6)/3 + (13*a^4*b^4)/3))/(a^3*d*(3*a*b 
^2 - 3*a^2*b + a^3 - b^3)*(3*a*b^2 + 3*a^2*b + a^3 + b^3)))/(a^3 + b^3*tan 
h(c + d*x)^3 + 3*a*b^2*tanh(c + d*x)^2 + 3*a^2*b*tanh(c + d*x)) - log(1 - 
tanh(c + d*x))/(2*a^4*d + 2*b^4*d + 12*a^2*b^2*d + 8*a*b^3*d + 8*a^3*b*d) 
- (4*log(a + b*tanh(c + d*x))*(a*b^3 + a^3*b))/(d*(a^4 - 4*a^3*b - 4*a*b^3 
 + b^4 + 6*a^2*b^2)*(4*a*b^3 + 4*a^3*b + a^4 + b^4 + 6*a^2*b^2))
 

Reduce [B] (verification not implemented)

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

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

Output:

( - 12*e**(6*c + 6*d*x)*log(e**(2*c + 2*d*x)*a + e**(2*c + 2*d*x)*b + a - 
b)*a**6*b - 36*e**(6*c + 6*d*x)*log(e**(2*c + 2*d*x)*a + e**(2*c + 2*d*x)* 
b + a - b)*a**5*b**2 - 48*e**(6*c + 6*d*x)*log(e**(2*c + 2*d*x)*a + e**(2* 
c + 2*d*x)*b + a - b)*a**4*b**3 - 48*e**(6*c + 6*d*x)*log(e**(2*c + 2*d*x) 
*a + e**(2*c + 2*d*x)*b + a - b)*a**3*b**4 - 36*e**(6*c + 6*d*x)*log(e**(2 
*c + 2*d*x)*a + e**(2*c + 2*d*x)*b + a - b)*a**2*b**5 - 12*e**(6*c + 6*d*x 
)*log(e**(2*c + 2*d*x)*a + e**(2*c + 2*d*x)*b + a - b)*a*b**6 + 3*e**(6*c 
+ 6*d*x)*a**7*d*x + 21*e**(6*c + 6*d*x)*a**6*b*d*x + 63*e**(6*c + 6*d*x)*a 
**5*b**2*d*x - 12*e**(6*c + 6*d*x)*a**5*b**2 + 105*e**(6*c + 6*d*x)*a**4*b 
**3*d*x - 28*e**(6*c + 6*d*x)*a**4*b**3 + 105*e**(6*c + 6*d*x)*a**3*b**4*d 
*x - 16*e**(6*c + 6*d*x)*a**3*b**4 + 63*e**(6*c + 6*d*x)*a**2*b**5*d*x + 2 
1*e**(6*c + 6*d*x)*a*b**6*d*x - 4*e**(6*c + 6*d*x)*a*b**6 + 3*e**(6*c + 6* 
d*x)*b**7*d*x - 4*e**(6*c + 6*d*x)*b**7 - 36*e**(4*c + 4*d*x)*log(e**(2*c 
+ 2*d*x)*a + e**(2*c + 2*d*x)*b + a - b)*a**6*b - 36*e**(4*c + 4*d*x)*log( 
e**(2*c + 2*d*x)*a + e**(2*c + 2*d*x)*b + a - b)*a**5*b**2 + 36*e**(4*c + 
4*d*x)*log(e**(2*c + 2*d*x)*a + e**(2*c + 2*d*x)*b + a - b)*a**2*b**5 + 36 
*e**(4*c + 4*d*x)*log(e**(2*c + 2*d*x)*a + e**(2*c + 2*d*x)*b + a - b)*a*b 
**6 + 9*e**(4*c + 4*d*x)*a**7*d*x + 45*e**(4*c + 4*d*x)*a**6*b*d*x + 81*e* 
*(4*c + 4*d*x)*a**5*b**2*d*x + 45*e**(4*c + 4*d*x)*a**4*b**3*d*x - 45*e**( 
4*c + 4*d*x)*a**3*b**4*d*x - 81*e**(4*c + 4*d*x)*a**2*b**5*d*x - 45*e**...