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

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

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.11458, antiderivative size = 66, 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{a^2 \log \left (a+b \tanh ^2(c+d x)\right )}{2 b^2 d (a+b)}+\frac{\log (\cosh (c+d x))}{d (a+b)}-\frac{\tanh ^2(c+d x)}{2 b d}$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

Log[Cosh[c + d*x]]/((a + b)*d) + (a^2*Log[a + b*Tanh[c + d*x]^2])/(2*b^2*(a + b)*d) - Tanh[c + d*x]^2/(2*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 ^5(c+d x)}{a+b \tanh ^2(c+d x)} \, dx &=\frac{\operatorname{Subst}\left (\int \frac{x^5}{\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^2}{(1-x) (a+b x)} \, dx,x,\tanh ^2(c+d x)\right )}{2 d}\\ &=\frac{\operatorname{Subst}\left (\int \left (-\frac{1}{b}-\frac{1}{(a+b) (-1+x)}+\frac{a^2}{b (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^2 \log \left (a+b \tanh ^2(c+d x)\right )}{2 b^2 (a+b) d}-\frac{\tanh ^2(c+d x)}{2 b d}\\ \end{align*}

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

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [A]  time = 0.018, size = 93, normalized size = 1.4 \begin{align*} -{\frac{ \left ( \tanh \left ( dx+c \right ) \right ) ^{2}}{2\,bd}}-{\frac{\ln \left ( \tanh \left ( dx+c \right ) +1 \right ) }{d \left ( 2\,b+2\,a \right ) }}+{\frac{{a}^{2}\ln \left ( a+b \left ( \tanh \left ( dx+c \right ) \right ) ^{2} \right ) }{2\,{b}^{2} \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)^5/(a+b*tanh(d*x+c)^2),x)

[Out]

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

________________________________________________________________________________________

Maxima [B]  time = 1.57601, size = 180, normalized size = 2.73 \begin{align*} \frac{a^{2} \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^{2} + b^{3}\right )} d} + \frac{d x + c}{{\left (a + b\right )} d} + \frac{2 \, e^{\left (-2 \, d x - 2 \, c\right )}}{{\left (2 \, b e^{\left (-2 \, d x - 2 \, c\right )} + b e^{\left (-4 \, d x - 4 \, c\right )} + b\right )} d} - \frac{{\left (a - b\right )} \log \left (e^{\left (-2 \, d x - 2 \, c\right )} + 1\right )}{b^{2} d} \end{align*}

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

[In]

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

[Out]

1/2*a^2*log(2*(a - b)*e^(-2*d*x - 2*c) + (a + b)*e^(-4*d*x - 4*c) + a + b)/((a*b^2 + b^3)*d) + (d*x + c)/((a +
b)*d) + 2*e^(-2*d*x - 2*c)/((2*b*e^(-2*d*x - 2*c) + b*e^(-4*d*x - 4*c) + b)*d) - (a - b)*log(e^(-2*d*x - 2*c)
+ 1)/(b^2*d)

________________________________________________________________________________________

Fricas [B]  time = 3.05674, size = 1817, normalized size = 27.53 \begin{align*} \text{result too large to display} \end{align*}

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

[In]

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

[Out]

-1/2*(2*b^2*d*x*cosh(d*x + c)^4 + 8*b^2*d*x*cosh(d*x + c)*sinh(d*x + c)^3 + 2*b^2*d*x*sinh(d*x + c)^4 + 2*b^2*
d*x + 4*(b^2*d*x - a*b - b^2)*cosh(d*x + c)^2 + 4*(3*b^2*d*x*cosh(d*x + c)^2 + b^2*d*x - a*b - b^2)*sinh(d*x +
c)^2 - (a^2*cosh(d*x + c)^4 + 4*a^2*cosh(d*x + c)*sinh(d*x + c)^3 + a^2*sinh(d*x + c)^4 + 2*a^2*cosh(d*x + c)
^2 + 2*(3*a^2*cosh(d*x + c)^2 + a^2)*sinh(d*x + c)^2 + a^2 + 4*(a^2*cosh(d*x + c)^3 + a^2*cosh(d*x + c))*sinh(
d*x + c))*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^2 - b^2)*cosh(d*x + c)^4 + 4*(a^2 - b^2)*cosh(d*x + c)*sinh(d*x + c
)^3 + (a^2 - b^2)*sinh(d*x + c)^4 + 2*(a^2 - b^2)*cosh(d*x + c)^2 + 2*(3*(a^2 - b^2)*cosh(d*x + c)^2 + a^2 - b
^2)*sinh(d*x + c)^2 + a^2 - b^2 + 4*((a^2 - b^2)*cosh(d*x + c)^3 + (a^2 - b^2)*cosh(d*x + c))*sinh(d*x + c))*l
og(2*cosh(d*x + c)/(cosh(d*x + c) - sinh(d*x + c))) + 8*(b^2*d*x*cosh(d*x + c)^3 + (b^2*d*x - a*b - b^2)*cosh(
d*x + c))*sinh(d*x + c))/((a*b^2 + b^3)*d*cosh(d*x + c)^4 + 4*(a*b^2 + b^3)*d*cosh(d*x + c)*sinh(d*x + c)^3 +
(a*b^2 + b^3)*d*sinh(d*x + c)^4 + 2*(a*b^2 + b^3)*d*cosh(d*x + c)^2 + 2*(3*(a*b^2 + b^3)*d*cosh(d*x + c)^2 + (
a*b^2 + b^3)*d)*sinh(d*x + c)^2 + (a*b^2 + b^3)*d + 4*((a*b^2 + b^3)*d*cosh(d*x + c)^3 + (a*b^2 + b^3)*d*cosh(
d*x + c))*sinh(d*x + c))

