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

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

Optimal result

Integrand size = 23, antiderivative size = 89 \[ \int \frac {\tanh ^4(c+d x)}{\left (a+b \tanh ^2(c+d x)\right )^2} \, dx=\frac {x}{(a+b)^2}-\frac {\sqrt {a} (a+3 b) \arctan \left (\frac {\sqrt {b} \tanh (c+d x)}{\sqrt {a}}\right )}{2 b^{3/2} (a+b)^2 d}+\frac {a \tanh (c+d x)}{2 b (a+b) d \left (a+b \tanh ^2(c+d x)\right )} \] Output:

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

Mathematica [A] (verified)

Time = 0.35 (sec) , antiderivative size = 90, normalized size of antiderivative = 1.01 \[ \int \frac {\tanh ^4(c+d x)}{\left (a+b \tanh ^2(c+d x)\right )^2} \, dx=\frac {2 (c+d x)-\frac {\sqrt {a} (a+3 b) \arctan \left (\frac {\sqrt {b} \tanh (c+d x)}{\sqrt {a}}\right )}{b^{3/2}}+\frac {a (a+b) \sinh (2 (c+d x))}{b (a-b+(a+b) \cosh (2 (c+d x)))}}{2 (a+b)^2 d} \] Input:

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

Output:

(2*(c + d*x) - (Sqrt[a]*(a + 3*b)*ArcTan[(Sqrt[b]*Tanh[c + d*x])/Sqrt[a]]) 
/b^(3/2) + (a*(a + b)*Sinh[2*(c + d*x)])/(b*(a - b + (a + b)*Cosh[2*(c + d 
*x)])))/(2*(a + b)^2*d)
 

Rubi [A] (verified)

Time = 0.56 (sec) , antiderivative size = 105, normalized size of antiderivative = 1.18, number of steps used = 7, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.261, Rules used = {3042, 4153, 372, 397, 218, 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 \frac {\tanh ^4(c+d x)}{\left (a+b \tanh ^2(c+d x)\right )^2} \, dx\)

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4153

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

\(\Big \downarrow \) 372

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

\(\Big \downarrow \) 397

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

\(\Big \downarrow \) 218

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

\(\Big \downarrow \) 219

\(\displaystyle \frac {\frac {a \tanh (c+d x)}{2 b (a+b) \left (a+b \tanh ^2(c+d x)\right )}-\frac {\frac {\sqrt {a} (a+3 b) \arctan \left (\frac {\sqrt {b} \tanh (c+d x)}{\sqrt {a}}\right )}{\sqrt {b} (a+b)}-\frac {2 b \text {arctanh}(\tanh (c+d x))}{a+b}}{2 b (a+b)}}{d}\)

Input:

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

Output:

(-1/2*((Sqrt[a]*(a + 3*b)*ArcTan[(Sqrt[b]*Tanh[c + d*x])/Sqrt[a]])/(Sqrt[b 
]*(a + b)) - (2*b*ArcTanh[Tanh[c + d*x]])/(a + b))/(b*(a + b)) + (a*Tanh[c 
 + d*x])/(2*b*(a + b)*(a + b*Tanh[c + d*x]^2)))/d
 

Defintions of rubi rules used

