\(\int \frac {1}{(c+d x) (a+a \tanh (e+f x))} \, dx\) [35]

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

Optimal result

Integrand size = 20, antiderivative size = 157 \[ \int \frac {1}{(c+d x) (a+a \tanh (e+f x))} \, dx=\frac {\cosh \left (2 e-\frac {2 c f}{d}\right ) \text {Chi}\left (\frac {2 c f}{d}+2 f x\right )}{2 a d}+\frac {\log (c+d x)}{2 a d}-\frac {\text {Chi}\left (\frac {2 c f}{d}+2 f x\right ) \sinh \left (2 e-\frac {2 c f}{d}\right )}{2 a d}-\frac {\cosh \left (2 e-\frac {2 c f}{d}\right ) \text {Shi}\left (\frac {2 c f}{d}+2 f x\right )}{2 a d}+\frac {\sinh \left (2 e-\frac {2 c f}{d}\right ) \text {Shi}\left (\frac {2 c f}{d}+2 f x\right )}{2 a d} \] Output:

1/2*cosh(-2*e+2*c*f/d)*Chi(2*c*f/d+2*f*x)/a/d+1/2*ln(d*x+c)/a/d+1/2*Chi(2* 
c*f/d+2*f*x)*sinh(-2*e+2*c*f/d)/a/d-1/2*cosh(-2*e+2*c*f/d)*Shi(2*c*f/d+2*f 
*x)/a/d-1/2*sinh(-2*e+2*c*f/d)*Shi(2*c*f/d+2*f*x)/a/d
 

Mathematica [A] (verified)

Time = 0.40 (sec) , antiderivative size = 122, normalized size of antiderivative = 0.78 \[ \int \frac {1}{(c+d x) (a+a \tanh (e+f x))} \, dx=\frac {\text {sech}(e+f x) (\cosh (f x)+\sinh (f x)) \left (\log (f (c+d x)) (\cosh (e)+\sinh (e))+\text {Chi}\left (\frac {2 f (c+d x)}{d}\right ) \left (\cosh \left (e-\frac {2 c f}{d}\right )-\sinh \left (e-\frac {2 c f}{d}\right )\right )+\left (-\cosh \left (e-\frac {2 c f}{d}\right )+\sinh \left (e-\frac {2 c f}{d}\right )\right ) \text {Shi}\left (\frac {2 f (c+d x)}{d}\right )\right )}{2 a d (1+\tanh (e+f x))} \] Input:

Integrate[1/((c + d*x)*(a + a*Tanh[e + f*x])),x]
 

Output:

(Sech[e + f*x]*(Cosh[f*x] + Sinh[f*x])*(Log[f*(c + d*x)]*(Cosh[e] + Sinh[e 
]) + CoshIntegral[(2*f*(c + d*x))/d]*(Cosh[e - (2*c*f)/d] - Sinh[e - (2*c* 
f)/d]) + (-Cosh[e - (2*c*f)/d] + Sinh[e - (2*c*f)/d])*SinhIntegral[(2*f*(c 
 + d*x))/d]))/(2*a*d*(1 + Tanh[e + f*x]))
 

Rubi [C] (verified)

Result contains complex when optimal does not.

Time = 0.79 (sec) , antiderivative size = 157, normalized size of antiderivative = 1.00, number of steps used = 11, number of rules used = 11, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.550, Rules used = {3042, 4209, 26, 3042, 26, 3784, 26, 3042, 26, 3779, 3782}

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}{(c+d x) (a \tanh (e+f x)+a)} \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {1}{(c+d x) (a-i a \tan (i e+i f x))}dx\)

\(\Big \downarrow \) 4209

\(\displaystyle \frac {i \int \frac {i \sinh (2 e+2 f x)}{c+d x}dx}{2 a}+\frac {\int \frac {\cosh (2 e+2 f x)}{c+d x}dx}{2 a}+\frac {\log (c+d x)}{2 a d}\)

\(\Big \downarrow \) 26

\(\displaystyle -\frac {\int \frac {\sinh (2 e+2 f x)}{c+d x}dx}{2 a}+\frac {\int \frac {\cosh (2 e+2 f x)}{c+d x}dx}{2 a}+\frac {\log (c+d x)}{2 a d}\)

\(\Big \downarrow \) 3042

\(\displaystyle -\frac {\int -\frac {i \sin (2 i e+2 i f x)}{c+d x}dx}{2 a}+\frac {\int \frac {\sin \left (2 i e+2 i f x+\frac {\pi }{2}\right )}{c+d x}dx}{2 a}+\frac {\log (c+d x)}{2 a d}\)

