\(\int \frac {\tanh ^2(c+d x)}{(a+b \text {sech}^2(c+d x))^3} \, dx\) [162]

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

Optimal result

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

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

Mathematica [B] (warning: unable to verify)

Leaf count is larger than twice the leaf count of optimal. \(1317\) vs. \(2(139)=278\).

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

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

Output:

((a + 2*b + a*Cosh[2*(c + d*x)])^3*Sech[c + d*x]^6*((6*a*(a + 2*b)*ArcTanh 
[(Sqrt[b]*Tanh[c + d*x])/Sqrt[a + b]])/(a + b)^(5/2) - (4*(3*a^2 + 8*a*b + 
 8*b^2)*ArcTanh[(Sqrt[b]*Tanh[c + d*x])/Sqrt[a + b]])/(a + b)^(5/2) + (4*a 
*Sqrt[b]*(3*a^2 + 16*a*b + 16*b^2 + 3*a*(a + 2*b)*Cosh[2*(c + d*x)])*Sinh[ 
2*(c + d*x)])/((a + b)^2*(a + 2*b + a*Cosh[2*(c + d*x)])^2) - (2*Sqrt[b]*( 
3*a^3 + 14*a^2*b + 24*a*b^2 + 16*b^3 + a*(3*a^2 + 4*a*b + 4*b^2)*Cosh[2*(c 
 + d*x)])*Sinh[2*(c + d*x)])/((a + b)^2*(a + 2*b + a*Cosh[2*(c + d*x)])^2) 
 + (Sqrt[b]*((-2*(3*a^5 - 10*a^4*b + 80*a^3*b^2 + 480*a^2*b^3 + 640*a*b^4 
+ 256*b^5)*ArcTanh[(Sech[d*x]*(Cosh[2*c] - Sinh[2*c])*((a + 2*b)*Sinh[d*x] 
 - a*Sinh[2*c + d*x]))/(2*Sqrt[a + b]*Sqrt[b*(Cosh[c] - Sinh[c])^4])]*(Cos 
h[2*c] - Sinh[2*c]))/(Sqrt[a + b]*Sqrt[b*(Cosh[c] - Sinh[c])^4]) + (Sech[2 
*c]*(256*b^2*(a + b)^2*(3*a^2 + 8*a*b + 8*b^2)*d*x*Cosh[2*c] + 512*a*b^2*( 
a + b)^2*(a + 2*b)*d*x*Cosh[2*d*x] + 128*a^4*b^2*d*x*Cosh[2*(c + 2*d*x)] + 
 256*a^3*b^3*d*x*Cosh[2*(c + 2*d*x)] + 128*a^2*b^4*d*x*Cosh[2*(c + 2*d*x)] 
 + 512*a^4*b^2*d*x*Cosh[4*c + 2*d*x] + 2048*a^3*b^3*d*x*Cosh[4*c + 2*d*x] 
+ 2560*a^2*b^4*d*x*Cosh[4*c + 2*d*x] + 1024*a*b^5*d*x*Cosh[4*c + 2*d*x] + 
128*a^4*b^2*d*x*Cosh[6*c + 4*d*x] + 256*a^3*b^3*d*x*Cosh[6*c + 4*d*x] + 12 
8*a^2*b^4*d*x*Cosh[6*c + 4*d*x] - 9*a^6*Sinh[2*c] + 12*a^5*b*Sinh[2*c] + 6 
84*a^4*b^2*Sinh[2*c] + 2880*a^3*b^3*Sinh[2*c] + 5280*a^2*b^4*Sinh[2*c] + 4 
608*a*b^5*Sinh[2*c] + 1536*b^6*Sinh[2*c] + 9*a^6*Sinh[2*d*x] - 14*a^5*b...
 

Rubi [A] (verified)

Time = 0.42 (sec) , antiderivative size = 164, normalized size of antiderivative = 1.18, number of steps used = 12, number of rules used = 11, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.478, Rules used = {3042, 25, 4629, 25, 2075, 373, 402, 25, 397, 219, 221}

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 ^2(c+d x)}{\left (a+b \text {sech}^2(c+d x)\right )^3} \, dx\)

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 25

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

\(\Big \downarrow \) 4629

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

\(\Big \downarrow \) 25

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

\(\Big \downarrow \) 2075

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

\(\Big \downarrow \) 373

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

\(\Big \downarrow \) 402

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

\(\Big \downarrow \) 25

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

\(\Big \downarrow \) 397

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

\(\Big \downarrow \) 219

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

\(\Big \downarrow \) 221

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

Input:

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

Output:

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

Defintions of rubi rules used

rule 25
Int[-(Fx_), x_Symbol] :> Simp[Identity[-1]   Int[Fx, x], x]
 

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 221
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[-a/b, 2]/a)*ArcTanh[x 
/Rt[-a/b, 2]], x] /; FreeQ[{a, b}, x] && NegQ[a/b]
 

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

rule 2075
Int[(u_)^(p_.)*(v_)^(q_.)*((e_.)*(x_))^(m_.), x_Symbol] :> Int[(e*x)^m*Expa 
ndToSum[u, x]^p*ExpandToSum[v, x]^q, x] /; FreeQ[{e, m, p, q}, x] && Binomi 
alQ[{u, v}, x] && EqQ[BinomialDegree[u, x] - BinomialDegree[v, x], 0] &&  ! 
BinomialMatchQ[{u, v}, x]
 

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

rule 4629
Int[((a_) + (b_.)*sec[(e_.) + (f_.)*(x_)]^(n_))^(p_.)*((d_.)*tan[(e_.) + (f 
_.)*(x_)])^(m_), x_Symbol] :> With[{ff = FreeFactors[Tan[e + f*x], x]}, Sim 
p[ff/f   Subst[Int[(d*ff*x)^m*((a + b*(1 + ff^2*x^2)^(n/2))^p/(1 + ff^2*x^2 
)), x], x, Tan[e + f*x]/ff], x]] /; FreeQ[{a, b, d, e, f, m, p}, x] && Inte 
gerQ[n/2] && (IntegerQ[m/2] || EqQ[n, 2])
 
Maple [B] (verified)

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

Time = 63.61 (sec) , antiderivative size = 335, normalized size of antiderivative = 2.41

method result size
derivativedivides \(\frac {-\frac {\ln \left (\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{a^{3}}+\frac {\ln \left (\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{a^{3}}+\frac {\frac {2 \left (\left (-\frac {5}{8} a^{2}-\frac {1}{2} a b \right ) \tanh \left (\frac {d x}{2}+\frac {c}{2}\right )^{7}-\frac {a \left (15 a^{2}+15 a b -4 b^{2}\right ) \tanh \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{8 \left (a +b \right )}-\frac {a \left (15 a^{2}+15 a b -4 b^{2}\right ) \tanh \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{8 \left (a +b \right )}+\left (-\frac {5}{8} a^{2}-\frac {1}{2} a b \right ) \tanh \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{\left (\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )^{4} a +\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )^{4} b +2 \tanh \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} a -2 \tanh \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} b +a +b \right )^{2}}+\frac {2 \left (3 a^{2}+12 a b +8 b^{2}\right ) \left (-\frac {\ln \left (\sqrt {a +b}\, \tanh \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}+2 \tanh \left (\frac {d x}{2}+\frac {c}{2}\right ) \sqrt {b}+\sqrt {a +b}\right )}{4 \sqrt {b}\, \sqrt {a +b}}+\frac {\ln \left (\sqrt {a +b}\, \tanh \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-2 \tanh \left (\frac {d x}{2}+\frac {c}{2}\right ) \sqrt {b}+\sqrt {a +b}\right )}{4 \sqrt {b}\, \sqrt {a +b}}\right )}{8 a +8 b}}{a^{3}}}{d}\) \(335\)
default \(\frac {-\frac {\ln \left (\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{a^{3}}+\frac {\ln \left (\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{a^{3}}+\frac {\frac {2 \left (\left (-\frac {5}{8} a^{2}-\frac {1}{2} a b \right ) \tanh \left (\frac {d x}{2}+\frac {c}{2}\right )^{7}-\frac {a \left (15 a^{2}+15 a b -4 b^{2}\right ) \tanh \left (\frac {d x}{2}+\frac {c}{2}\right )^{5}}{8 \left (a +b \right )}-\frac {a \left (15 a^{2}+15 a b -4 b^{2}\right ) \tanh \left (\frac {d x}{2}+\frac {c}{2}\right )^{3}}{8 \left (a +b \right )}+\left (-\frac {5}{8} a^{2}-\frac {1}{2} a b \right ) \tanh \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{\left (\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )^{4} a +\tanh \left (\frac {d x}{2}+\frac {c}{2}\right )^{4} b +2 \tanh \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} a -2 \tanh \left (\frac {d x}{2}+\frac {c}{2}\right )^{2} b +a +b \right )^{2}}+\frac {2 \left (3 a^{2}+12 a b +8 b^{2}\right ) \left (-\frac {\ln \left (\sqrt {a +b}\, \tanh \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}+2 \tanh \left (\frac {d x}{2}+\frac {c}{2}\right ) \sqrt {b}+\sqrt {a +b}\right )}{4 \sqrt {b}\, \sqrt {a +b}}+\frac {\ln \left (\sqrt {a +b}\, \tanh \left (\frac {d x}{2}+\frac {c}{2}\right )^{2}-2 \tanh \left (\frac {d x}{2}+\frac {c}{2}\right ) \sqrt {b}+\sqrt {a +b}\right )}{4 \sqrt {b}\, \sqrt {a +b}}\right )}{8 a +8 b}}{a^{3}}}{d}\) \(335\)
risch \(\frac {x}{a^{3}}+\frac {5 a^{3} {\mathrm e}^{6 d x +6 c}+20 a^{2} b \,{\mathrm e}^{6 d x +6 c}+16 a \,b^{2} {\mathrm e}^{6 d x +6 c}+15 a^{3} {\mathrm e}^{4 d x +4 c}+58 a^{2} b \,{\mathrm e}^{4 d x +4 c}+88 a \,b^{2} {\mathrm e}^{4 d x +4 c}+48 b^{3} {\mathrm e}^{4 d x +4 c}+15 a^{3} {\mathrm e}^{2 d x +2 c}+44 a^{2} b \,{\mathrm e}^{2 d x +2 c}+32 a \,b^{2} {\mathrm e}^{2 d x +2 c}+5 a^{3}+6 a^{2} b}{4 a^{3} d \left (a +b \right ) \left ({\mathrm e}^{4 d x +4 c} a +2 a \,{\mathrm e}^{2 d x +2 c}+4 b \,{\mathrm e}^{2 d x +2 c}+a \right )^{2}}+\frac {3 \ln \left ({\mathrm e}^{2 d x +2 c}+\frac {a \sqrt {a b +b^{2}}+2 b \sqrt {a b +b^{2}}+2 a b +2 b^{2}}{a \sqrt {a b +b^{2}}}\right )}{16 \sqrt {a b +b^{2}}\, \left (a +b \right ) d a}+\frac {3 \ln \left ({\mathrm e}^{2 d x +2 c}+\frac {a \sqrt {a b +b^{2}}+2 b \sqrt {a b +b^{2}}+2 a b +2 b^{2}}{a \sqrt {a b +b^{2}}}\right ) b}{4 \sqrt {a b +b^{2}}\, \left (a +b \right ) d \,a^{2}}+\frac {\ln \left ({\mathrm e}^{2 d x +2 c}+\frac {a \sqrt {a b +b^{2}}+2 b \sqrt {a b +b^{2}}+2 a b +2 b^{2}}{a \sqrt {a b +b^{2}}}\right ) b^{2}}{2 \sqrt {a b +b^{2}}\, \left (a +b \right ) d \,a^{3}}-\frac {3 \ln \left ({\mathrm e}^{2 d x +2 c}+\frac {a \sqrt {a b +b^{2}}+2 b \sqrt {a b +b^{2}}-2 a b -2 b^{2}}{a \sqrt {a b +b^{2}}}\right )}{16 \sqrt {a b +b^{2}}\, \left (a +b \right ) d a}-\frac {3 \ln \left ({\mathrm e}^{2 d x +2 c}+\frac {a \sqrt {a b +b^{2}}+2 b \sqrt {a b +b^{2}}-2 a b -2 b^{2}}{a \sqrt {a b +b^{2}}}\right ) b}{4 \sqrt {a b +b^{2}}\, \left (a +b \right ) d \,a^{2}}-\frac {\ln \left ({\mathrm e}^{2 d x +2 c}+\frac {a \sqrt {a b +b^{2}}+2 b \sqrt {a b +b^{2}}-2 a b -2 b^{2}}{a \sqrt {a b +b^{2}}}\right ) b^{2}}{2 \sqrt {a b +b^{2}}\, \left (a +b \right ) d \,a^{3}}\) \(699\)

Input:

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

Output:

1/d*(-1/a^3*ln(tanh(1/2*d*x+1/2*c)-1)+1/a^3*ln(tanh(1/2*d*x+1/2*c)+1)+2/a^ 
3*(((-5/8*a^2-1/2*a*b)*tanh(1/2*d*x+1/2*c)^7-1/8*a*(15*a^2+15*a*b-4*b^2)/( 
a+b)*tanh(1/2*d*x+1/2*c)^5-1/8*a*(15*a^2+15*a*b-4*b^2)/(a+b)*tanh(1/2*d*x+ 
1/2*c)^3+(-5/8*a^2-1/2*a*b)*tanh(1/2*d*x+1/2*c))/(tanh(1/2*d*x+1/2*c)^4*a+ 
tanh(1/2*d*x+1/2*c)^4*b+2*tanh(1/2*d*x+1/2*c)^2*a-2*tanh(1/2*d*x+1/2*c)^2* 
b+a+b)^2+1/8*(3*a^2+12*a*b+8*b^2)/(a+b)*(-1/4/b^(1/2)/(a+b)^(1/2)*ln((a+b) 
^(1/2)*tanh(1/2*d*x+1/2*c)^2+2*tanh(1/2*d*x+1/2*c)*b^(1/2)+(a+b)^(1/2))+1/ 
4/b^(1/2)/(a+b)^(1/2)*ln((a+b)^(1/2)*tanh(1/2*d*x+1/2*c)^2-2*tanh(1/2*d*x+ 
1/2*c)*b^(1/2)+(a+b)^(1/2)))))
 

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 3459 vs. \(2 (131) = 262\).

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

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

Output:

Too large to include
 

Sympy [F]

\[ \int \frac {\tanh ^2(c+d x)}{\left (a+b \text {sech}^2(c+d x)\right )^3} \, dx=\int \frac {\tanh ^{2}{\left (c + d x \right )}}{\left (a + b \operatorname {sech}^{2}{\left (c + d x \right )}\right )^{3}}\, dx \] Input:

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

Output:

Integral(tanh(c + d*x)**2/(a + b*sech(c + d*x)**2)**3, x)
                                                                                    
                                                                                    
 

Maxima [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 1255 vs. \(2 (131) = 262\).

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

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

Output:

-1/64*(3*a^3 + 30*a^2*b + 40*a*b^2 + 16*b^3)*log((a*e^(2*d*x + 2*c) + a + 
2*b - 2*sqrt((a + b)*b))/(a*e^(2*d*x + 2*c) + a + 2*b + 2*sqrt((a + b)*b)) 
)/((a^5 + 2*a^4*b + a^3*b^2)*sqrt((a + b)*b)*d) + 1/64*(3*a^3 + 30*a^2*b + 
 40*a*b^2 + 16*b^3)*log((a*e^(-2*d*x - 2*c) + a + 2*b - 2*sqrt((a + b)*b)) 
/(a*e^(-2*d*x - 2*c) + a + 2*b + 2*sqrt((a + b)*b)))/((a^5 + 2*a^4*b + a^3 
*b^2)*sqrt((a + b)*b)*d) + 1/16*(5*a^4 + 20*a^3*b + 12*a^2*b^2 + (5*a^4 + 
66*a^3*b + 128*a^2*b^2 + 64*a*b^3)*e^(6*d*x + 6*c) + (15*a^4 + 164*a^3*b + 
 460*a^2*b^2 + 512*a*b^3 + 192*b^4)*e^(4*d*x + 4*c) + (15*a^4 + 118*a^3*b 
+ 208*a^2*b^2 + 96*a*b^3)*e^(2*d*x + 2*c))/((a^7 + 2*a^6*b + a^5*b^2 + (a^ 
7 + 2*a^6*b + a^5*b^2)*e^(8*d*x + 8*c) + 4*(a^7 + 4*a^6*b + 5*a^5*b^2 + 2* 
a^4*b^3)*e^(6*d*x + 6*c) + 2*(3*a^7 + 14*a^6*b + 27*a^5*b^2 + 24*a^4*b^3 + 
 8*a^3*b^4)*e^(4*d*x + 4*c) + 4*(a^7 + 4*a^6*b + 5*a^5*b^2 + 2*a^4*b^3)*e^ 
(2*d*x + 2*c))*d) - 1/16*(5*a^4 + 20*a^3*b + 12*a^2*b^2 + (15*a^4 + 118*a^ 
3*b + 208*a^2*b^2 + 96*a*b^3)*e^(-2*d*x - 2*c) + (15*a^4 + 164*a^3*b + 460 
*a^2*b^2 + 512*a*b^3 + 192*b^4)*e^(-4*d*x - 4*c) + (5*a^4 + 66*a^3*b + 128 
*a^2*b^2 + 64*a*b^3)*e^(-6*d*x - 6*c))/((a^7 + 2*a^6*b + a^5*b^2 + 4*(a^7 
+ 4*a^6*b + 5*a^5*b^2 + 2*a^4*b^3)*e^(-2*d*x - 2*c) + 2*(3*a^7 + 14*a^6*b 
+ 27*a^5*b^2 + 24*a^4*b^3 + 8*a^3*b^4)*e^(-4*d*x - 4*c) + 4*(a^7 + 4*a^6*b 
 + 5*a^5*b^2 + 2*a^4*b^3)*e^(-6*d*x - 6*c) + (a^7 + 2*a^6*b + a^5*b^2)*e^( 
-8*d*x - 8*c))*d) - 1/8*(5*a^3 + 2*a^2*b + (15*a^3 + 32*a^2*b + 8*a*b^2...
 

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 296 vs. \(2 (131) = 262\).

Time = 0.68 (sec) , antiderivative size = 296, normalized size of antiderivative = 2.13 \[ \int \frac {\tanh ^2(c+d x)}{\left (a+b \text {sech}^2(c+d x)\right )^3} \, dx=-\frac {\frac {{\left (3 \, a^{2} + 12 \, a b + 8 \, b^{2}\right )} \arctan \left (\frac {a e^{\left (2 \, d x + 2 \, c\right )} + a + 2 \, b}{2 \, \sqrt {-a b - b^{2}}}\right )}{{\left (a^{4} + a^{3} b\right )} \sqrt {-a b - b^{2}}} - \frac {2 \, {\left (5 \, a^{3} e^{\left (6 \, d x + 6 \, c\right )} + 20 \, a^{2} b e^{\left (6 \, d x + 6 \, c\right )} + 16 \, a b^{2} e^{\left (6 \, d x + 6 \, c\right )} + 15 \, a^{3} e^{\left (4 \, d x + 4 \, c\right )} + 58 \, a^{2} b e^{\left (4 \, d x + 4 \, c\right )} + 88 \, a b^{2} e^{\left (4 \, d x + 4 \, c\right )} + 48 \, b^{3} e^{\left (4 \, d x + 4 \, c\right )} + 15 \, a^{3} e^{\left (2 \, d x + 2 \, c\right )} + 44 \, a^{2} b e^{\left (2 \, d x + 2 \, c\right )} + 32 \, a b^{2} e^{\left (2 \, d x + 2 \, c\right )} + 5 \, a^{3} + 6 \, a^{2} b\right )}}{{\left (a^{4} + a^{3} b\right )} {\left (a e^{\left (4 \, d x + 4 \, c\right )} + 2 \, a e^{\left (2 \, d x + 2 \, c\right )} + 4 \, b e^{\left (2 \, d x + 2 \, c\right )} + a\right )}^{2}} - \frac {8 \, {\left (d x + c\right )}}{a^{3}}}{8 \, d} \] Input:

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

Output:

-1/8*((3*a^2 + 12*a*b + 8*b^2)*arctan(1/2*(a*e^(2*d*x + 2*c) + a + 2*b)/sq 
rt(-a*b - b^2))/((a^4 + a^3*b)*sqrt(-a*b - b^2)) - 2*(5*a^3*e^(6*d*x + 6*c 
) + 20*a^2*b*e^(6*d*x + 6*c) + 16*a*b^2*e^(6*d*x + 6*c) + 15*a^3*e^(4*d*x 
+ 4*c) + 58*a^2*b*e^(4*d*x + 4*c) + 88*a*b^2*e^(4*d*x + 4*c) + 48*b^3*e^(4 
*d*x + 4*c) + 15*a^3*e^(2*d*x + 2*c) + 44*a^2*b*e^(2*d*x + 2*c) + 32*a*b^2 
*e^(2*d*x + 2*c) + 5*a^3 + 6*a^2*b)/((a^4 + a^3*b)*(a*e^(4*d*x + 4*c) + 2* 
a*e^(2*d*x + 2*c) + 4*b*e^(2*d*x + 2*c) + a)^2) - 8*(d*x + c)/a^3)/d
 

Mupad [F(-1)]

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

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

Output:

int((cosh(c + d*x)^4*(cosh(c + d*x)^2 - 1))/(b + a*cosh(c + d*x)^2)^3, x)
 

Reduce [B] (verification not implemented)

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

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

Output:

( - 3*e**(8*c + 8*d*x)*sqrt(b)*sqrt(a + b)*log( - sqrt(2*sqrt(b)*sqrt(a + 
b) - a - 2*b) + e**(c + d*x)*sqrt(a))*a**5 - 18*e**(8*c + 8*d*x)*sqrt(b)*s 
qrt(a + b)*log( - sqrt(2*sqrt(b)*sqrt(a + b) - a - 2*b) + e**(c + d*x)*sqr 
t(a))*a**4*b - 32*e**(8*c + 8*d*x)*sqrt(b)*sqrt(a + b)*log( - sqrt(2*sqrt( 
b)*sqrt(a + b) - a - 2*b) + e**(c + d*x)*sqrt(a))*a**3*b**2 - 16*e**(8*c + 
 8*d*x)*sqrt(b)*sqrt(a + b)*log( - sqrt(2*sqrt(b)*sqrt(a + b) - a - 2*b) + 
 e**(c + d*x)*sqrt(a))*a**2*b**3 - 3*e**(8*c + 8*d*x)*sqrt(b)*sqrt(a + b)* 
log(sqrt(2*sqrt(b)*sqrt(a + b) - a - 2*b) + e**(c + d*x)*sqrt(a))*a**5 - 1 
8*e**(8*c + 8*d*x)*sqrt(b)*sqrt(a + b)*log(sqrt(2*sqrt(b)*sqrt(a + b) - a 
- 2*b) + e**(c + d*x)*sqrt(a))*a**4*b - 32*e**(8*c + 8*d*x)*sqrt(b)*sqrt(a 
 + b)*log(sqrt(2*sqrt(b)*sqrt(a + b) - a - 2*b) + e**(c + d*x)*sqrt(a))*a* 
*3*b**2 - 16*e**(8*c + 8*d*x)*sqrt(b)*sqrt(a + b)*log(sqrt(2*sqrt(b)*sqrt( 
a + b) - a - 2*b) + e**(c + d*x)*sqrt(a))*a**2*b**3 + 3*e**(8*c + 8*d*x)*s 
qrt(b)*sqrt(a + b)*log(2*sqrt(b)*sqrt(a + b) + e**(2*c + 2*d*x)*a + a + 2* 
b)*a**5 + 18*e**(8*c + 8*d*x)*sqrt(b)*sqrt(a + b)*log(2*sqrt(b)*sqrt(a + b 
) + e**(2*c + 2*d*x)*a + a + 2*b)*a**4*b + 32*e**(8*c + 8*d*x)*sqrt(b)*sqr 
t(a + b)*log(2*sqrt(b)*sqrt(a + b) + e**(2*c + 2*d*x)*a + a + 2*b)*a**3*b* 
*2 + 16*e**(8*c + 8*d*x)*sqrt(b)*sqrt(a + b)*log(2*sqrt(b)*sqrt(a + b) + e 
**(2*c + 2*d*x)*a + a + 2*b)*a**2*b**3 - 12*e**(6*c + 6*d*x)*sqrt(b)*sqrt( 
a + b)*log( - sqrt(2*sqrt(b)*sqrt(a + b) - a - 2*b) + e**(c + d*x)*sqrt...