rule 218
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]/a)*ArcTan[x/R 
t[a/b, 2]], x] /; FreeQ[{a, b}, x] && PosQ[a/b]
 

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 372
Int[((e_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^2)^(p_)*((c_) + (d_.)*(x_)^2)^(q_ 
), x_Symbol] :> Simp[(-a)*e^3*(e*x)^(m - 3)*(a + b*x^2)^(p + 1)*((c + d*x^2 
)^(q + 1)/(2*b*(b*c - a*d)*(p + 1))), x] + Simp[e^4/(2*b*(b*c - a*d)*(p + 1 
))   Int[(e*x)^(m - 4)*(a + b*x^2)^(p + 1)*(c + d*x^2)^q*Simp[a*c*(m - 3) + 
 (a*d*(m + 2*q - 1) + 2*b*c*(p + 1))*x^2, x], x], x] /; FreeQ[{a, b, c, d, 
e, q}, x] && NeQ[b*c - a*d, 0] && LtQ[p, -1] && GtQ[m, 3] && IntBinomialQ[a 
, b, c, d, e, m, 2, p, q, x]
 

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

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 [A] (verified)

Time = 0.14 (sec) , antiderivative size = 104, normalized size of antiderivative = 1.17

method result size
derivativedivides \(\frac {-\frac {a \left (-\frac {\left (a +b \right ) \tanh \left (d x +c \right )}{2 b \left (a +b \tanh \left (d x +c \right )^{2}\right )}+\frac {\left (a +3 b \right ) \arctan \left (\frac {b \tanh \left (d x +c \right )}{\sqrt {a b}}\right )}{2 b \sqrt {a b}}\right )}{\left (a +b \right )^{2}}+\frac {\ln \left (1+\tanh \left (d x +c \right )\right )}{2 \left (a +b \right )^{2}}-\frac {\ln \left (-1+\tanh \left (d x +c \right )\right )}{2 \left (a +b \right )^{2}}}{d}\) \(104\)
default \(\frac {-\frac {a \left (-\frac {\left (a +b \right ) \tanh \left (d x +c \right )}{2 b \left (a +b \tanh \left (d x +c \right )^{2}\right )}+\frac {\left (a +3 b \right ) \arctan \left (\frac {b \tanh \left (d x +c \right )}{\sqrt {a b}}\right )}{2 b \sqrt {a b}}\right )}{\left (a +b \right )^{2}}+\frac {\ln \left (1+\tanh \left (d x +c \right )\right )}{2 \left (a +b \right )^{2}}-\frac {\ln \left (-1+\tanh \left (d x +c \right )\right )}{2 \left (a +b \right )^{2}}}{d}\) \(104\)
risch \(\frac {x}{a^{2}+2 a b +b^{2}}-\frac {a \left (a \,{\mathrm e}^{2 d x +2 c}-b \,{\mathrm e}^{2 d x +2 c}+a +b \right )}{d \left (a +b \right )^{2} b \left (a \,{\mathrm e}^{4 d x +4 c}+b \,{\mathrm e}^{4 d x +4 c}+2 a \,{\mathrm e}^{2 d x +2 c}-2 b \,{\mathrm e}^{2 d x +2 c}+a +b \right )}+\frac {\sqrt {-a b}\, \ln \left ({\mathrm e}^{2 d x +2 c}-\frac {-a +2 \sqrt {-a b}+b}{a +b}\right ) a}{4 b^{2} \left (a +b \right )^{2} d}+\frac {3 \sqrt {-a b}\, \ln \left ({\mathrm e}^{2 d x +2 c}-\frac {-a +2 \sqrt {-a b}+b}{a +b}\right )}{4 b \left (a +b \right )^{2} d}-\frac {\sqrt {-a b}\, \ln \left ({\mathrm e}^{2 d x +2 c}+\frac {a +2 \sqrt {-a b}-b}{a +b}\right ) a}{4 b^{2} \left (a +b \right )^{2} d}-\frac {3 \sqrt {-a b}\, \ln \left ({\mathrm e}^{2 d x +2 c}+\frac {a +2 \sqrt {-a b}-b}{a +b}\right )}{4 b \left (a +b \right )^{2} d}\) \(308\)

Input:

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

Output:

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

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 814 vs. \(2 (77) = 154\).

Time = 0.14 (sec) , antiderivative size = 1950, normalized size of antiderivative = 21.91 \[ \int \frac {\tanh ^4(c+d x)}{\left (a+b \tanh ^2(c+d x)\right )^2} \, dx=\text {Too large to display} \] Input:

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

Output:

[1/4*(4*(a*b + b^2)*d*x*cosh(d*x + c)^4 + 16*(a*b + b^2)*d*x*cosh(d*x + c) 
*sinh(d*x + c)^3 + 4*(a*b + b^2)*d*x*sinh(d*x + c)^4 + 4*(a*b + b^2)*d*x + 
 4*(2*(a*b - b^2)*d*x - a^2 + a*b)*cosh(d*x + c)^2 + 4*(6*(a*b + b^2)*d*x* 
cosh(d*x + c)^2 + 2*(a*b - b^2)*d*x - a^2 + a*b)*sinh(d*x + c)^2 + ((a^2 + 
 4*a*b + 3*b^2)*cosh(d*x + c)^4 + 4*(a^2 + 4*a*b + 3*b^2)*cosh(d*x + c)*si 
nh(d*x + c)^3 + (a^2 + 4*a*b + 3*b^2)*sinh(d*x + c)^4 + 2*(a^2 + 2*a*b - 3 
*b^2)*cosh(d*x + c)^2 + 2*(3*(a^2 + 4*a*b + 3*b^2)*cosh(d*x + c)^2 + a^2 + 
 2*a*b - 3*b^2)*sinh(d*x + c)^2 + a^2 + 4*a*b + 3*b^2 + 4*((a^2 + 4*a*b + 
3*b^2)*cosh(d*x + c)^3 + (a^2 + 2*a*b - 3*b^2)*cosh(d*x + c))*sinh(d*x + c 
))*sqrt(-a/b)*log(((a^2 + 2*a*b + b^2)*cosh(d*x + c)^4 + 4*(a^2 + 2*a*b + 
b^2)*cosh(d*x + c)*sinh(d*x + c)^3 + (a^2 + 2*a*b + b^2)*sinh(d*x + c)^4 + 
 2*(a^2 - b^2)*cosh(d*x + c)^2 + 2*(3*(a^2 + 2*a*b + b^2)*cosh(d*x + c)^2 
+ a^2 - b^2)*sinh(d*x + c)^2 + a^2 - 6*a*b + b^2 + 4*((a^2 + 2*a*b + b^2)* 
cosh(d*x + c)^3 + (a^2 - b^2)*cosh(d*x + c))*sinh(d*x + c) - 4*((a*b + b^2 
)*cosh(d*x + c)^2 + 2*(a*b + b^2)*cosh(d*x + c)*sinh(d*x + c) + (a*b + b^2 
)*sinh(d*x + c)^2 + a*b - b^2)*sqrt(-a/b))/((a + b)*cosh(d*x + c)^4 + 4*(a 
 + b)*cosh(d*x + c)*sinh(d*x + c)^3 + (a + b)*sinh(d*x + c)^4 + 2*(a - b)* 
cosh(d*x + c)^2 + 2*(3*(a + b)*cosh(d*x + c)^2 + a - b)*sinh(d*x + c)^2 + 
4*((a + b)*cosh(d*x + c)^3 + (a - b)*cosh(d*x + c))*sinh(d*x + c) + a + b) 
) - 4*a^2 - 4*a*b + 8*(2*(a*b + b^2)*d*x*cosh(d*x + c)^3 + (2*(a*b - b^...
 

Sympy [F(-1)]

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

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

Output:

Timed out
 

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 1010 vs. \(2 (77) = 154\).

Time = 0.37 (sec) , antiderivative size = 1010, normalized size of antiderivative = 11.35 \[ \int \frac {\tanh ^4(c+d x)}{\left (a+b \tanh ^2(c+d x)\right )^2} \, dx=\text {Too large to display} \] Input:

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

Output:

-1/32*(a^3 + 9*a^2*b - 9*a*b^2 - b^3)*arctan(1/2*((a + b)*e^(2*d*x + 2*c) 
+ a - b)/sqrt(a*b))/((a^3*b + 2*a^2*b^2 + a*b^3)*sqrt(a*b)*d) + 1/32*(a^3 
+ 9*a^2*b - 9*a*b^2 - b^3)*arctan(1/2*((a + b)*e^(-2*d*x - 2*c) + a - b)/s 
qrt(a*b))/((a^3*b + 2*a^2*b^2 + a*b^3)*sqrt(a*b)*d) - 1/16*(a^3 - 5*a^2*b 
- 5*a*b^2 + b^3 + (a^3 - 15*a^2*b + 15*a*b^2 - b^3)*e^(2*d*x + 2*c))/((a^4 
*b + 3*a^3*b^2 + 3*a^2*b^3 + a*b^4 + (a^4*b + 3*a^3*b^2 + 3*a^2*b^3 + a*b^ 
4)*e^(4*d*x + 4*c) + 2*(a^4*b + a^3*b^2 - a^2*b^3 - a*b^4)*e^(2*d*x + 2*c) 
)*d) + 1/16*(a^3 - 5*a^2*b - 5*a*b^2 + b^3 + (a^3 - 15*a^2*b + 15*a*b^2 - 
b^3)*e^(-2*d*x - 2*c))/((a^4*b + 3*a^3*b^2 + 3*a^2*b^3 + a*b^4 + 2*(a^4*b 
+ a^3*b^2 - a^2*b^3 - a*b^4)*e^(-2*d*x - 2*c) + (a^4*b + 3*a^3*b^2 + 3*a^2 
*b^3 + a*b^4)*e^(-4*d*x - 4*c))*d) - 1/4*(a^2 - b^2 + (a^2 - 6*a*b + b^2)* 
e^(2*d*x + 2*c))/((a^3*b + 2*a^2*b^2 + a*b^3 + (a^3*b + 2*a^2*b^2 + a*b^3) 
*e^(4*d*x + 4*c) + 2*(a^3*b - a*b^3)*e^(2*d*x + 2*c))*d) + 1/4*(a^2 - b^2 
+ (a^2 - 6*a*b + b^2)*e^(-2*d*x - 2*c))/((a^3*b + 2*a^2*b^2 + a*b^3 + 2*(a 
^3*b - a*b^3)*e^(-2*d*x - 2*c) + (a^3*b + 2*a^2*b^2 + a*b^3)*e^(-4*d*x - 4 
*c))*d) + 3/8*((a - b)*e^(-2*d*x - 2*c) + a + b)/((a^2*b + a*b^2 + 2*(a^2* 
b - a*b^2)*e^(-2*d*x - 2*c) + (a^2*b + a*b^2)*e^(-4*d*x - 4*c))*d) + 1/4*l 
og((a + b)*e^(4*d*x + 4*c) + 2*(a - b)*e^(2*d*x + 2*c) + a + b)/((a^2 + 2* 
a*b + b^2)*d) - 1/4*log(2*(a - b)*e^(-2*d*x - 2*c) + (a + b)*e^(-4*d*x - 4 
*c) + a + b)/((a^2 + 2*a*b + b^2)*d) - 1/8*(a + b)*arctan(1/2*((a + b)*...
 

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 195 vs. \(2 (77) = 154\).

Time = 0.20 (sec) , antiderivative size = 195, normalized size of antiderivative = 2.19 \[ \int \frac {\tanh ^4(c+d x)}{\left (a+b \tanh ^2(c+d x)\right )^2} \, dx=-\frac {\frac {{\left (a^{2} + 3 \, a b\right )} \arctan \left (\frac {a e^{\left (2 \, d x + 2 \, c\right )} + b e^{\left (2 \, d x + 2 \, c\right )} + a - b}{2 \, \sqrt {a b}}\right )}{{\left (a^{2} b + 2 \, a b^{2} + b^{3}\right )} \sqrt {a b}} - \frac {2 \, {\left (d x + c\right )}}{a^{2} + 2 \, a b + b^{2}} + \frac {2 \, {\left (a^{2} e^{\left (2 \, d x + 2 \, c\right )} - a b e^{\left (2 \, d x + 2 \, c\right )} + a^{2} + a b\right )}}{{\left (a^{2} b + 2 \, a b^{2} + b^{3}\right )} {\left (a e^{\left (4 \, d x + 4 \, c\right )} + b e^{\left (4 \, d x + 4 \, c\right )} + 2 \, a e^{\left (2 \, d x + 2 \, c\right )} - 2 \, b e^{\left (2 \, d x + 2 \, c\right )} + a + b\right )}}}{2 \, d} \] Input:

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

Output:

-1/2*((a^2 + 3*a*b)*arctan(1/2*(a*e^(2*d*x + 2*c) + b*e^(2*d*x + 2*c) + a 
- b)/sqrt(a*b))/((a^2*b + 2*a*b^2 + b^3)*sqrt(a*b)) - 2*(d*x + c)/(a^2 + 2 
*a*b + b^2) + 2*(a^2*e^(2*d*x + 2*c) - a*b*e^(2*d*x + 2*c) + a^2 + a*b)/(( 
a^2*b + 2*a*b^2 + b^3)*(a*e^(4*d*x + 4*c) + b*e^(4*d*x + 4*c) + 2*a*e^(2*d 
*x + 2*c) - 2*b*e^(2*d*x + 2*c) + a + b)))/d
 

Mupad [B] (verification not implemented)

Time = 3.06 (sec) , antiderivative size = 1655, normalized size of antiderivative = 18.60 \[ \int \frac {\tanh ^4(c+d x)}{\left (a+b \tanh ^2(c+d x)\right )^2} \, dx=\text {Too large to display} \] Input:

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

Output:

log(tanh(c + d*x) + 1)/(2*a^2*d + 2*b^2*d + 4*a*b*d) - log(tanh(c + d*x) - 
 1)/(2*d*(a + b)^2) - (atan((((a + 3*b)*(-a*b^3)^(1/2)*((tanh(c + d*x)*(6* 
a^3*b + a^4 + 4*b^4 + 9*a^2*b^2))/(2*(b^3*d^2 + 2*a*b^2*d^2 + a^2*b*d^2)) 
+ ((a + 3*b)*(-a*b^3)^(1/2)*((2*a*b^6*d^2 + 8*a^2*b^5*d^2 + 12*a^3*b^4*d^2 
 + 8*a^4*b^3*d^2 + 2*a^5*b^2*d^2)/(b^4*d^3 + 3*a*b^3*d^3 + a^3*b*d^3 + 3*a 
^2*b^2*d^3) - (tanh(c + d*x)*(a + 3*b)*(-a*b^3)^(1/2)*(16*b^8*d^2 + 48*a*b 
^7*d^2 + 32*a^2*b^6*d^2 - 32*a^3*b^5*d^2 - 48*a^4*b^4*d^2 - 16*a^5*b^3*d^2 
))/(8*(b^5*d + a^2*b^3*d + 2*a*b^4*d)*(b^3*d^2 + 2*a*b^2*d^2 + a^2*b*d^2)) 
))/(4*(b^5*d + a^2*b^3*d + 2*a*b^4*d)))*1i)/(4*(b^5*d + a^2*b^3*d + 2*a*b^ 
4*d)) + ((a + 3*b)*(-a*b^3)^(1/2)*((tanh(c + d*x)*(6*a^3*b + a^4 + 4*b^4 + 
 9*a^2*b^2))/(2*(b^3*d^2 + 2*a*b^2*d^2 + a^2*b*d^2)) - ((a + 3*b)*(-a*b^3) 
^(1/2)*((2*a*b^6*d^2 + 8*a^2*b^5*d^2 + 12*a^3*b^4*d^2 + 8*a^4*b^3*d^2 + 2* 
a^5*b^2*d^2)/(b^4*d^3 + 3*a*b^3*d^3 + a^3*b*d^3 + 3*a^2*b^2*d^3) + (tanh(c 
 + d*x)*(a + 3*b)*(-a*b^3)^(1/2)*(16*b^8*d^2 + 48*a*b^7*d^2 + 32*a^2*b^6*d 
^2 - 32*a^3*b^5*d^2 - 48*a^4*b^4*d^2 - 16*a^5*b^3*d^2))/(8*(b^5*d + a^2*b^ 
3*d + 2*a*b^4*d)*(b^3*d^2 + 2*a*b^2*d^2 + a^2*b*d^2))))/(4*(b^5*d + a^2*b^ 
3*d + 2*a*b^4*d)))*1i)/(4*(b^5*d + a^2*b^3*d + 2*a*b^4*d)))/((3*a*b^2 + (5 
*a^2*b)/2 + a^3/2)/(b^4*d^3 + 3*a*b^3*d^3 + a^3*b*d^3 + 3*a^2*b^2*d^3) - ( 
(a + 3*b)*(-a*b^3)^(1/2)*((tanh(c + d*x)*(6*a^3*b + a^4 + 4*b^4 + 9*a^2*b^ 
2))/(2*(b^3*d^2 + 2*a*b^2*d^2 + a^2*b*d^2)) + ((a + 3*b)*(-a*b^3)^(1/2)...
 

Reduce [B] (verification not implemented)

Time = 0.22 (sec) , antiderivative size = 228, normalized size of antiderivative = 2.56 \[ \int \frac {\tanh ^4(c+d x)}{\left (a+b \tanh ^2(c+d x)\right )^2} \, dx=\frac {-\sqrt {b}\, \sqrt {a}\, \mathit {atan} \left (\frac {\tanh \left (d x +c \right ) b}{\sqrt {b}\, \sqrt {a}}\right ) \tanh \left (d x +c \right )^{2} a b -3 \sqrt {b}\, \sqrt {a}\, \mathit {atan} \left (\frac {\tanh \left (d x +c \right ) b}{\sqrt {b}\, \sqrt {a}}\right ) \tanh \left (d x +c \right )^{2} b^{2}-\sqrt {b}\, \sqrt {a}\, \mathit {atan} \left (\frac {\tanh \left (d x +c \right ) b}{\sqrt {b}\, \sqrt {a}}\right ) a^{2}-3 \sqrt {b}\, \sqrt {a}\, \mathit {atan} \left (\frac {\tanh \left (d x +c \right ) b}{\sqrt {b}\, \sqrt {a}}\right ) a b +2 \tanh \left (d x +c \right )^{2} b^{3} d x +\tanh \left (d x +c \right ) a^{2} b +\tanh \left (d x +c \right ) a \,b^{2}+2 a \,b^{2} d x}{2 b^{2} d \left (\tanh \left (d x +c \right )^{2} a^{2} b +2 \tanh \left (d x +c \right )^{2} a \,b^{2}+\tanh \left (d x +c \right )^{2} b^{3}+a^{3}+2 a^{2} b +a \,b^{2}\right )} \] Input:

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

Output:

( - sqrt(b)*sqrt(a)*atan((tanh(c + d*x)*b)/(sqrt(b)*sqrt(a)))*tanh(c + d*x 
)**2*a*b - 3*sqrt(b)*sqrt(a)*atan((tanh(c + d*x)*b)/(sqrt(b)*sqrt(a)))*tan 
h(c + d*x)**2*b**2 - sqrt(b)*sqrt(a)*atan((tanh(c + d*x)*b)/(sqrt(b)*sqrt( 
a)))*a**2 - 3*sqrt(b)*sqrt(a)*atan((tanh(c + d*x)*b)/(sqrt(b)*sqrt(a)))*a* 
b + 2*tanh(c + d*x)**2*b**3*d*x + tanh(c + d*x)*a**2*b + tanh(c + d*x)*a*b 
**2 + 2*a*b**2*d*x)/(2*b**2*d*(tanh(c + d*x)**2*a**2*b + 2*tanh(c + d*x)** 
2*a*b**2 + tanh(c + d*x)**2*b**3 + a**3 + 2*a**2*b + a*b**2))