\(\Big \downarrow \) 26

\(\displaystyle \frac {i \int \frac {\sin (2 i e+2 i f x)}{c+d x}dx}{2 a}+\frac {\int \frac {\sin \left (2 i e+2 i f x+\frac {\pi }{2}\right )}{c+d x}dx}{2 a}+\frac {\log (c+d x)}{2 a d}\)

\(\Big \downarrow \) 3784

\(\displaystyle \frac {i \left (i \sinh \left (2 e-\frac {2 c f}{d}\right ) \int \frac {\cosh \left (2 x f+\frac {2 c f}{d}\right )}{c+d x}dx+\cosh \left (2 e-\frac {2 c f}{d}\right ) \int \frac {i \sinh \left (2 x f+\frac {2 c f}{d}\right )}{c+d x}dx\right )}{2 a}+\frac {\cosh \left (2 e-\frac {2 c f}{d}\right ) \int \frac {\cosh \left (2 x f+\frac {2 c f}{d}\right )}{c+d x}dx-i \sinh \left (2 e-\frac {2 c f}{d}\right ) \int \frac {i \sinh \left (2 x f+\frac {2 c f}{d}\right )}{c+d x}dx}{2 a}+\frac {\log (c+d x)}{2 a d}\)

\(\Big \downarrow \) 26

\(\displaystyle \frac {i \left (i \sinh \left (2 e-\frac {2 c f}{d}\right ) \int \frac {\cosh \left (2 x f+\frac {2 c f}{d}\right )}{c+d x}dx+i \cosh \left (2 e-\frac {2 c f}{d}\right ) \int \frac {\sinh \left (2 x f+\frac {2 c f}{d}\right )}{c+d x}dx\right )}{2 a}+\frac {\sinh \left (2 e-\frac {2 c f}{d}\right ) \int \frac {\sinh \left (2 x f+\frac {2 c f}{d}\right )}{c+d x}dx+\cosh \left (2 e-\frac {2 c f}{d}\right ) \int \frac {\cosh \left (2 x f+\frac {2 c f}{d}\right )}{c+d x}dx}{2 a}+\frac {\log (c+d x)}{2 a d}\)

\(\Big \downarrow \) 3042

\(\displaystyle \frac {\sinh \left (2 e-\frac {2 c f}{d}\right ) \int -\frac {i \sin \left (2 i x f+\frac {2 i c f}{d}\right )}{c+d x}dx+\cosh \left (2 e-\frac {2 c f}{d}\right ) \int \frac {\sin \left (2 i x f+\frac {2 i c f}{d}+\frac {\pi }{2}\right )}{c+d x}dx}{2 a}+\frac {i \left (i \sinh \left (2 e-\frac {2 c f}{d}\right ) \int \frac {\sin \left (2 i x f+\frac {2 i c f}{d}+\frac {\pi }{2}\right )}{c+d x}dx+i \cosh \left (2 e-\frac {2 c f}{d}\right ) \int -\frac {i \sin \left (2 i x f+\frac {2 i c f}{d}\right )}{c+d x}dx\right )}{2 a}+\frac {\log (c+d x)}{2 a d}\)

\(\Big \downarrow \) 26

\(\displaystyle \frac {\cosh \left (2 e-\frac {2 c f}{d}\right ) \int \frac {\sin \left (2 i x f+\frac {2 i c f}{d}+\frac {\pi }{2}\right )}{c+d x}dx-i \sinh \left (2 e-\frac {2 c f}{d}\right ) \int \frac {\sin \left (2 i x f+\frac {2 i c f}{d}\right )}{c+d x}dx}{2 a}+\frac {i \left (i \sinh \left (2 e-\frac {2 c f}{d}\right ) \int \frac {\sin \left (2 i x f+\frac {2 i c f}{d}+\frac {\pi }{2}\right )}{c+d x}dx+\cosh \left (2 e-\frac {2 c f}{d}\right ) \int \frac {\sin \left (2 i x f+\frac {2 i c f}{d}\right )}{c+d x}dx\right )}{2 a}+\frac {\log (c+d x)}{2 a d}\)

\(\Big \downarrow \) 3779