________________________________________________________________________________________

Sympy [A]  time = 39.4481, size = 425, normalized size = 6.44 \begin{align*} \begin{cases} \tilde{\infty } x \tanh ^{3}{\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 ^{4}{\left (c + d x \right )}}{4 d} - \frac{\tanh ^{2}{\left (c + d x \right )}}{2 d}}{a} & \text{for}\: b = 0 \\\frac{4 d x \tanh ^{2}{\left (c + d x \right )}}{2 b d \tanh ^{2}{\left (c + d x \right )} - 2 b d} - \frac{4 d x}{2 b d \tanh ^{2}{\left (c + d x \right )} - 2 b d} - \frac{4 \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{4 \log{\left (\tanh{\left (c + d x \right )} + 1 \right )}}{2 b d \tanh ^{2}{\left (c + d x \right )} - 2 b d} - \frac{\tanh ^{4}{\left (c + d x \right )}}{2 b d \tanh ^{2}{\left (c + d x \right )} - 2 b d} + \frac{2}{2 b d \tanh ^{2}{\left (c + d x \right )} - 2 b d} & \text{for}\: a = - b \\\frac{x \tanh ^{5}{\left (c \right )}}{a + b \tanh ^{2}{\left (c \right )}} & \text{for}\: d = 0 \\\frac{a^{2} \log{\left (- i \sqrt{a} \sqrt{\frac{1}{b}} + \tanh{\left (c + d x \right )} \right )}}{2 a b^{2} d + 2 b^{3} d} + \frac{a^{2} \log{\left (i \sqrt{a} \sqrt{\frac{1}{b}} + \tanh{\left (c + d x \right )} \right )}}{2 a b^{2} d + 2 b^{3} d} - \frac{a b \tanh ^{2}{\left (c + d x \right )}}{2 a b^{2} d + 2 b^{3} d} + \frac{2 b^{2} d x}{2 a b^{2} d + 2 b^{3} d} - \frac{2 b^{2} \log{\left (\tanh{\left (c + d x \right )} + 1 \right )}}{2 a b^{2} d + 2 b^{3} d} - \frac{b^{2} \tanh ^{2}{\left (c + d x \right )}}{2 a b^{2} d + 2 b^{3} d} & \text{otherwise} \end{cases} \end{align*}

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

[In]

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

[Out]

Piecewise((zoo*x*tanh(c)**3, Eq(a, 0) & Eq(b, 0) & Eq(d, 0)), ((x - log(tanh(c + d*x) + 1)/d - tanh(c + d*x)**
4/(4*d) - tanh(c + d*x)**2/(2*d))/a, Eq(b, 0)), (4*d*x*tanh(c + d*x)**2/(2*b*d*tanh(c + d*x)**2 - 2*b*d) - 4*d
*x/(2*b*d*tanh(c + d*x)**2 - 2*b*d) - 4*log(tanh(c + d*x) + 1)*tanh(c + d*x)**2/(2*b*d*tanh(c + d*x)**2 - 2*b*
d) + 4*log(tanh(c + d*x) + 1)/(2*b*d*tanh(c + d*x)**2 - 2*b*d) - tanh(c + d*x)**4/(2*b*d*tanh(c + d*x)**2 - 2*
b*d) + 2/(2*b*d*tanh(c + d*x)**2 - 2*b*d), Eq(a, -b)), (x*tanh(c)**5/(a + b*tanh(c)**2), Eq(d, 0)), (a**2*log(
-I*sqrt(a)*sqrt(1/b) + tanh(c + d*x))/(2*a*b**2*d + 2*b**3*d) + a**2*log(I*sqrt(a)*sqrt(1/b) + tanh(c + d*x))/
(2*a*b**2*d + 2*b**3*d) - a*b*tanh(c + d*x)**2/(2*a*b**2*d + 2*b**3*d) + 2*b**2*d*x/(2*a*b**2*d + 2*b**3*d) -
2*b**2*log(tanh(c + d*x) + 1)/(2*a*b**2*d + 2*b**3*d) - b**2*tanh(c + d*x)**2/(2*a*b**2*d + 2*b**3*d), True))

________________________________________________________________________________________

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

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

[In]

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

[Out]

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