\(\int \frac {1}{\sqrt {-\tanh ^2(c+d x)}} \, dx\) [30]

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

Optimal result

Integrand size = 14, antiderivative size = 31 \[ \int \frac {1}{\sqrt {-\tanh ^2(c+d x)}} \, dx=\frac {\log (\sinh (c+d x)) \tanh (c+d x)}{d \sqrt {-\tanh ^2(c+d x)}} \]

[Out]

ln(sinh(d*x+c))*tanh(d*x+c)/d/(-tanh(d*x+c)^2)^(1/2)

Rubi [A] (verified)

Time = 0.02 (sec) , antiderivative size = 31, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.143, Rules used = {3739, 3556} \[ \int \frac {1}{\sqrt {-\tanh ^2(c+d x)}} \, dx=\frac {\tanh (c+d x) \log (\sinh (c+d x))}{d \sqrt {-\tanh ^2(c+d x)}} \]

[In]

Int[1/Sqrt[-Tanh[c + d*x]^2],x]

[Out]

(Log[Sinh[c + d*x]]*Tanh[c + d*x])/(d*Sqrt[-Tanh[c + d*x]^2])

Rule 3556

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

Rule 3739

Int[(u_.)*((b_.)*tan[(e_.) + (f_.)*(x_)]^(n_))^(p_), x_Symbol] :> With[{ff = FreeFactors[Tan[e + f*x], x]}, Di
st[(b*ff^n)^IntPart[p]*((b*Tan[e + f*x]^n)^FracPart[p]/(Tan[e + f*x]/ff)^(n*FracPart[p])), Int[ActivateTrig[u]
*(Tan[e + f*x]/ff)^(n*p), x], x]] /; FreeQ[{b, e, f, n, p}, x] &&  !IntegerQ[p] && IntegerQ[n] && (EqQ[u, 1] |
| MatchQ[u, ((d_.)*(trig_)[e + f*x])^(m_.) /; FreeQ[{d, m}, x] && MemberQ[{sin, cos, tan, cot, sec, csc}, trig
]])

Rubi steps \begin{align*} \text {integral}& = \frac {\tanh (c+d x) \int \coth (c+d x) \, dx}{\sqrt {-\tanh ^2(c+d x)}} \\ & = \frac {\log (\sinh (c+d x)) \tanh (c+d x)}{d \sqrt {-\tanh ^2(c+d x)}} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.07 (sec) , antiderivative size = 39, normalized size of antiderivative = 1.26 \[ \int \frac {1}{\sqrt {-\tanh ^2(c+d x)}} \, dx=\frac {(\log (\cosh (c+d x))+\log (\tanh (c+d x))) \tanh (c+d x)}{d \sqrt {-\tanh ^2(c+d x)}} \]

[In]

Integrate[1/Sqrt[-Tanh[c + d*x]^2],x]

[Out]

((Log[Cosh[c + d*x]] + Log[Tanh[c + d*x]])*Tanh[c + d*x])/(d*Sqrt[-Tanh[c + d*x]^2])

Maple [A] (verified)

Time = 0.04 (sec) , antiderivative size = 52, normalized size of antiderivative = 1.68

method result size
derivativedivides \(-\frac {\tanh \left (d x +c \right ) \left (\ln \left (\tanh \left (d x +c \right )-1\right )+\ln \left (\tanh \left (d x +c \right )+1\right )-2 \ln \left (\tanh \left (d x +c \right )\right )\right )}{2 d \sqrt {-\tanh \left (d x +c \right )^{2}}}\) \(52\)
default \(-\frac {\tanh \left (d x +c \right ) \left (\ln \left (\tanh \left (d x +c \right )-1\right )+\ln \left (\tanh \left (d x +c \right )+1\right )-2 \ln \left (\tanh \left (d x +c \right )\right )\right )}{2 d \sqrt {-\tanh \left (d x +c \right )^{2}}}\) \(52\)
risch \(\frac {\left ({\mathrm e}^{2 d x +2 c}-1\right ) x}{\sqrt {-\frac {\left ({\mathrm e}^{2 d x +2 c}-1\right )^{2}}{\left ({\mathrm e}^{2 d x +2 c}+1\right )^{2}}}\, \left ({\mathrm e}^{2 d x +2 c}+1\right )}-\frac {2 \left ({\mathrm e}^{2 d x +2 c}-1\right ) \left (d x +c \right )}{\sqrt {-\frac {\left ({\mathrm e}^{2 d x +2 c}-1\right )^{2}}{\left ({\mathrm e}^{2 d x +2 c}+1\right )^{2}}}\, \left ({\mathrm e}^{2 d x +2 c}+1\right ) d}+\frac {\left ({\mathrm e}^{2 d x +2 c}-1\right ) \ln \left ({\mathrm e}^{2 d x +2 c}-1\right )}{\sqrt {-\frac {\left ({\mathrm e}^{2 d x +2 c}-1\right )^{2}}{\left ({\mathrm e}^{2 d x +2 c}+1\right )^{2}}}\, \left ({\mathrm e}^{2 d x +2 c}+1\right ) d}\) \(192\)

