\(\int \frac {c+d x}{a+b \coth (e+f x)} \, dx\) [54]

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

Optimal result

Integrand size = 18, antiderivative size = 108 \[ \int \frac {c+d x}{a+b \coth (e+f x)} \, dx=\frac {(c+d x)^2}{2 (a+b) d}-\frac {b (c+d x) \log \left (1-\frac {(a-b) e^{-2 (e+f x)}}{a+b}\right )}{\left (a^2-b^2\right ) f}+\frac {b d \operatorname {PolyLog}\left (2,\frac {(a-b) e^{-2 (e+f x)}}{a+b}\right )}{2 \left (a^2-b^2\right ) f^2} \] Output:

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

Mathematica [A] (verified)

Time = 0.67 (sec) , antiderivative size = 152, normalized size of antiderivative = 1.41 \[ \int \frac {c+d x}{a+b \coth (e+f x)} \, dx=\frac {1}{2} \left (\frac {2 b (c+d x)^2}{(a+b) d \left (a \left (-1+e^{2 e}\right )+b \left (1+e^{2 e}\right )\right )}-\frac {2 b (c+d x) \log \left (1+\frac {(-a+b) e^{-2 (e+f x)}}{a+b}\right )}{(a-b) (a+b) f}+\frac {b d \operatorname {PolyLog}\left (2,\frac {(a-b) e^{-2 (e+f x)}}{a+b}\right )}{(a-b) (a+b) f^2}+\frac {x (2 c+d x) \sinh (e)}{b \cosh (e)+a \sinh (e)}\right ) \] Input:

Integrate[(c + d*x)/(a + b*Coth[e + f*x]),x]
 

Output:

((2*b*(c + d*x)^2)/((a + b)*d*(a*(-1 + E^(2*e)) + b*(1 + E^(2*e)))) - (2*b 
*(c + d*x)*Log[1 + (-a + b)/((a + b)*E^(2*(e + f*x)))])/((a - b)*(a + b)*f 
) + (b*d*PolyLog[2, (a - b)/((a + b)*E^(2*(e + f*x)))])/((a - b)*(a + b)*f 
^2) + (x*(2*c + d*x)*Sinh[e])/(b*Cosh[e] + a*Sinh[e]))/2
 

Rubi [A] (verified)

Time = 0.54 (sec) , antiderivative size = 112, normalized size of antiderivative = 1.04, number of steps used = 7, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.333, Rules used = {3042, 4214, 25, 2620, 2715, 2838}

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

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 4214

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

\(\Big \downarrow \) 25

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

\(\Big \downarrow \) 2620

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

\(\Big \downarrow \) 2715

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

\(\Big \downarrow \) 2838

\(\displaystyle \frac {(c+d x)^2}{2 d (a+b)}-2 b \left (\frac {(c+d x) \log \left (1-\frac {(a-b) e^{-2 (e+f x)}}{a+b}\right )}{2 f \left (a^2-b^2\right )}-\frac {d \operatorname {PolyLog}\left (2,\frac {(a-b) e^{-2 (e+f x)}}{a+b}\right )}{4 f^2 \left (a^2-b^2\right )}\right )\)

Input:

Int[(c + d*x)/(a + b*Coth[e + f*x]),x]
 

Output:

(c + d*x)^2/(2*(a + b)*d) - 2*b*(((c + d*x)*Log[1 - (a - b)/((a + b)*E^(2* 
(e + f*x)))])/(2*(a^2 - b^2)*f) - (d*PolyLog[2, (a - b)/((a + b)*E^(2*(e + 
 f*x)))])/(4*(a^2 - b^2)*f^2))
 

Defintions of rubi rules used

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

rule 2620
Int[(((F_)^((g_.)*((e_.) + (f_.)*(x_))))^(n_.)*((c_.) + (d_.)*(x_))^(m_.))/ 
((a_) + (b_.)*((F_)^((g_.)*((e_.) + (f_.)*(x_))))^(n_.)), x_Symbol] :> Simp 
[((c + d*x)^m/(b*f*g*n*Log[F]))*Log[1 + b*((F^(g*(e + f*x)))^n/a)], x] - Si 
mp[d*(m/(b*f*g*n*Log[F]))   Int[(c + d*x)^(m - 1)*Log[1 + b*((F^(g*(e + f*x 
)))^n/a)], x], x] /; FreeQ[{F, a, b, c, d, e, f, g, n}, x] && IGtQ[m, 0]
 

