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

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

Optimal result

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

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

Mathematica [A] (verified)

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

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

Output:

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

Rubi [A] (verified)

Time = 0.87 (sec) , antiderivative size = 201, normalized size of antiderivative = 0.99, number of steps used = 8, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.389, Rules used = {3042, 3801, 2694, 27, 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 \cosh (e+f x)} \, dx\)

\(\Big \downarrow \) 3042

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

\(\Big \downarrow \) 3801

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

\(\Big \downarrow \) 2694

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

\(\Big \downarrow \) 27

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

\(\Big \downarrow \) 2620

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

\(\Big \downarrow \) 2715

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

\(\Big \downarrow \) 2838

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

Input:

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

Output:

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

Defintions of rubi rules used

rule 27
Int[(a_)*(Fx_), x_Symbol] :> Simp[a   Int[Fx, x], x] /; FreeQ[a, x] &&  !Ma 
tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, 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 2694
Int[((F_)^(u_)*((f_.) + (g_.)*(x_))^(m_.))/((a_.) + (b_.)*(F_)^(u_) + (c_.) 
*(F_)^(v_)), x_Symbol] :> With[{q = Rt[b^2 - 4*a*c, 2]}, Simp[2*(c/q)   Int 
[(f + g*x)^m*(F^u/(b - q + 2*c*F^u)), x], x] - Simp[2*(c/q)   Int[(f + g*x) 
^m*(F^u/(b + q + 2*c*F^u)), x], x]] /; FreeQ[{F, a, b, c, f, g}, x] && EqQ[ 
v, 2*u] && LinearQ[u, x] && NeQ[b^2 - 4*a*c, 0] && 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 3801
Int[((c_.) + (d_.)*(x_))^(m_.)/((a_) + (b_.)*sin[(e_.) + Pi*(k_.) + (Comple 
x[0, fz_])*(f_.)*(x_)]), x_Symbol] :> Simp[2   Int[((c + d*x)^m*(E^((-I)*e 
+ f*fz*x)/(b + (2*a*E^((-I)*e + f*fz*x))/E^(I*Pi*(k - 1/2)) - (b*E^(2*((-I) 
*e + f*fz*x)))/E^(2*I*k*Pi))))/E^(I*Pi*(k - 1/2)), x], x] /; FreeQ[{a, b, c 
, d, e, f, fz}, x] && IntegerQ[2*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. \(436\) vs. \(2(183)=366\).

Time = 0.51 (sec) , antiderivative size = 437, normalized size of antiderivative = 2.15

method result size
risch \(\frac {2 c \arctan \left (\frac {2 b \,{\mathrm e}^{f x +e}+2 a}{2 \sqrt {-a^{2}+b^{2}}}\right )}{f \sqrt {-a^{2}+b^{2}}}+\frac {d \ln \left (\frac {-b \,{\mathrm e}^{f x +e}+\sqrt {a^{2}-b^{2}}-a}{-a +\sqrt {a^{2}-b^{2}}}\right ) x}{f \sqrt {a^{2}-b^{2}}}-\frac {d \ln \left (\frac {b \,{\mathrm e}^{f x +e}+\sqrt {a^{2}-b^{2}}+a}{a +\sqrt {a^{2}-b^{2}}}\right ) x}{f \sqrt {a^{2}-b^{2}}}+\frac {d \ln \left (\frac {-b \,{\mathrm e}^{f x +e}+\sqrt {a^{2}-b^{2}}-a}{-a +\sqrt {a^{2}-b^{2}}}\right ) e}{f^{2} \sqrt {a^{2}-b^{2}}}-\frac {d \ln \left (\frac {b \,{\mathrm e}^{f x +e}+\sqrt {a^{2}-b^{2}}+a}{a +\sqrt {a^{2}-b^{2}}}\right ) e}{f^{2} \sqrt {a^{2}-b^{2}}}+\frac {d \operatorname {dilog}\left (\frac {-b \,{\mathrm e}^{f x +e}+\sqrt {a^{2}-b^{2}}-a}{-a +\sqrt {a^{2}-b^{2}}}\right )}{f^{2} \sqrt {a^{2}-b^{2}}}-\frac {d \operatorname {dilog}\left (\frac {b \,{\mathrm e}^{f x +e}+\sqrt {a^{2}-b^{2}}+a}{a +\sqrt {a^{2}-b^{2}}}\right )}{f^{2} \sqrt {a^{2}-b^{2}}}-\frac {2 d e \arctan \left (\frac {2 b \,{\mathrm e}^{f x +e}+2 a}{2 \sqrt {-a^{2}+b^{2}}}\right )}{f^{2} \sqrt {-a^{2}+b^{2}}}\) \(437\)

Input:

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

Output:

2/f*c/(-a^2+b^2)^(1/2)*arctan(1/2*(2*b*exp(f*x+e)+2*a)/(-a^2+b^2)^(1/2))+1 
/f*d/(a^2-b^2)^(1/2)*ln((-b*exp(f*x+e)+(a^2-b^2)^(1/2)-a)/(-a+(a^2-b^2)^(1 
/2)))*x-1/f*d/(a^2-b^2)^(1/2)*ln((b*exp(f*x+e)+(a^2-b^2)^(1/2)+a)/(a+(a^2- 
b^2)^(1/2)))*x+1/f^2*d/(a^2-b^2)^(1/2)*ln((-b*exp(f*x+e)+(a^2-b^2)^(1/2)-a 
)/(-a+(a^2-b^2)^(1/2)))*e-1/f^2*d/(a^2-b^2)^(1/2)*ln((b*exp(f*x+e)+(a^2-b^ 
2)^(1/2)+a)/(a+(a^2-b^2)^(1/2)))*e+1/f^2*d/(a^2-b^2)^(1/2)*dilog((-b*exp(f 
*x+e)+(a^2-b^2)^(1/2)-a)/(-a+(a^2-b^2)^(1/2)))-1/f^2*d/(a^2-b^2)^(1/2)*dil 
og((b*exp(f*x+e)+(a^2-b^2)^(1/2)+a)/(a+(a^2-b^2)^(1/2)))-2/f^2*d*e/(-a^2+b 
^2)^(1/2)*arctan(1/2*(2*b*exp(f*x+e)+2*a)/(-a^2+b^2)^(1/2))
 

Fricas [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 473 vs. \(2 (181) = 362\).

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

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

Output:

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

Sympy [F]

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

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

Output:

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

Maxima [F(-2)]

Exception generated. \[ \int \frac {c+d x}{a+b \cosh (e+f x)} \, dx=\text {Exception raised: ValueError} \] Input:

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

Output:

Exception raised: ValueError >> Computation failed since Maxima requested 
additional constraints; using the 'assume' command before evaluation *may* 
 help (example of legal syntax is 'assume(4*a^2-4*b^2>0)', see `assume?` f 
or more de
 

Giac [F]

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

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

Output:

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

Mupad [F(-1)]

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

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

Output:

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

Reduce [F]

\[ \int \frac {c+d x}{a+b \cosh (e+f x)} \, dx=\frac {-2 \sqrt {-a^{2}+b^{2}}\, \mathit {atan} \left (\frac {e^{f x +e} b +a}{\sqrt {-a^{2}+b^{2}}}\right ) c +2 e^{e} \left (\int \frac {e^{f x} x}{e^{2 f x +2 e} b +2 e^{f x +e} a +b}d x \right ) a^{2} d f -2 e^{e} \left (\int \frac {e^{f x} x}{e^{2 f x +2 e} b +2 e^{f x +e} a +b}d x \right ) b^{2} d f}{f \left (a^{2}-b^{2}\right )} \] Input:

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

Output:

(2*( - sqrt( - a**2 + b**2)*atan((e**(e + f*x)*b + a)/sqrt( - a**2 + b**2) 
)*c + e**e*int((e**(f*x)*x)/(e**(2*e + 2*f*x)*b + 2*e**(e + f*x)*a + b),x) 
*a**2*d*f - e**e*int((e**(f*x)*x)/(e**(2*e + 2*f*x)*b + 2*e**(e + f*x)*a + 
 b),x)*b**2*d*f))/(f*(a**2 - b**2))