\(\displaystyle \frac {\frac {\sinh \left (2 e-\frac {2 c f}{d}\right ) \text {Shi}\left (2 x f+\frac {2 c f}{d}\right )}{d}+\cosh \left (2 e-\frac {2 c f}{d}\right ) \int \frac {\sin \left (2 i x f+\frac {2 i c f}{d}+\frac {\pi }{2}\right )}{c+d x}dx}{2 a}+\frac {i \left (i \sinh \left (2 e-\frac {2 c f}{d}\right ) \int \frac {\sin \left (2 i x f+\frac {2 i c f}{d}+\frac {\pi }{2}\right )}{c+d x}dx+\frac {i \cosh \left (2 e-\frac {2 c f}{d}\right ) \text {Shi}\left (2 x f+\frac {2 c f}{d}\right )}{d}\right )}{2 a}+\frac {\log (c+d x)}{2 a d}\)

\(\Big \downarrow \) 3782

\(\displaystyle \frac {i \left (\frac {i \text {Chi}\left (2 x f+\frac {2 c f}{d}\right ) \sinh \left (2 e-\frac {2 c f}{d}\right )}{d}+\frac {i \cosh \left (2 e-\frac {2 c f}{d}\right ) \text {Shi}\left (2 x f+\frac {2 c f}{d}\right )}{d}\right )}{2 a}+\frac {\frac {\text {Chi}\left (2 x f+\frac {2 c f}{d}\right ) \cosh \left (2 e-\frac {2 c f}{d}\right )}{d}+\frac {\sinh \left (2 e-\frac {2 c f}{d}\right ) \text {Shi}\left (2 x f+\frac {2 c f}{d}\right )}{d}}{2 a}+\frac {\log (c+d x)}{2 a d}\)

Input:

Int[1/((c + d*x)*(a + a*Tanh[e + f*x])),x]
 

Output:

Log[c + d*x]/(2*a*d) + ((I/2)*((I*CoshIntegral[(2*c*f)/d + 2*f*x]*Sinh[2*e 
 - (2*c*f)/d])/d + (I*Cosh[2*e - (2*c*f)/d]*SinhIntegral[(2*c*f)/d + 2*f*x 
])/d))/a + ((Cosh[2*e - (2*c*f)/d]*CoshIntegral[(2*c*f)/d + 2*f*x])/d + (S 
inh[2*e - (2*c*f)/d]*SinhIntegral[(2*c*f)/d + 2*f*x])/d)/(2*a)
 

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 3779
Int[sin[(e_.) + (Complex[0, fz_])*(f_.)*(x_)]/((c_.) + (d_.)*(x_)), x_Symbo 
l] :> Simp[I*(SinhIntegral[c*f*(fz/d) + f*fz*x]/d), x] /; FreeQ[{c, d, e, f 
, fz}, x] && EqQ[d*e - c*f*fz*I, 0]
 

rule 3782
Int[sin[(e_.) + (Complex[0, fz_])*(f_.)*(x_)]/((c_.) + (d_.)*(x_)), x_Symbo 
l] :> Simp[CoshIntegral[c*f*(fz/d) + f*fz*x]/d, x] /; FreeQ[{c, d, e, f, fz 
}, x] && EqQ[d*(e - Pi/2) - c*f*fz*I, 0]
 

rule 3784
Int[sin[(e_.) + (f_.)*(x_)]/((c_.) + (d_.)*(x_)), x_Symbol] :> Simp[Cos[(d* 
e - c*f)/d]   Int[Sin[c*(f/d) + f*x]/(c + d*x), x], x] + Simp[Sin[(d*e - c* 
f)/d]   Int[Cos[c*(f/d) + f*x]/(c + d*x), x], x] /; FreeQ[{c, d, e, f}, x] 
&& NeQ[d*e - c*f, 0]
 

rule 4209
Int[1/(((c_.) + (d_.)*(x_))*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])), x_Symb 
ol] :> Simp[Log[c + d*x]/(2*a*d), x] + (Simp[1/(2*a)   Int[Cos[2*e + 2*f*x] 
/(c + d*x), x], x] + Simp[1/(2*b)   Int[Sin[2*e + 2*f*x]/(c + d*x), x], x]) 
 /; FreeQ[{a, b, c, d, e, f}, x] && EqQ[a^2 + b^2, 0]
 
Maple [A] (verified)

Time = 0.58 (sec) , antiderivative size = 61, normalized size of antiderivative = 0.39

method result size
risch \(\frac {\ln \left (d x +c \right )}{2 a d}-\frac {{\mathrm e}^{\frac {2 c f -2 d e}{d}} \operatorname {expIntegral}_{1}\left (2 f x +2 e +\frac {2 c f -2 d e}{d}\right )}{2 a d}\) \(61\)

Input:

int(1/(d*x+c)/(a+tanh(f*x+e)*a),x,method=_RETURNVERBOSE)
 