rule 2715
Int[Log[(a_) + (b_.)*((F_)^((e_.)*((c_.) + (d_.)*(x_))))^(n_.)], x_Symbol] 
:> Simp[1/(d*e*n*Log[F])   Subst[Int[Log[a + b*x]/x, x], x, (F^(e*(c + d*x) 
))^n], x] /; FreeQ[{F, a, b, c, d, e, n}, x] && GtQ[a, 0]
 

rule 2838
Int[Log[(c_.)*((d_) + (e_.)*(x_)^(n_.))]/(x_), x_Symbol] :> Simp[-PolyLog[2 
, (-c)*e*x^n]/n, x] /; FreeQ[{c, d, e, n}, x] && EqQ[c*d, 1]
 

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

rule 4214
Int[((c_.) + (d_.)*(x_))^(m_.)/((a_) + (b_.)*tan[(e_.) + Pi*(k_.) + (f_.)*( 
x_)]), x_Symbol] :> Simp[(c + d*x)^(m + 1)/(d*(m + 1)*(a + I*b)), x] + Simp 
[2*I*b   Int[(c + d*x)^m*E^(2*I*k*Pi)*(E^Simp[2*I*(e + f*x), x]/((a + I*b)^ 
2 + (a^2 + b^2)*E^(2*I*k*Pi)*E^Simp[2*I*(e + f*x), x])), x], x] /; FreeQ[{a 
, b, c, d, e, f}, x] && IntegerQ[4*k] && NeQ[a^2 + b^2, 0] && IGtQ[m, 0]
 
Maple [B] (verified)

Leaf count of result is larger than twice the leaf count of optimal. \(356\) vs. \(2(108)=216\).

Time = 0.12 (sec) , antiderivative size = 357, normalized size of antiderivative = 3.31

method result size
risch \(\frac {d \,x^{2}}{2 a +2 b}+\frac {x c}{a +b}-\frac {b c \ln \left ({\mathrm e}^{2 f x +2 e} a +{\mathrm e}^{2 f x +2 e} b -a +b \right )}{f \left (a +b \right ) \left (a -b \right )}+\frac {2 b c \ln \left ({\mathrm e}^{f x +e}\right )}{f \left (a +b \right ) \left (a -b \right )}+\frac {b d \,x^{2}}{\left (a +b \right ) \left (a -b \right )}-\frac {b d \ln \left (1-\frac {\left (a +b \right ) {\mathrm e}^{2 f x +2 e}}{a -b}\right ) x}{f \left (a +b \right ) \left (a -b \right )}+\frac {2 b d e x}{f \left (a +b \right ) \left (a -b \right )}-\frac {b d \ln \left (1-\frac {\left (a +b \right ) {\mathrm e}^{2 f x +2 e}}{a -b}\right ) e}{f^{2} \left (a +b \right ) \left (a -b \right )}+\frac {b d \,e^{2}}{f^{2} \left (a +b \right ) \left (a -b \right )}-\frac {b d \operatorname {polylog}\left (2, \frac {\left (a +b \right ) {\mathrm e}^{2 f x +2 e}}{a -b}\right )}{2 f^{2} \left (a +b \right ) \left (a -b \right )}+\frac {b d e \ln \left ({\mathrm e}^{2 f x +2 e} a +{\mathrm e}^{2 f x +2 e} b -a +b \right )}{f^{2} \left (a +b \right ) \left (a -b \right )}-\frac {2 b d e \ln \left ({\mathrm e}^{f x +e}\right )}{f^{2} \left (a +b \right ) \left (a -b \right )}\) \(357\)

Input:

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

Output:

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

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 300 vs. \(2 (103) = 206\).

