### 3.172 $$\int \frac{\tanh ^3(c+d x)}{a+b \tanh ^2(c+d x)} \, dx$$

Optimal. Leaf size=46 $\frac{\log (\cosh (c+d x))}{d (a+b)}-\frac{a \log \left (a+b \tanh ^2(c+d x)\right )}{2 b d (a+b)}$

[Out]

Log[Cosh[c + d*x]]/((a + b)*d) - (a*Log[a + b*Tanh[c + d*x]^2])/(2*b*(a + b)*d)

________________________________________________________________________________________

Rubi [A]  time = 0.103652, antiderivative size = 46, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 23, $$\frac{\text{number of rules}}{\text{integrand size}}$$ = 0.13, Rules used = {3670, 446, 72} $\frac{\log (\cosh (c+d x))}{d (a+b)}-\frac{a \log \left (a+b \tanh ^2(c+d x)\right )}{2 b d (a+b)}$

Antiderivative was successfully veriﬁed.

[In]

Int[Tanh[c + d*x]^3/(a + b*Tanh[c + d*x]^2),x]

[Out]

Log[Cosh[c + d*x]]/((a + b)*d) - (a*Log[a + b*Tanh[c + d*x]^2])/(2*b*(a + b)*d)

Rule 3670

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]}, Dist[(c*ff)/f, Subst[Int[(((d*ff*x)/c)^m*(a + b*(ff*x)^n)^p)/(c^
2 + ff^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] && RationalQ[n]))

Rule 446

Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.)*((c_) + (d_.)*(x_)^(n_))^(q_.), x_Symbol] :> Dist[1/n, Subst[Int
[x^(Simplify[(m + 1)/n] - 1)*(a + b*x)^p*(c + d*x)^q, x], x, x^n], x] /; FreeQ[{a, b, c, d, m, n, p, q}, x] &&
NeQ[b*c - a*d, 0] && IntegerQ[Simplify[(m + 1)/n]]

Rule 72

Int[((e_.) + (f_.)*(x_))^(p_.)/(((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))), x_Symbol] :> Int[ExpandIntegrand[(
e + f*x)^p/((a + b*x)*(c + d*x)), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && IntegerQ[p]

Rubi steps

\begin{align*} \int \frac{\tanh ^3(c+d x)}{a+b \tanh ^2(c+d x)} \, dx &=\frac{\operatorname{Subst}\left (\int \frac{x^3}{\left (1-x^2\right ) \left (a+b x^2\right )} \, dx,x,\tanh (c+d x)\right )}{d}\\ &=\frac{\operatorname{Subst}\left (\int \frac{x}{(1-x) (a+b x)} \, dx,x,\tanh ^2(c+d x)\right )}{2 d}\\ &=\frac{\operatorname{Subst}\left (\int \left (-\frac{1}{(a+b) (-1+x)}-\frac{a}{(a+b) (a+b x)}\right ) \, dx,x,\tanh ^2(c+d x)\right )}{2 d}\\ &=\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}\\ \end{align*}

Mathematica [A]  time = 0.0343482, size = 42, normalized size = 0.91 $\frac{2 b \log (\cosh (c+d x))-a \log \left (a+b \tanh ^2(c+d x)\right )}{2 a b d+2 b^2 d}$

Antiderivative was successfully veriﬁed.

[In]

Integrate[Tanh[c + d*x]^3/(a + b*Tanh[c + d*x]^2),x]

[Out]

(2*b*Log[Cosh[c + d*x]] - a*Log[a + b*Tanh[c + d*x]^2])/(2*a*b*d + 2*b^2*d)

________________________________________________________________________________________

Maple [A]  time = 0.017, size = 75, normalized size = 1.6 \begin{align*} -{\frac{\ln \left ( \tanh \left ( dx+c \right ) +1 \right ) }{d \left ( 2\,b+2\,a \right ) }}-{\frac{a\ln \left ( a+b \left ( \tanh \left ( dx+c \right ) \right ) ^{2} \right ) }{2\,b \left ( a+b \right ) d}}-{\frac{\ln \left ( \tanh \left ( dx+c \right ) -1 \right ) }{d \left ( 2\,b+2\,a \right ) }} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

int(tanh(d*x+c)^3/(a+b*tanh(d*x+c)^2),x)

[Out]

-1/d/(2*b+2*a)*ln(tanh(d*x+c)+1)-1/2*a*ln(a+b*tanh(d*x+c)^2)/b/(a+b)/d-1/d/(2*b+2*a)*ln(tanh(d*x+c)-1)

________________________________________________________________________________________

Maxima [A]  time = 1.5482, size = 111, normalized size = 2.41 \begin{align*} -\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} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

integrate(tanh(d*x+c)^3/(a+b*tanh(d*x+c)^2),x, algorithm="maxima")

[Out]

-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)

________________________________________________________________________________________

Fricas [B]  time = 2.43452, size = 319, normalized size = 6.93 \begin{align*} -\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} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

integrate(tanh(d*x+c)^3/(a+b*tanh(d*x+c)^2),x, algorithm="fricas")

[Out]

-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)

________________________________________________________________________________________

Sympy [A]  time = 18.753, size = 316, normalized size = 6.87 \begin{align*} \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 (- i \sqrt{a} \sqrt{\frac{1}{b}} + \tanh{\left (c + d x \right )} \right )}}{2 a b d + 2 b^{2} d} - \frac{a \log{\left (i \sqrt{a} \sqrt{\frac{1}{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} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

integrate(tanh(d*x+c)**3/(a+b*tanh(d*x+c)**2),x)

[Out]

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(-I*sqrt(a)*sqrt(1/b) + tanh(c + d*x))/(2*a*b*d + 2*b**2*d) - a*log(I*sqrt(a)*sqrt(
1/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))

________________________________________________________________________________________

Giac [B]  time = 1.21236, size = 136, normalized size = 2.96 \begin{align*} -\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 )}{2 \,{\left (a b d + b^{2} d\right )}} - \frac{d x + c}{a d + b d} + \frac{\log \left (e^{\left (2 \, d x + 2 \, c\right )} + 1\right )}{b d} \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

integrate(tanh(d*x+c)^3/(a+b*tanh(d*x+c)^2),x, algorithm="giac")

[Out]

-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*d +
b^2*d) - (d*x + c)/(a*d + b*d) + log(e^(2*d*x + 2*c) + 1)/(b*d)