Output:

1/2*ln(d*x+c)/a/d-1/2/a/d*exp(2*(c*f-d*e)/d)*Ei(1,2*f*x+2*e+2*(c*f-d*e)/d)
 

Fricas [A] (verification not implemented)

Time = 0.08 (sec) , antiderivative size = 73, normalized size of antiderivative = 0.46 \[ \int \frac {1}{(c+d x) (a+a \tanh (e+f x))} \, dx=\frac {{\rm Ei}\left (-\frac {2 \, {\left (d f x + c f\right )}}{d}\right ) \cosh \left (-\frac {2 \, {\left (d e - c f\right )}}{d}\right ) + {\rm Ei}\left (-\frac {2 \, {\left (d f x + c f\right )}}{d}\right ) \sinh \left (-\frac {2 \, {\left (d e - c f\right )}}{d}\right ) + \log \left (d x + c\right )}{2 \, a d} \] Input:

integrate(1/(d*x+c)/(a+a*tanh(f*x+e)),x, algorithm="fricas")
                                                                                    
                                                                                    
 

Output:

1/2*(Ei(-2*(d*f*x + c*f)/d)*cosh(-2*(d*e - c*f)/d) + Ei(-2*(d*f*x + c*f)/d 
)*sinh(-2*(d*e - c*f)/d) + log(d*x + c))/(a*d)
 

Sympy [F]

\[ \int \frac {1}{(c+d x) (a+a \tanh (e+f x))} \, dx=\frac {\int \frac {1}{c \tanh {\left (e + f x \right )} + c + d x \tanh {\left (e + f x \right )} + d x}\, dx}{a} \] Input:

integrate(1/(d*x+c)/(a+a*tanh(f*x+e)),x)
 

Output:

Integral(1/(c*tanh(e + f*x) + c + d*x*tanh(e + f*x) + d*x), x)/a
 

Maxima [A] (verification not implemented)

Time = 0.22 (sec) , antiderivative size = 48, normalized size of antiderivative = 0.31 \[ \int \frac {1}{(c+d x) (a+a \tanh (e+f x))} \, dx=-\frac {e^{\left (-2 \, e + \frac {2 \, c f}{d}\right )} E_{1}\left (\frac {2 \, {\left (d x + c\right )} f}{d}\right )}{2 \, a d} + \frac {\log \left (d x + c\right )}{2 \, a d} \] Input:

integrate(1/(d*x+c)/(a+a*tanh(f*x+e)),x, algorithm="maxima")
 

Output:

-1/2*e^(-2*e + 2*c*f/d)*exp_integral_e(1, 2*(d*x + c)*f/d)/(a*d) + 1/2*log 
(d*x + c)/(a*d)
 

Giac [A] (verification not implemented)

Time = 0.13 (sec) , antiderivative size = 47, normalized size of antiderivative = 0.30 \[ \int \frac {1}{(c+d x) (a+a \tanh (e+f x))} \, dx=\frac {{\left ({\rm Ei}\left (-\frac {2 \, {\left (d f x + c f\right )}}{d}\right ) e^{\left (\frac {2 \, c f}{d}\right )} + e^{\left (2 \, e\right )} \log \left (d x + c\right )\right )} e^{\left (-2 \, e\right )}}{2 \, a d} \] Input:

integrate(1/(d*x+c)/(a+a*tanh(f*x+e)),x, algorithm="giac")
 

Output:

1/2*(Ei(-2*(d*f*x + c*f)/d)*e^(2*c*f/d) + e^(2*e)*log(d*x + c))*e^(-2*e)/( 
a*d)
 

Mupad [F(-1)]

Timed out. \[ \int \frac {1}{(c+d x) (a+a \tanh (e+f x))} \, dx=\int \frac {1}{\left (a+a\,\mathrm {tanh}\left (e+f\,x\right )\right )\,\left (c+d\,x\right )} \,d x \] Input:

int(1/((a + a*tanh(e + f*x))*(c + d*x)),x)
 

Output:

int(1/((a + a*tanh(e + f*x))*(c + d*x)), x)
 

Reduce [F]

\[ \int \frac {1}{(c+d x) (a+a \tanh (e+f x))} \, dx=\frac {\int \frac {1}{\tanh \left (f x +e \right ) c +\tanh \left (f x +e \right ) d x +c +d x}d x}{a} \] Input:

int(1/(d*x+c)/(a+a*tanh(f*x+e)),x)
 

Output:

int(1/(tanh(e + f*x)*c + tanh(e + f*x)*d*x + c + d*x),x)/a