Time = 0.10 (sec) , antiderivative size = 300, normalized size of antiderivative = 2.78 \[ \int \frac {c+d x}{a+b \coth (e+f x)} \, dx=\frac {{\left (a + b\right )} d f^{2} x^{2} + 2 \, {\left (a + b\right )} c f^{2} x - 2 \, b d {\rm Li}_2\left (\sqrt {\frac {a + b}{a - b}} {\left (\cosh \left (f x + e\right ) + \sinh \left (f x + e\right )\right )}\right ) - 2 \, b d {\rm Li}_2\left (-\sqrt {\frac {a + b}{a - b}} {\left (\cosh \left (f x + e\right ) + \sinh \left (f x + e\right )\right )}\right ) + 2 \, {\left (b d e - b c f\right )} \log \left (2 \, {\left (a + b\right )} \cosh \left (f x + e\right ) + 2 \, {\left (a + b\right )} \sinh \left (f x + e\right ) + 2 \, {\left (a - b\right )} \sqrt {\frac {a + b}{a - b}}\right ) + 2 \, {\left (b d e - b c f\right )} \log \left (2 \, {\left (a + b\right )} \cosh \left (f x + e\right ) + 2 \, {\left (a + b\right )} \sinh \left (f x + e\right ) - 2 \, {\left (a - b\right )} \sqrt {\frac {a + b}{a - b}}\right ) - 2 \, {\left (b d f x + b d e\right )} \log \left (\sqrt {\frac {a + b}{a - b}} {\left (\cosh \left (f x + e\right ) + \sinh \left (f x + e\right )\right )} + 1\right ) - 2 \, {\left (b d f x + b d e\right )} \log \left (-\sqrt {\frac {a + b}{a - b}} {\left (\cosh \left (f x + e\right ) + \sinh \left (f x + e\right )\right )} + 1\right )}{2 \, {\left (a^{2} - b^{2}\right )} f^{2}} \] Input:

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

Output:

1/2*((a + b)*d*f^2*x^2 + 2*(a + b)*c*f^2*x - 2*b*d*dilog(sqrt((a + b)/(a - 
 b))*(cosh(f*x + e) + sinh(f*x + e))) - 2*b*d*dilog(-sqrt((a + b)/(a - b)) 
*(cosh(f*x + e) + sinh(f*x + e))) + 2*(b*d*e - b*c*f)*log(2*(a + b)*cosh(f 
*x + e) + 2*(a + b)*sinh(f*x + e) + 2*(a - b)*sqrt((a + b)/(a - b))) + 2*( 
b*d*e - b*c*f)*log(2*(a + b)*cosh(f*x + e) + 2*(a + b)*sinh(f*x + e) - 2*( 
a - b)*sqrt((a + b)/(a - b))) - 2*(b*d*f*x + b*d*e)*log(sqrt((a + b)/(a - 
b))*(cosh(f*x + e) + sinh(f*x + e)) + 1) - 2*(b*d*f*x + b*d*e)*log(-sqrt(( 
a + b)/(a - b))*(cosh(f*x + e) + sinh(f*x + e)) + 1))/((a^2 - b^2)*f^2)
 

Sympy [F]

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

integrate((d*x+c)/(a+b*coth(f*x+e)),x)
 

Output:

Integral((c + d*x)/(a + b*coth(e + f*x)), x)
 

Maxima [F]

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

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

Output:

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

Giac [F]

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

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

Output:

integrate((d*x + c)/(b*coth(f*x + e) + a), x)
 

Mupad [F(-1)]

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

int((c + d*x)/(a + b*coth(e + f*x)),x)
 

Output:

int((c + d*x)/(a + b*coth(e + f*x)), x)
                                                                                    
                                                                                    
 

Reduce [F]

\[ \int \frac {c+d x}{a+b \coth (e+f x)} \, dx=\frac {-4 e^{2 e} \left (\int \frac {e^{2 f x} x}{e^{2 f x +2 e} a^{2}-e^{2 f x +2 e} b^{2}-a^{2}+2 a b -b^{2}}d x \right ) a^{2} b d f +4 e^{2 e} \left (\int \frac {e^{2 f x} x}{e^{2 f x +2 e} a^{2}-e^{2 f x +2 e} b^{2}-a^{2}+2 a b -b^{2}}d x \right ) b^{3} d f -2 \,\mathrm {log}\left (e^{2 f x +2 e} a +e^{2 f x +2 e} b -a +b \right ) b c +2 a c f x +a d f \,x^{2}+2 b c f x +b d f \,x^{2}}{2 f \left (a^{2}-b^{2}\right )} \] Input:

int((d*x+c)/(a+b*coth(f*x+e)),x)
 

Output:

( - 4*e**(2*e)*int((e**(2*f*x)*x)/(e**(2*e + 2*f*x)*a**2 - e**(2*e + 2*f*x 
)*b**2 - a**2 + 2*a*b - b**2),x)*a**2*b*d*f + 4*e**(2*e)*int((e**(2*f*x)*x 
)/(e**(2*e + 2*f*x)*a**2 - e**(2*e + 2*f*x)*b**2 - a**2 + 2*a*b - b**2),x) 
*b**3*d*f - 2*log(e**(2*e + 2*f*x)*a + e**(2*e + 2*f*x)*b - a + b)*b*c + 2 
*a*c*f*x + a*d*f*x**2 + 2*b*c*f*x + b*d*f*x**2)/(2*f*(a**2 - b**2))