Integrand size = 18, antiderivative size = 108 \[ \int \frac {c+d x}{a+b \tanh (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
Time = 0.66 (sec) , antiderivative size = 152, normalized size of antiderivative = 1.41 \[ \int \frac {c+d x}{a+b \tanh (e+f x)} \, dx=\frac {1}{2} \left (-\frac {2 b (c+d x)^2}{(a+b) d \left (b \left (-1+e^{2 e}\right )+a \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) \cosh (e)}{a \cosh (e)+b \sinh (e)}\right ) \] Input:
Integrate[(c + d*x)/(a + b*Tanh[e + f*x]),x]
Output:
((-2*b*(c + d*x)^2)/((a + b)*d*(b*(-1 + E^(2*e)) + a*(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)*Cosh[e])/(a*Cosh[e] + b*Sinh[e]))/2
Time = 0.52 (sec) , antiderivative size = 112, normalized size of antiderivative = 1.04, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.278, Rules used = {3042, 4215, 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 \tanh (e+f x)} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {c+d x}{a-i b \tan (i e+i f x)}dx\) |
\(\Big \downarrow \) 4215 |
\(\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 \) 2620 |
\(\displaystyle 2 b \left (\frac {d \int \log \left (\frac {e^{-2 (e+f x)} (a-b)}{a+b}+1\right )dx}{2 f \left (a^2-b^2\right )}-\frac {(c+d x) \log \left (\frac {(a-b) e^{-2 (e+f x)}}{a+b}+1\right )}{2 f \left (a^2-b^2\right )}\right )+\frac {(c+d x)^2}{2 d (a+b)}\) |
\(\Big \downarrow \) 2715 |
\(\displaystyle 2 b \left (-\frac {d \int e^{2 (e+f x)} \log \left (\frac {e^{-2 (e+f x)} (a-b)}{a+b}+1\right )de^{-2 (e+f x)}}{4 f^2 \left (a^2-b^2\right )}-\frac {(c+d x) \log \left (\frac {(a-b) e^{-2 (e+f x)}}{a+b}+1\right )}{2 f \left (a^2-b^2\right )}\right )+\frac {(c+d x)^2}{2 d (a+b)}\) |
\(\Big \downarrow \) 2838 |
\(\displaystyle 2 b \left (\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 )}-\frac {(c+d x) \log \left (\frac {(a-b) e^{-2 (e+f x)}}{a+b}+1\right )}{2 f \left (a^2-b^2\right )}\right )+\frac {(c+d x)^2}{2 d (a+b)}\) |
Input:
Int[(c + d*x)/(a + b*Tanh[e + f*x]),x]
Output:
(c + d*x)^2/(2*(a + b)*d) + 2*b*(-1/2*((c + d*x)*Log[1 + (a - b)/((a + b)* E^(2*(e + f*x)))])/((a^2 - b^2)*f) + (d*PolyLog[2, -((a - b)/((a + b)*E^(2 *(e + f*x))))])/(4*(a^2 - b^2)*f^2))
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]
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]
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]
Int[((c_.) + (d_.)*(x_))^(m_.)/((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]), x_Sy mbol] :> Simp[(c + d*x)^(m + 1)/(d*(m + 1)*(a + I*b)), x] + Simp[2*I*b In t[(c + d*x)^m*(E^Simp[2*I*(e + f*x), x]/((a + I*b)^2 + (a^2 + b^2)*E^Simp[2 *I*(e + f*x), x])), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[a^2 + b^2 , 0] && IGtQ[m, 0]
Leaf count of result is larger than twice the leaf count of optimal. \(356\) vs. \(2(108)=216\).
Time = 0.53 (sec) , antiderivative size = 357, normalized size of antiderivative = 3.31
method | result | size |
risch | \(\frac {d \,x^{2}}{2 b +2 a}+\frac {c x}{a +b}-\frac {b c \ln \left (a \,{\mathrm e}^{2 f x +2 e}+{\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 (a \,{\mathrm e}^{2 f x +2 e}+{\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*tanh(f*x+e)),x,method=_RETURNVERBOSE)
Output:
1/2/(a+b)*d*x^2+1/(a+b)*c*x-1/f*b/(a+b)*c/(a-b)*ln(a*exp(2*f*x+2*e)+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(a*exp(2*f*x+2*e)+exp(2*f*x+2*e)*b+a-b)- 2/f^2*b/(a+b)*d*e/(a-b)*ln(exp(f*x+e))
Leaf count of result is larger than twice the leaf count of optimal. 306 vs. \(2 (103) = 206\).
Time = 0.11 (sec) , antiderivative size = 306, normalized size of antiderivative = 2.83 \[ \int \frac {c+d x}{a+b \tanh (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*tanh(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(-s qrt(-(a + b)/(a - b))*(cosh(f*x + e) + sinh(f*x + e)) + 1))/((a^2 - b^2)*f ^2)
\[ \int \frac {c+d x}{a+b \tanh (e+f x)} \, dx=\int \frac {c + d x}{a + b \tanh {\left (e + f x \right )}}\, dx \] Input:
integrate((d*x+c)/(a+b*tanh(f*x+e)),x)
Output:
Integral((c + d*x)/(a + b*tanh(e + f*x)), x)
\[ \int \frac {c+d x}{a+b \tanh (e+f x)} \, dx=\int { \frac {d x + c}{b \tanh \left (f x + e\right ) + a} \,d x } \] Input:
integrate((d*x+c)/(a+b*tanh(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))
\[ \int \frac {c+d x}{a+b \tanh (e+f x)} \, dx=\int { \frac {d x + c}{b \tanh \left (f x + e\right ) + a} \,d x } \] Input:
integrate((d*x+c)/(a+b*tanh(f*x+e)),x, algorithm="giac")
Output:
integrate((d*x + c)/(b*tanh(f*x + e) + a), x)
Timed out. \[ \int \frac {c+d x}{a+b \tanh (e+f x)} \, dx=\int \frac {c+d\,x}{a+b\,\mathrm {tanh}\left (e+f\,x\right )} \,d x \] Input:
int((c + d*x)/(a + b*tanh(e + f*x)),x)
Output:
int((c + d*x)/(a + b*tanh(e + f*x)), x)
\[ \int \frac {c+d x}{a+b \tanh (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*tanh(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))