Integrand size = 12, antiderivative size = 57 \[ \int (c+d x) \tanh (e+f x) \, dx=-\frac {(c+d x)^2}{2 d}+\frac {(c+d x) \log \left (1+e^{2 (e+f x)}\right )}{f}+\frac {d \operatorname {PolyLog}\left (2,-e^{2 (e+f x)}\right )}{2 f^2} \] Output:
-1/2*(d*x+c)^2/d+(d*x+c)*ln(1+exp(2*f*x+2*e))/f+1/2*d*polylog(2,-exp(2*f*x +2*e))/f^2
Time = 0.13 (sec) , antiderivative size = 59, normalized size of antiderivative = 1.04 \[ \int (c+d x) \tanh (e+f x) \, dx=\frac {f \left (d f x^2+2 d x \log \left (1+e^{-2 (e+f x)}\right )+2 c \log (\cosh (e+f x))\right )-d \operatorname {PolyLog}\left (2,-e^{-2 (e+f x)}\right )}{2 f^2} \] Input:
Integrate[(c + d*x)*Tanh[e + f*x],x]
Output:
(f*(d*f*x^2 + 2*d*x*Log[1 + E^(-2*(e + f*x))] + 2*c*Log[Cosh[e + f*x]]) - d*PolyLog[2, -E^(-2*(e + f*x))])/(2*f^2)
Result contains complex when optimal does not.
Time = 0.38 (sec) , antiderivative size = 71, normalized size of antiderivative = 1.25, number of steps used = 7, number of rules used = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.500, Rules used = {3042, 26, 4201, 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 (c+d x) \tanh (e+f x) \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int -i (c+d x) \tan (i e+i f x)dx\) |
\(\Big \downarrow \) 26 |
\(\displaystyle -i \int (c+d x) \tan (i e+i f x)dx\) |
\(\Big \downarrow \) 4201 |
\(\displaystyle -i \left (2 i \int \frac {e^{2 (e+f x)} (c+d x)}{1+e^{2 (e+f x)}}dx-\frac {i (c+d x)^2}{2 d}\right )\) |
\(\Big \downarrow \) 2620 |
\(\displaystyle -i \left (2 i \left (\frac {(c+d x) \log \left (e^{2 (e+f x)}+1\right )}{2 f}-\frac {d \int \log \left (1+e^{2 (e+f x)}\right )dx}{2 f}\right )-\frac {i (c+d x)^2}{2 d}\right )\) |
\(\Big \downarrow \) 2715 |
\(\displaystyle -i \left (2 i \left (\frac {(c+d x) \log \left (e^{2 (e+f x)}+1\right )}{2 f}-\frac {d \int e^{-2 (e+f x)} \log \left (1+e^{2 (e+f x)}\right )de^{2 (e+f x)}}{4 f^2}\right )-\frac {i (c+d x)^2}{2 d}\right )\) |
\(\Big \downarrow \) 2838 |
\(\displaystyle -i \left (2 i \left (\frac {(c+d x) \log \left (e^{2 (e+f x)}+1\right )}{2 f}+\frac {d \operatorname {PolyLog}\left (2,-e^{2 (e+f x)}\right )}{4 f^2}\right )-\frac {i (c+d x)^2}{2 d}\right )\) |
Input:
Int[(c + d*x)*Tanh[e + f*x],x]
Output:
(-I)*(((-1/2*I)*(c + d*x)^2)/d + (2*I)*(((c + d*x)*Log[1 + E^(2*(e + f*x)) ])/(2*f) + (d*PolyLog[2, -E^(2*(e + f*x))])/(4*f^2)))
Int[(Complex[0, a_])*(Fx_), x_Symbol] :> Simp[(Complex[Identity[0], a]) I nt[Fx, x], x] /; FreeQ[a, x] && EqQ[a^2, 1]
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_.)*tan[(e_.) + (Complex[0, fz_])*(f_.)*(x_)], x _Symbol] :> Simp[(-I)*((c + d*x)^(m + 1)/(d*(m + 1))), x] + Simp[2*I Int[ (c + d*x)^m*(E^(2*((-I)*e + f*fz*x))/(1 + E^(2*((-I)*e + f*fz*x)))), x], x] /; FreeQ[{c, d, e, f, fz}, x] && IGtQ[m, 0]
Leaf count of result is larger than twice the leaf count of optimal. \(108\) vs. \(2(53)=106\).
Time = 0.63 (sec) , antiderivative size = 109, normalized size of antiderivative = 1.91
method | result | size |
risch | \(-\frac {d \,x^{2}}{2}+c x -\frac {2 c \ln \left ({\mathrm e}^{f x +e}\right )}{f}+\frac {c \ln \left (1+{\mathrm e}^{2 f x +2 e}\right )}{f}-\frac {2 d e x}{f}-\frac {d \,e^{2}}{f^{2}}+\frac {d \ln \left (1+{\mathrm e}^{2 f x +2 e}\right ) x}{f}+\frac {d \operatorname {polylog}\left (2, -{\mathrm e}^{2 f x +2 e}\right )}{2 f^{2}}+\frac {2 d e \ln \left ({\mathrm e}^{f x +e}\right )}{f^{2}}\) | \(109\) |
Input:
int((d*x+c)*tanh(f*x+e),x,method=_RETURNVERBOSE)
Output:
-1/2*d*x^2+c*x-2/f*c*ln(exp(f*x+e))+1/f*c*ln(1+exp(2*f*x+2*e))-2/f*d*e*x-1 /f^2*d*e^2+1/f*d*ln(1+exp(2*f*x+2*e))*x+1/2*d*polylog(2,-exp(2*f*x+2*e))/f ^2+2/f^2*d*e*ln(exp(f*x+e))
Result contains complex when optimal does not.
Time = 0.11 (sec) , antiderivative size = 171, normalized size of antiderivative = 3.00 \[ \int (c+d x) \tanh (e+f x) \, dx=-\frac {d f^{2} x^{2} + 2 \, c f^{2} x - 2 \, d {\rm Li}_2\left (i \, \cosh \left (f x + e\right ) + i \, \sinh \left (f x + e\right )\right ) - 2 \, d {\rm Li}_2\left (-i \, \cosh \left (f x + e\right ) - i \, \sinh \left (f x + e\right )\right ) + 2 \, {\left (d e - c f\right )} \log \left (\cosh \left (f x + e\right ) + \sinh \left (f x + e\right ) + i\right ) + 2 \, {\left (d e - c f\right )} \log \left (\cosh \left (f x + e\right ) + \sinh \left (f x + e\right ) - i\right ) - 2 \, {\left (d f x + d e\right )} \log \left (i \, \cosh \left (f x + e\right ) + i \, \sinh \left (f x + e\right ) + 1\right ) - 2 \, {\left (d f x + d e\right )} \log \left (-i \, \cosh \left (f x + e\right ) - i \, \sinh \left (f x + e\right ) + 1\right )}{2 \, f^{2}} \] Input:
integrate((d*x+c)*tanh(f*x+e),x, algorithm="fricas")
Output:
-1/2*(d*f^2*x^2 + 2*c*f^2*x - 2*d*dilog(I*cosh(f*x + e) + I*sinh(f*x + e)) - 2*d*dilog(-I*cosh(f*x + e) - I*sinh(f*x + e)) + 2*(d*e - c*f)*log(cosh( f*x + e) + sinh(f*x + e) + I) + 2*(d*e - c*f)*log(cosh(f*x + e) + sinh(f*x + e) - I) - 2*(d*f*x + d*e)*log(I*cosh(f*x + e) + I*sinh(f*x + e) + 1) - 2*(d*f*x + d*e)*log(-I*cosh(f*x + e) - I*sinh(f*x + e) + 1))/f^2
\[ \int (c+d x) \tanh (e+f x) \, dx=\int \left (c + d x\right ) \tanh {\left (e + f x \right )}\, dx \] Input:
integrate((d*x+c)*tanh(f*x+e),x)
Output:
Integral((c + d*x)*tanh(e + f*x), x)
Time = 0.17 (sec) , antiderivative size = 78, normalized size of antiderivative = 1.37 \[ \int (c+d x) \tanh (e+f x) \, dx=-\frac {1}{2} \, d x^{2} + \frac {c \log \left (e^{\left (2 \, f x + 2 \, e\right )} + 1\right )}{2 \, f} + \frac {c \log \left (e^{\left (-2 \, f x - 2 \, e\right )} + 1\right )}{2 \, f} + \frac {{\left (2 \, f x \log \left (e^{\left (2 \, f x + 2 \, e\right )} + 1\right ) + {\rm Li}_2\left (-e^{\left (2 \, f x + 2 \, e\right )}\right )\right )} d}{2 \, f^{2}} \] Input:
integrate((d*x+c)*tanh(f*x+e),x, algorithm="maxima")
Output:
-1/2*d*x^2 + 1/2*c*log(e^(2*f*x + 2*e) + 1)/f + 1/2*c*log(e^(-2*f*x - 2*e) + 1)/f + 1/2*(2*f*x*log(e^(2*f*x + 2*e) + 1) + dilog(-e^(2*f*x + 2*e)))*d /f^2
\[ \int (c+d x) \tanh (e+f x) \, dx=\int { {\left (d x + c\right )} \tanh \left (f x + e\right ) \,d x } \] Input:
integrate((d*x+c)*tanh(f*x+e),x, algorithm="giac")
Output:
integrate((d*x + c)*tanh(f*x + e), x)
Timed out. \[ \int (c+d x) \tanh (e+f x) \, dx=\int \mathrm {tanh}\left (e+f\,x\right )\,\left (c+d\,x\right ) \,d x \] Input:
int(tanh(e + f*x)*(c + d*x),x)
Output:
int(tanh(e + f*x)*(c + d*x), x)
\[ \int (c+d x) \tanh (e+f x) \, dx=\frac {4 e^{2 e} \left (\int \frac {e^{2 f x} x}{e^{2 f x +2 e}+1}d x \right ) d f +2 \,\mathrm {log}\left (e^{2 f x +2 e}+1\right ) c -2 c f x -d f \,x^{2}}{2 f} \] Input:
int((d*x+c)*tanh(f*x+e),x)
Output:
(4*e**(2*e)*int((e**(2*f*x)*x)/(e**(2*e + 2*f*x) + 1),x)*d*f + 2*log(e**(2 *e + 2*f*x) + 1)*c - 2*c*f*x - d*f*x**2)/(2*f)