[In]

int(1/(-tanh(d*x+c)^2)^(1/2),x,method=_RETURNVERBOSE)

[Out]

-1/2/d*tanh(d*x+c)*(ln(tanh(d*x+c)-1)+ln(tanh(d*x+c)+1)-2*ln(tanh(d*x+c)))/(-tanh(d*x+c)^2)^(1/2)

Fricas [C] (verification not implemented)

Result contains complex when optimal does not.

Time = 0.25 (sec) , antiderivative size = 23, normalized size of antiderivative = 0.74 \[ \int \frac {1}{\sqrt {-\tanh ^2(c+d x)}} \, dx=\frac {i \, d x - i \, \log \left (e^{\left (2 \, d x + 2 \, c\right )} - 1\right )}{d} \]

[In]

integrate(1/(-tanh(d*x+c)^2)^(1/2),x, algorithm="fricas")

[Out]

(I*d*x - I*log(e^(2*d*x + 2*c) - 1))/d

Sympy [F]

\[ \int \frac {1}{\sqrt {-\tanh ^2(c+d x)}} \, dx=\int \frac {1}{\sqrt {- \tanh ^{2}{\left (c + d x \right )}}}\, dx \]

[In]

integrate(1/(-tanh(d*x+c)**2)**(1/2),x)

[Out]

Integral(1/sqrt(-tanh(c + d*x)**2), x)

Maxima [C] (verification not implemented)

Result contains complex when optimal does not.

Time = 0.30 (sec) , antiderivative size = 45, normalized size of antiderivative = 1.45 \[ \int \frac {1}{\sqrt {-\tanh ^2(c+d x)}} \, dx=\frac {i \, {\left (d x + c\right )}}{d} + \frac {i \, \log \left (e^{\left (-d x - c\right )} + 1\right )}{d} + \frac {i \, \log \left (e^{\left (-d x - c\right )} - 1\right )}{d} \]

[In]

integrate(1/(-tanh(d*x+c)^2)^(1/2),x, algorithm="maxima")

[Out]

I*(d*x + c)/d + I*log(e^(-d*x - c) + 1)/d + I*log(e^(-d*x - c) - 1)/d

Giac [C] (verification not implemented)

Result contains complex when optimal does not.

Time = 0.27 (sec) , antiderivative size = 61, normalized size of antiderivative = 1.97 \[ \int \frac {1}{\sqrt {-\tanh ^2(c+d x)}} \, dx=-\frac {\frac {i \, d x + i \, c}{\mathrm {sgn}\left (-e^{\left (4 \, d x + 4 \, c\right )} + 1\right )} - \frac {i \, \log \left (e^{\left (2 \, d x + 2 \, c\right )} - 1\right )}{\mathrm {sgn}\left (-e^{\left (4 \, d x + 4 \, c\right )} + 1\right )}}{d} \]

[In]

integrate(1/(-tanh(d*x+c)^2)^(1/2),x, algorithm="giac")

[Out]

-((I*d*x + I*c)/sgn(-e^(4*d*x + 4*c) + 1) - I*log(e^(2*d*x + 2*c) - 1)/sgn(-e^(4*d*x + 4*c) + 1))/d

Mupad [B] (verification not implemented)

Time = 1.84 (sec) , antiderivative size = 24, normalized size of antiderivative = 0.77 \[ \int \frac {1}{\sqrt {-\tanh ^2(c+d x)}} \, dx=\frac {\mathrm {atan}\left (\frac {\mathrm {tanh}\left (c+d\,x\right )}{\sqrt {-{\mathrm {tanh}\left (c+d\,x\right )}^2}}\right )}{d} \]

[In]

int(1/(-tanh(c + d*x)^2)^(1/2),x)

[Out]

atan(tanh(c + d*x)/(-tanh(c + d*x)^2)^(1/2))/d