Integrand size = 23, antiderivative size = 46 \[ \int \frac {\tanh ^3(c+d x)}{a+b \tanh ^2(c+d x)} \, dx=\frac {\log (\cosh (c+d x))}{(a+b) d}-\frac {a \log \left (a+b \tanh ^2(c+d x)\right )}{2 b (a+b) d} \] Output:
ln(cosh(d*x+c))/(a+b)/d-1/2*a*ln(a+b*tanh(d*x+c)^2)/b/(a+b)/d
Time = 0.03 (sec) , antiderivative size = 44, normalized size of antiderivative = 0.96 \[ \int \frac {\tanh ^3(c+d x)}{a+b \tanh ^2(c+d x)} \, dx=\frac {\frac {\log (\cosh (c+d x))}{a+b}-\frac {a \log \left (a+b \tanh ^2(c+d x)\right )}{2 b (a+b)}}{d} \] Input:
Integrate[Tanh[c + d*x]^3/(a + b*Tanh[c + d*x]^2),x]
Output:
(Log[Cosh[c + d*x]]/(a + b) - (a*Log[a + b*Tanh[c + d*x]^2])/(2*b*(a + b)) )/d
Time = 0.48 (sec) , antiderivative size = 52, normalized size of antiderivative = 1.13, number of steps used = 8, number of rules used = 7, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.304, Rules used = {3042, 26, 4153, 26, 354, 86, 2009}
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 {\tanh ^3(c+d x)}{a+b \tanh ^2(c+d x)} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {i \tan (i c+i d x)^3}{a-b \tan (i c+i d x)^2}dx\) |
\(\Big \downarrow \) 26 |
\(\displaystyle i \int \frac {\tan (i c+i d x)^3}{a-b \tan (i c+i d x)^2}dx\) |
\(\Big \downarrow \) 4153 |
\(\displaystyle \frac {i \int -\frac {i \tanh ^3(c+d x)}{\left (1-\tanh ^2(c+d x)\right ) \left (b \tanh ^2(c+d x)+a\right )}d\tanh (c+d x)}{d}\) |
\(\Big \downarrow \) 26 |
\(\displaystyle \frac {\int \frac {\tanh ^3(c+d x)}{\left (1-\tanh ^2(c+d x)\right ) \left (b \tanh ^2(c+d x)+a\right )}d\tanh (c+d x)}{d}\) |
\(\Big \downarrow \) 354 |
\(\displaystyle \frac {\int \frac {\tanh ^2(c+d x)}{\left (1-\tanh ^2(c+d x)\right ) \left (b \tanh ^2(c+d x)+a\right )}d\tanh ^2(c+d x)}{2 d}\) |
\(\Big \downarrow \) 86 |
\(\displaystyle \frac {\int \left (-\frac {a}{(a+b) \left (b \tanh ^2(c+d x)+a\right )}-\frac {1}{(a+b) \left (\tanh ^2(c+d x)-1\right )}\right )d\tanh ^2(c+d x)}{2 d}\) |
\(\Big \downarrow \) 2009 |
\(\displaystyle \frac {-\frac {\log \left (1-\tanh ^2(c+d x)\right )}{a+b}-\frac {a \log \left (a+b \tanh ^2(c+d x)\right )}{b (a+b)}}{2 d}\) |
Input:
Int[Tanh[c + d*x]^3/(a + b*Tanh[c + d*x]^2),x]
Output:
(-(Log[1 - Tanh[c + d*x]^2]/(a + b)) - (a*Log[a + b*Tanh[c + d*x]^2])/(b*( a + b)))/(2*d)
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[((a_.) + (b_.)*(x_))*((c_) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_ .), x_] :> Int[ExpandIntegrand[(a + b*x)*(c + d*x)^n*(e + f*x)^p, x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] && ((ILtQ[n, 0] && ILtQ[p, 0]) || EqQ[p, 1 ] || (IGtQ[p, 0] && ( !IntegerQ[n] || LeQ[9*p + 5*(n + 2), 0] || GeQ[n + p + 1, 0] || (GeQ[n + p + 2, 0] && RationalQ[a, b, c, d, e, f]))))
Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^2)^(p_.)*((c_) + (d_.)*(x_)^2)^(q_.), x_S ymbol] :> Simp[1/2 Subst[Int[x^((m - 1)/2)*(a + b*x)^p*(c + d*x)^q, x], x , x^2], x] /; FreeQ[{a, b, c, d, p, q}, x] && NeQ[b*c - a*d, 0] && IntegerQ [(m - 1)/2]
Int[((d_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*((c_.)*tan[(e_.) + (f_.)*(x_)])^(n_))^(p_.), x_Symbol] :> With[{ff = FreeFactors[Tan[e + f*x], x]}, Simp[c*(ff/f) Subst[Int[(d*ff*(x/c))^m*((a + b*(ff*x)^n)^p/(c^2 + f f^2*x^2)), x], x, c*(Tan[e + f*x]/ff)], x]] /; FreeQ[{a, b, c, d, e, f, m, n, p}, x] && (IGtQ[p, 0] || EqQ[n, 2] || EqQ[n, 4] || (IntegerQ[p] && Ratio nalQ[n]))
Time = 0.06 (sec) , antiderivative size = 49, normalized size of antiderivative = 1.07
method | result | size |
parallelrisch | \(-\frac {2 b d x +2 \ln \left (1-\tanh \left (d x +c \right )\right ) b +a \ln \left (a +b \tanh \left (d x +c \right )^{2}\right )}{2 d b \left (a +b \right )}\) | \(49\) |
derivativedivides | \(\frac {-\frac {a \ln \left (a +b \tanh \left (d x +c \right )^{2}\right )}{2 \left (a +b \right ) b}-\frac {\ln \left (1+\tanh \left (d x +c \right )\right )}{2 a +2 b}-\frac {\ln \left (-1+\tanh \left (d x +c \right )\right )}{2 a +2 b}}{d}\) | \(70\) |
default | \(\frac {-\frac {a \ln \left (a +b \tanh \left (d x +c \right )^{2}\right )}{2 \left (a +b \right ) b}-\frac {\ln \left (1+\tanh \left (d x +c \right )\right )}{2 a +2 b}-\frac {\ln \left (-1+\tanh \left (d x +c \right )\right )}{2 a +2 b}}{d}\) | \(70\) |
risch | \(\frac {x}{a +b}-\frac {2 x}{b}-\frac {2 c}{b d}+\frac {2 a x}{b \left (a +b \right )}+\frac {2 a c}{d b \left (a +b \right )}+\frac {\ln \left ({\mathrm e}^{2 d x +2 c}+1\right )}{b d}-\frac {a \ln \left ({\mathrm e}^{4 d x +4 c}+\frac {2 \left (a -b \right ) {\mathrm e}^{2 d x +2 c}}{a +b}+1\right )}{2 d b \left (a +b \right )}\) | \(117\) |
Input:
int(tanh(d*x+c)^3/(a+b*tanh(d*x+c)^2),x,method=_RETURNVERBOSE)
Output:
-1/2*(2*b*d*x+2*ln(1-tanh(d*x+c))*b+a*ln(a+b*tanh(d*x+c)^2))/d/b/(a+b)
Leaf count of result is larger than twice the leaf count of optimal. 118 vs. \(2 (44) = 88\).
Time = 0.12 (sec) , antiderivative size = 118, normalized size of antiderivative = 2.57 \[ \int \frac {\tanh ^3(c+d x)}{a+b \tanh ^2(c+d x)} \, dx=-\frac {2 \, b d x + a \log \left (\frac {2 \, {\left ({\left (a + b\right )} \cosh \left (d x + c\right )^{2} + {\left (a + b\right )} \sinh \left (d x + c\right )^{2} + a - b\right )}}{\cosh \left (d x + c\right )^{2} - 2 \, \cosh \left (d x + c\right ) \sinh \left (d x + c\right ) + \sinh \left (d x + c\right )^{2}}\right ) - 2 \, {\left (a + b\right )} \log \left (\frac {2 \, \cosh \left (d x + c\right )}{\cosh \left (d x + c\right ) - \sinh \left (d x + c\right )}\right )}{2 \, {\left (a b + b^{2}\right )} d} \] Input:
integrate(tanh(d*x+c)^3/(a+b*tanh(d*x+c)^2),x, algorithm="fricas")
Output:
-1/2*(2*b*d*x + a*log(2*((a + b)*cosh(d*x + c)^2 + (a + b)*sinh(d*x + c)^2 + a - b)/(cosh(d*x + c)^2 - 2*cosh(d*x + c)*sinh(d*x + c) + sinh(d*x + c) ^2)) - 2*(a + b)*log(2*cosh(d*x + c)/(cosh(d*x + c) - sinh(d*x + c))))/((a *b + b^2)*d)
Leaf count of result is larger than twice the leaf count of optimal. 306 vs. \(2 (36) = 72\).
Time = 2.51 (sec) , antiderivative size = 306, normalized size of antiderivative = 6.65 \[ \int \frac {\tanh ^3(c+d x)}{a+b \tanh ^2(c+d x)} \, dx=\begin {cases} \tilde {\infty } x \tanh {\left (c \right )} & \text {for}\: a = 0 \wedge b = 0 \wedge d = 0 \\\frac {x - \frac {\log {\left (\tanh {\left (c + d x \right )} + 1 \right )}}{d} - \frac {\tanh ^{2}{\left (c + d x \right )}}{2 d}}{a} & \text {for}\: b = 0 \\\frac {2 d x \tanh ^{2}{\left (c + d x \right )}}{2 b d \tanh ^{2}{\left (c + d x \right )} - 2 b d} - \frac {2 d x}{2 b d \tanh ^{2}{\left (c + d x \right )} - 2 b d} - \frac {2 \log {\left (\tanh {\left (c + d x \right )} + 1 \right )} \tanh ^{2}{\left (c + d x \right )}}{2 b d \tanh ^{2}{\left (c + d x \right )} - 2 b d} + \frac {2 \log {\left (\tanh {\left (c + d x \right )} + 1 \right )}}{2 b d \tanh ^{2}{\left (c + d x \right )} - 2 b d} + \frac {1}{2 b d \tanh ^{2}{\left (c + d x \right )} - 2 b d} & \text {for}\: a = - b \\\frac {x \tanh ^{3}{\left (c \right )}}{a + b \tanh ^{2}{\left (c \right )}} & \text {for}\: d = 0 \\- \frac {a \log {\left (- \sqrt {- \frac {a}{b}} + \tanh {\left (c + d x \right )} \right )}}{2 a b d + 2 b^{2} d} - \frac {a \log {\left (\sqrt {- \frac {a}{b}} + \tanh {\left (c + d x \right )} \right )}}{2 a b d + 2 b^{2} d} + \frac {2 b d x}{2 a b d + 2 b^{2} d} - \frac {2 b \log {\left (\tanh {\left (c + d x \right )} + 1 \right )}}{2 a b d + 2 b^{2} d} & \text {otherwise} \end {cases} \] Input:
integrate(tanh(d*x+c)**3/(a+b*tanh(d*x+c)**2),x)
Output:
Piecewise((zoo*x*tanh(c), Eq(a, 0) & Eq(b, 0) & Eq(d, 0)), ((x - log(tanh( c + d*x) + 1)/d - tanh(c + d*x)**2/(2*d))/a, Eq(b, 0)), (2*d*x*tanh(c + d* x)**2/(2*b*d*tanh(c + d*x)**2 - 2*b*d) - 2*d*x/(2*b*d*tanh(c + d*x)**2 - 2 *b*d) - 2*log(tanh(c + d*x) + 1)*tanh(c + d*x)**2/(2*b*d*tanh(c + d*x)**2 - 2*b*d) + 2*log(tanh(c + d*x) + 1)/(2*b*d*tanh(c + d*x)**2 - 2*b*d) + 1/( 2*b*d*tanh(c + d*x)**2 - 2*b*d), Eq(a, -b)), (x*tanh(c)**3/(a + b*tanh(c)* *2), Eq(d, 0)), (-a*log(-sqrt(-a/b) + tanh(c + d*x))/(2*a*b*d + 2*b**2*d) - a*log(sqrt(-a/b) + tanh(c + d*x))/(2*a*b*d + 2*b**2*d) + 2*b*d*x/(2*a*b* d + 2*b**2*d) - 2*b*log(tanh(c + d*x) + 1)/(2*a*b*d + 2*b**2*d), True))
Time = 0.12 (sec) , antiderivative size = 82, normalized size of antiderivative = 1.78 \[ \int \frac {\tanh ^3(c+d x)}{a+b \tanh ^2(c+d x)} \, dx=-\frac {a \log \left (2 \, {\left (a - b\right )} e^{\left (-2 \, d x - 2 \, c\right )} + {\left (a + b\right )} e^{\left (-4 \, d x - 4 \, c\right )} + a + b\right )}{2 \, {\left (a b + b^{2}\right )} d} + \frac {d x + c}{{\left (a + b\right )} d} + \frac {\log \left (e^{\left (-2 \, d x - 2 \, c\right )} + 1\right )}{b d} \] Input:
integrate(tanh(d*x+c)^3/(a+b*tanh(d*x+c)^2),x, algorithm="maxima")
Output:
-1/2*a*log(2*(a - b)*e^(-2*d*x - 2*c) + (a + b)*e^(-4*d*x - 4*c) + a + b)/ ((a*b + b^2)*d) + (d*x + c)/((a + b)*d) + log(e^(-2*d*x - 2*c) + 1)/(b*d)
Leaf count of result is larger than twice the leaf count of optimal. 96 vs. \(2 (44) = 88\).
Time = 0.16 (sec) , antiderivative size = 96, normalized size of antiderivative = 2.09 \[ \int \frac {\tanh ^3(c+d x)}{a+b \tanh ^2(c+d x)} \, dx=-\frac {\frac {a \log \left (a e^{\left (4 \, d x + 4 \, c\right )} + b e^{\left (4 \, d x + 4 \, c\right )} + 2 \, a e^{\left (2 \, d x + 2 \, c\right )} - 2 \, b e^{\left (2 \, d x + 2 \, c\right )} + a + b\right )}{a b + b^{2}} + \frac {2 \, {\left (d x + c\right )}}{a + b} - \frac {2 \, \log \left (e^{\left (2 \, d x + 2 \, c\right )} + 1\right )}{b}}{2 \, d} \] Input:
integrate(tanh(d*x+c)^3/(a+b*tanh(d*x+c)^2),x, algorithm="giac")
Output:
-1/2*(a*log(a*e^(4*d*x + 4*c) + b*e^(4*d*x + 4*c) + 2*a*e^(2*d*x + 2*c) - 2*b*e^(2*d*x + 2*c) + a + b)/(a*b + b^2) + 2*(d*x + c)/(a + b) - 2*log(e^( 2*d*x + 2*c) + 1)/b)/d
Time = 0.11 (sec) , antiderivative size = 46, normalized size of antiderivative = 1.00 \[ \int \frac {\tanh ^3(c+d x)}{a+b \tanh ^2(c+d x)} \, dx=-\frac {\frac {a\,\ln \left (b\,{\mathrm {tanh}\left (c+d\,x\right )}^2+a\right )}{2}+b\,\left (\ln \left (\mathrm {tanh}\left (c+d\,x\right )+1\right )-d\,x\right )}{b\,d\,\left (a+b\right )} \] Input:
int(tanh(c + d*x)^3/(a + b*tanh(c + d*x)^2),x)
Output:
-((a*log(a + b*tanh(c + d*x)^2))/2 + b*(log(tanh(c + d*x) + 1) - d*x))/(b* d*(a + b))
Time = 0.22 (sec) , antiderivative size = 119, normalized size of antiderivative = 2.59 \[ \int \frac {\tanh ^3(c+d x)}{a+b \tanh ^2(c+d x)} \, dx=\frac {-\mathrm {log}\left (\tanh \left (d x +c \right )^{2} b +a \right ) a -\mathrm {log}\left (\tanh \left (d x +c \right )^{2} b +a \right ) b +\mathrm {log}\left (e^{2 d x +2 c} \sqrt {a +b}+\sqrt {a +b}-2 e^{d x +c} \sqrt {b}\right ) b +\mathrm {log}\left (e^{2 d x +2 c} \sqrt {a +b}+\sqrt {a +b}+2 e^{d x +c} \sqrt {b}\right ) b -2 b d x}{2 b d \left (a +b \right )} \] Input:
int(tanh(d*x+c)^3/(a+b*tanh(d*x+c)^2),x)
Output:
( - log(tanh(c + d*x)**2*b + a)*a - log(tanh(c + d*x)**2*b + a)*b + log(e* *(2*c + 2*d*x)*sqrt(a + b) + sqrt(a + b) - 2*e**(c + d*x)*sqrt(b))*b + log (e**(2*c + 2*d*x)*sqrt(a + b) + sqrt(a + b) + 2*e**(c + d*x)*sqrt(b))*b - 2*b*d*x)/(2*b*d*(a + b))