Integrand size = 20, antiderivative size = 159 \[ \int \frac {1}{(c+d x)^2 (a+a \tanh (e+f x))} \, dx=-\frac {f \cosh \left (2 e-\frac {2 c f}{d}\right ) \text {Chi}\left (\frac {2 c f}{d}+2 f x\right )}{a d^2}+\frac {f \text {Chi}\left (\frac {2 c f}{d}+2 f x\right ) \sinh \left (2 e-\frac {2 c f}{d}\right )}{a d^2}+\frac {f \cosh \left (2 e-\frac {2 c f}{d}\right ) \text {Shi}\left (\frac {2 c f}{d}+2 f x\right )}{a d^2}-\frac {f \sinh \left (2 e-\frac {2 c f}{d}\right ) \text {Shi}\left (\frac {2 c f}{d}+2 f x\right )}{a d^2}-\frac {1}{d (c+d x) (a+a \tanh (e+f x))} \] Output:
-f*cosh(-2*e+2*c*f/d)*Chi(2*c*f/d+2*f*x)/a/d^2-f*Chi(2*c*f/d+2*f*x)*sinh(- 2*e+2*c*f/d)/a/d^2+f*cosh(-2*e+2*c*f/d)*Shi(2*c*f/d+2*f*x)/a/d^2+f*sinh(-2 *e+2*c*f/d)*Shi(2*c*f/d+2*f*x)/a/d^2-1/d/(d*x+c)/(a+a*tanh(f*x+e))
Time = 0.59 (sec) , antiderivative size = 206, normalized size of antiderivative = 1.30 \[ \int \frac {1}{(c+d x)^2 (a+a \tanh (e+f x))} \, dx=-\frac {\text {sech}(e+f x) \left (\cosh \left (\frac {c f}{d}\right )+\sinh \left (\frac {c f}{d}\right )\right ) \left (d \left (\cosh \left (e+f \left (-\frac {c}{d}+x\right )\right )+\cosh \left (e+f \left (\frac {c}{d}+x\right )\right )+\sinh \left (e+f \left (-\frac {c}{d}+x\right )\right )-\sinh \left (e+f \left (\frac {c}{d}+x\right )\right )\right )+2 f (c+d x) \text {Chi}\left (\frac {2 f (c+d x)}{d}\right ) \left (\cosh \left (e-\frac {f (c+d x)}{d}\right )-\sinh \left (e-\frac {f (c+d x)}{d}\right )\right )+2 f (c+d x) \left (-\cosh \left (e-\frac {f (c+d x)}{d}\right )+\sinh \left (e-\frac {f (c+d x)}{d}\right )\right ) \text {Shi}\left (\frac {2 f (c+d x)}{d}\right )\right )}{2 a d^2 (c+d x) (1+\tanh (e+f x))} \] Input:
Integrate[1/((c + d*x)^2*(a + a*Tanh[e + f*x])),x]
Output:
-1/2*(Sech[e + f*x]*(Cosh[(c*f)/d] + Sinh[(c*f)/d])*(d*(Cosh[e + f*(-(c/d) + x)] + Cosh[e + f*(c/d + x)] + Sinh[e + f*(-(c/d) + x)] - Sinh[e + f*(c/ d + x)]) + 2*f*(c + d*x)*CoshIntegral[(2*f*(c + d*x))/d]*(Cosh[e - (f*(c + d*x))/d] - Sinh[e - (f*(c + d*x))/d]) + 2*f*(c + d*x)*(-Cosh[e - (f*(c + d*x))/d] + Sinh[e - (f*(c + d*x))/d])*SinhIntegral[(2*f*(c + d*x))/d]))/(a *d^2*(c + d*x)*(1 + Tanh[e + f*x]))
Result contains complex when optimal does not.
Time = 0.77 (sec) , antiderivative size = 169, normalized size of antiderivative = 1.06, number of steps used = 11, number of rules used = 11, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.550, Rules used = {3042, 4207, 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)^2 (a \tanh (e+f x)+a)} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {1}{(c+d x)^2 (a-i a \tan (i e+i f x))}dx\) |
\(\Big \downarrow \) 4207 |
\(\displaystyle -\frac {i f \int \frac {i \sinh (2 e+2 f x)}{c+d x}dx}{a d}-\frac {f \int \frac {\cosh (2 e+2 f x)}{c+d x}dx}{a d}-\frac {1}{d (c+d x) (a \tanh (e+f x)+a)}\) |
\(\Big \downarrow \) 26 |
\(\displaystyle \frac {f \int \frac {\sinh (2 e+2 f x)}{c+d x}dx}{a d}-\frac {f \int \frac {\cosh (2 e+2 f x)}{c+d x}dx}{a d}-\frac {1}{d (c+d x) (a \tanh (e+f x)+a)}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {f \int -\frac {i \sin (2 i e+2 i f x)}{c+d x}dx}{a d}-\frac {f \int \frac {\sin \left (2 i e+2 i f x+\frac {\pi }{2}\right )}{c+d x}dx}{a d}-\frac {1}{d (c+d x) (a \tanh (e+f x)+a)}\) |
\(\Big \downarrow \) 26 |
\(\displaystyle -\frac {i f \int \frac {\sin (2 i e+2 i f x)}{c+d x}dx}{a d}-\frac {f \int \frac {\sin \left (2 i e+2 i f x+\frac {\pi }{2}\right )}{c+d x}dx}{a d}-\frac {1}{d (c+d x) (a \tanh (e+f x)+a)}\) |
\(\Big \downarrow \) 3784 |
\(\displaystyle -\frac {i f \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 )}{a d}-\frac {f \left (\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\right )}{a d}-\frac {1}{d (c+d x) (a \tanh (e+f x)+a)}\) |
\(\Big \downarrow \) 26 |
\(\displaystyle -\frac {i f \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 )}{a d}-\frac {f \left (\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\right )}{a d}-\frac {1}{d (c+d x) (a \tanh (e+f x)+a)}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle -\frac {f \left (\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\right )}{a d}-\frac {i f \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 )}{a d}-\frac {1}{d (c+d x) (a \tanh (e+f x)+a)}\) |
\(\Big \downarrow \) 26 |
\(\displaystyle -\frac {f \left (\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\right )}{a d}-\frac {i f \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 )}{a d}-\frac {1}{d (c+d x) (a \tanh (e+f x)+a)}\) |
\(\Big \downarrow \) 3779 |
\(\displaystyle -\frac {f \left (\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\right )}{a d}-\frac {i f \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 )}{a d}-\frac {1}{d (c+d x) (a \tanh (e+f x)+a)}\) |
\(\Big \downarrow \) 3782 |
\(\displaystyle -\frac {i f \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 )}{a d}-\frac {f \left (\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}\right )}{a d}-\frac {1}{d (c+d x) (a \tanh (e+f x)+a)}\) |
Input:
Int[1/((c + d*x)^2*(a + a*Tanh[e + f*x])),x]
Output:
((-I)*f*((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*d) - (f*((Co sh[2*e - (2*c*f)/d]*CoshIntegral[(2*c*f)/d + 2*f*x])/d + (Sinh[2*e - (2*c* f)/d]*SinhIntegral[(2*c*f)/d + 2*f*x])/d))/(a*d) - 1/(d*(c + d*x)*(a + a*T anh[e + f*x]))
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[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]
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]
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]
Int[1/(((c_.) + (d_.)*(x_))^2*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])), x_Sy mbol] :> -Simp[(d*(c + d*x)*(a + b*Tan[e + f*x]))^(-1), x] + (-Simp[f/(a*d) Int[Sin[2*e + 2*f*x]/(c + d*x), x], x] + Simp[f/(b*d) Int[Cos[2*e + 2* f*x]/(c + d*x), x], x]) /; FreeQ[{a, b, c, d, e, f}, x] && EqQ[a^2 + b^2, 0 ]
Time = 0.66 (sec) , antiderivative size = 90, normalized size of antiderivative = 0.57
method | result | size |
risch | \(-\frac {1}{2 d a \left (d x +c \right )}-\frac {f \,{\mathrm e}^{-2 f x -2 e}}{2 a d \left (d x f +c f \right )}+\frac {f \,{\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 )}{a \,d^{2}}\) | \(90\) |
Input:
int(1/(d*x+c)^2/(a+tanh(f*x+e)*a),x,method=_RETURNVERBOSE)
Output:
-1/2/d/a/(d*x+c)-1/2*f/a*exp(-2*f*x-2*e)/d/(d*f*x+c*f)+f/a/d^2*exp(2*(c*f- d*e)/d)*Ei(1,2*f*x+2*e+2*(c*f-d*e)/d)
Time = 0.08 (sec) , antiderivative size = 217, normalized size of antiderivative = 1.36 \[ \int \frac {1}{(c+d x)^2 (a+a \tanh (e+f x))} \, dx=-\frac {{\left (d f x + c f\right )} {\rm Ei}\left (-\frac {2 \, {\left (d f x + c f\right )}}{d}\right ) \cosh \left (f x + e\right ) \sinh \left (-\frac {2 \, {\left (d e - c f\right )}}{d}\right ) + {\left ({\left (d f x + c f\right )} {\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 ) + d\right )} \cosh \left (f x + e\right ) + {\left ({\left (d f x + c f\right )} {\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 ) + {\left (d f x + c f\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 )\right )} \sinh \left (f x + e\right )}{{\left (a d^{3} x + a c d^{2}\right )} \cosh \left (f x + e\right ) + {\left (a d^{3} x + a c d^{2}\right )} \sinh \left (f x + e\right )} \] Input:
integrate(1/(d*x+c)^2/(a+a*tanh(f*x+e)),x, algorithm="fricas")
Output:
-((d*f*x + c*f)*Ei(-2*(d*f*x + c*f)/d)*cosh(f*x + e)*sinh(-2*(d*e - c*f)/d ) + ((d*f*x + c*f)*Ei(-2*(d*f*x + c*f)/d)*cosh(-2*(d*e - c*f)/d) + d)*cosh (f*x + e) + ((d*f*x + c*f)*Ei(-2*(d*f*x + c*f)/d)*cosh(-2*(d*e - c*f)/d) + (d*f*x + c*f)*Ei(-2*(d*f*x + c*f)/d)*sinh(-2*(d*e - c*f)/d))*sinh(f*x + e ))/((a*d^3*x + a*c*d^2)*cosh(f*x + e) + (a*d^3*x + a*c*d^2)*sinh(f*x + e))
\[ \int \frac {1}{(c+d x)^2 (a+a \tanh (e+f x))} \, dx=\frac {\int \frac {1}{c^{2} \tanh {\left (e + f x \right )} + c^{2} + 2 c d x \tanh {\left (e + f x \right )} + 2 c d x + d^{2} x^{2} \tanh {\left (e + f x \right )} + d^{2} x^{2}}\, dx}{a} \] Input:
integrate(1/(d*x+c)**2/(a+a*tanh(f*x+e)),x)
Output:
Integral(1/(c**2*tanh(e + f*x) + c**2 + 2*c*d*x*tanh(e + f*x) + 2*c*d*x + d**2*x**2*tanh(e + f*x) + d**2*x**2), x)/a
Time = 0.37 (sec) , antiderivative size = 56, normalized size of antiderivative = 0.35 \[ \int \frac {1}{(c+d x)^2 (a+a \tanh (e+f x))} \, dx=-\frac {1}{2 \, {\left (a d^{2} x + a c d\right )}} - \frac {e^{\left (-2 \, e + \frac {2 \, c f}{d}\right )} E_{2}\left (\frac {2 \, {\left (d x + c\right )} f}{d}\right )}{2 \, {\left (d x + c\right )} a d} \] Input:
integrate(1/(d*x+c)^2/(a+a*tanh(f*x+e)),x, algorithm="maxima")
Output:
-1/2/(a*d^2*x + a*c*d) - 1/2*e^(-2*e + 2*c*f/d)*exp_integral_e(2, 2*(d*x + c)*f/d)/((d*x + c)*a*d)
Leaf count of result is larger than twice the leaf count of optimal. 320 vs. \(2 (159) = 318\).
Time = 0.17 (sec) , antiderivative size = 320, normalized size of antiderivative = 2.01 \[ \int \frac {1}{(c+d x)^2 (a+a \tanh (e+f x))} \, dx=-\frac {{\left (2 \, {\left (d x + c\right )} {\left (\frac {d e}{d x + c} - \frac {c f}{d x + c} + f\right )} f^{2} {\rm Ei}\left (-\frac {2 \, {\left ({\left (d x + c\right )} {\left (\frac {d e}{d x + c} - \frac {c f}{d x + c} + f\right )} - d e + c f\right )}}{d}\right ) e^{\left (-\frac {2 \, {\left (d e - c f\right )}}{d}\right )} - 2 \, d e f^{2} {\rm Ei}\left (-\frac {2 \, {\left ({\left (d x + c\right )} {\left (\frac {d e}{d x + c} - \frac {c f}{d x + c} + f\right )} - d e + c f\right )}}{d}\right ) e^{\left (-\frac {2 \, {\left (d e - c f\right )}}{d}\right )} + 2 \, c f^{3} {\rm Ei}\left (-\frac {2 \, {\left ({\left (d x + c\right )} {\left (\frac {d e}{d x + c} - \frac {c f}{d x + c} + f\right )} - d e + c f\right )}}{d}\right ) e^{\left (-\frac {2 \, {\left (d e - c f\right )}}{d}\right )} + d f^{2} e^{\left (-\frac {2 \, {\left (d x + c\right )} {\left (\frac {d e}{d x + c} - \frac {c f}{d x + c} + f\right )}}{d}\right )} + d f^{2}\right )} d^{2}}{2 \, {\left ({\left (d x + c\right )} a d^{4} {\left (\frac {d e}{d x + c} - \frac {c f}{d x + c} + f\right )} - a d^{5} e + a c d^{4} f\right )} f} \] Input:
integrate(1/(d*x+c)^2/(a+a*tanh(f*x+e)),x, algorithm="giac")
Output:
-1/2*(2*(d*x + c)*(d*e/(d*x + c) - c*f/(d*x + c) + f)*f^2*Ei(-2*((d*x + c) *(d*e/(d*x + c) - c*f/(d*x + c) + f) - d*e + c*f)/d)*e^(-2*(d*e - c*f)/d) - 2*d*e*f^2*Ei(-2*((d*x + c)*(d*e/(d*x + c) - c*f/(d*x + c) + f) - d*e + c *f)/d)*e^(-2*(d*e - c*f)/d) + 2*c*f^3*Ei(-2*((d*x + c)*(d*e/(d*x + c) - c* f/(d*x + c) + f) - d*e + c*f)/d)*e^(-2*(d*e - c*f)/d) + d*f^2*e^(-2*(d*x + c)*(d*e/(d*x + c) - c*f/(d*x + c) + f)/d) + d*f^2)*d^2/(((d*x + c)*a*d^4* (d*e/(d*x + c) - c*f/(d*x + c) + f) - a*d^5*e + a*c*d^4*f)*f)
Timed out. \[ \int \frac {1}{(c+d x)^2 (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 )}^2} \,d x \] Input:
int(1/((a + a*tanh(e + f*x))*(c + d*x)^2),x)
Output:
int(1/((a + a*tanh(e + f*x))*(c + d*x)^2), x)
\[ \int \frac {1}{(c+d x)^2 (a+a \tanh (e+f x))} \, dx=\frac {\left (\int \frac {1}{e^{2 f x +2 e} c^{2}+2 e^{2 f x +2 e} c d x +e^{2 f x +2 e} d^{2} x^{2}}d x \right ) c^{2}+\left (\int \frac {1}{e^{2 f x +2 e} c^{2}+2 e^{2 f x +2 e} c d x +e^{2 f x +2 e} d^{2} x^{2}}d x \right ) c d x +x}{2 a c \left (d x +c \right )} \] Input:
int(1/(d*x+c)^2/(a+a*tanh(f*x+e)),x)
Output:
(int(1/(e**(2*e + 2*f*x)*c**2 + 2*e**(2*e + 2*f*x)*c*d*x + e**(2*e + 2*f*x )*d**2*x**2),x)*c**2 + int(1/(e**(2*e + 2*f*x)*c**2 + 2*e**(2*e + 2*f*x)*c *d*x + e**(2*e + 2*f*x)*d**2*x**2),x)*c*d*x + x)/(2*a*c*(c + d*x))