3.43 \(\int (a+a \tanh (c+d x))^3 \, dx\)

Optimal. Leaf size=56 \[ -\frac {2 a^3 \tanh (c+d x)}{d}+\frac {4 a^3 \log (\cosh (c+d x))}{d}+4 a^3 x-\frac {a (a \tanh (c+d x)+a)^2}{2 d} \]

[Out]

4*a^3*x+4*a^3*ln(cosh(d*x+c))/d-2*a^3*tanh(d*x+c)/d-1/2*a*(a+a*tanh(d*x+c))^2/d

________________________________________________________________________________________

Rubi [A]  time = 0.04, antiderivative size = 56, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.250, Rules used = {3478, 3477, 3475} \[ -\frac {2 a^3 \tanh (c+d x)}{d}+\frac {4 a^3 \log (\cosh (c+d x))}{d}+4 a^3 x-\frac {a (a \tanh (c+d x)+a)^2}{2 d} \]

Antiderivative was successfully verified.

[In]

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

[Out]

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

Rule 3475

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rule 3477

Int[((a_) + (b_.)*tan[(c_.) + (d_.)*(x_)])^2, x_Symbol] :> Simp[(a^2 - b^2)*x, x] + (Dist[2*a*b, Int[Tan[c + d
*x], x], x] + Simp[(b^2*Tan[c + d*x])/d, x]) /; FreeQ[{a, b, c, d}, x]

Rule 3478

Int[((a_) + (b_.)*tan[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[(b*(a + b*Tan[c + d*x])^(n - 1))/(d*(n - 1)
), x] + Dist[2*a, Int[(a + b*Tan[c + d*x])^(n - 1), x], x] /; FreeQ[{a, b, c, d}, x] && EqQ[a^2 + b^2, 0] && G
tQ[n, 1]

Rubi steps

\begin {align*} \int (a+a \tanh (c+d x))^3 \, dx &=-\frac {a (a+a \tanh (c+d x))^2}{2 d}+(2 a) \int (a+a \tanh (c+d x))^2 \, dx\\ &=4 a^3 x-\frac {2 a^3 \tanh (c+d x)}{d}-\frac {a (a+a \tanh (c+d x))^2}{2 d}+\left (4 a^3\right ) \int \tanh (c+d x) \, dx\\ &=4 a^3 x+\frac {4 a^3 \log (\cosh (c+d x))}{d}-\frac {2 a^3 \tanh (c+d x)}{d}-\frac {a (a+a \tanh (c+d x))^2}{2 d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.97, size = 103, normalized size = 1.84 \[ \frac {a^3 \text {sech}(c) \text {sech}^2(c+d x) (-3 \sinh (c+2 d x)+2 d x \cosh (3 c+2 d x)+2 \cosh (3 c+2 d x) \log (\cosh (c+d x))+2 \cosh (c+2 d x) (\log (\cosh (c+d x))+d x)+\cosh (c) (4 \log (\cosh (c+d x))+4 d x+1)+3 \sinh (c))}{2 d} \]

Antiderivative was successfully verified.

[In]

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

[Out]

(a^3*Sech[c]*Sech[c + d*x]^2*(2*d*x*Cosh[3*c + 2*d*x] + 2*Cosh[3*c + 2*d*x]*Log[Cosh[c + d*x]] + 2*Cosh[c + 2*
d*x]*(d*x + Log[Cosh[c + d*x]]) + Cosh[c]*(1 + 4*d*x + 4*Log[Cosh[c + d*x]]) + 3*Sinh[c] - 3*Sinh[c + 2*d*x]))
/(2*d)

________________________________________________________________________________________

fricas [B]  time = 0.51, size = 299, normalized size = 5.34 \[ \frac {2 \, {\left (4 \, a^{3} \cosh \left (d x + c\right )^{2} + 8 \, a^{3} \cosh \left (d x + c\right ) \sinh \left (d x + c\right ) + 4 \, a^{3} \sinh \left (d x + c\right )^{2} + 3 \, a^{3} + 2 \, {\left (a^{3} \cosh \left (d x + c\right )^{4} + 4 \, a^{3} \cosh \left (d x + c\right ) \sinh \left (d x + c\right )^{3} + a^{3} \sinh \left (d x + c\right )^{4} + 2 \, a^{3} \cosh \left (d x + c\right )^{2} + a^{3} + 2 \, {\left (3 \, a^{3} \cosh \left (d x + c\right )^{2} + a^{3}\right )} \sinh \left (d x + c\right )^{2} + 4 \, {\left (a^{3} \cosh \left (d x + c\right )^{3} + a^{3} \cosh \left (d x + c\right )\right )} \sinh \left (d x + c\right )\right )} \log \left (\frac {2 \, \cosh \left (d x + c\right )}{\cosh \left (d x + c\right ) - \sinh \left (d x + c\right )}\right )\right )}}{d \cosh \left (d x + c\right )^{4} + 4 \, d \cosh \left (d x + c\right ) \sinh \left (d x + c\right )^{3} + d \sinh \left (d x + c\right )^{4} + 2 \, d \cosh \left (d x + c\right )^{2} + 2 \, {\left (3 \, d \cosh \left (d x + c\right )^{2} + d\right )} \sinh \left (d x + c\right )^{2} + 4 \, {\left (d \cosh \left (d x + c\right )^{3} + d \cosh \left (d x + c\right )\right )} \sinh \left (d x + c\right ) + d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

2*(4*a^3*cosh(d*x + c)^2 + 8*a^3*cosh(d*x + c)*sinh(d*x + c) + 4*a^3*sinh(d*x + c)^2 + 3*a^3 + 2*(a^3*cosh(d*x
 + c)^4 + 4*a^3*cosh(d*x + c)*sinh(d*x + c)^3 + a^3*sinh(d*x + c)^4 + 2*a^3*cosh(d*x + c)^2 + a^3 + 2*(3*a^3*c
osh(d*x + c)^2 + a^3)*sinh(d*x + c)^2 + 4*(a^3*cosh(d*x + c)^3 + a^3*cosh(d*x + c))*sinh(d*x + c))*log(2*cosh(
d*x + c)/(cosh(d*x + c) - sinh(d*x + c))))/(d*cosh(d*x + c)^4 + 4*d*cosh(d*x + c)*sinh(d*x + c)^3 + d*sinh(d*x
 + c)^4 + 2*d*cosh(d*x + c)^2 + 2*(3*d*cosh(d*x + c)^2 + d)*sinh(d*x + c)^2 + 4*(d*cosh(d*x + c)^3 + d*cosh(d*
x + c))*sinh(d*x + c) + d)

________________________________________________________________________________________

giac [A]  time = 0.13, size = 57, normalized size = 1.02 \[ \frac {2 \, {\left (2 \, a^{3} \log \left (e^{\left (2 \, d x + 2 \, c\right )} + 1\right ) + \frac {4 \, a^{3} e^{\left (2 \, d x + 2 \, c\right )} + 3 \, a^{3}}{{\left (e^{\left (2 \, d x + 2 \, c\right )} + 1\right )}^{2}}\right )}}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maple [A]  time = 0.01, size = 49, normalized size = 0.88 \[ -\frac {a^{3} \left (\tanh ^{2}\left (d x +c \right )\right )}{2 d}-\frac {3 a^{3} \tanh \left (d x +c \right )}{d}-\frac {4 a^{3} \ln \left (\tanh \left (d x +c \right )-1\right )}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maxima [B]  time = 0.41, size = 116, normalized size = 2.07 \[ a^{3} {\left (x + \frac {c}{d} + \frac {\log \left (e^{\left (-2 \, d x - 2 \, c\right )} + 1\right )}{d} + \frac {2 \, e^{\left (-2 \, d x - 2 \, c\right )}}{d {\left (2 \, e^{\left (-2 \, d x - 2 \, c\right )} + e^{\left (-4 \, d x - 4 \, c\right )} + 1\right )}}\right )} + 3 \, a^{3} {\left (x + \frac {c}{d} - \frac {2}{d {\left (e^{\left (-2 \, d x - 2 \, c\right )} + 1\right )}}\right )} + a^{3} x + \frac {3 \, a^{3} \log \left (\cosh \left (d x + c\right )\right )}{d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

mupad [B]  time = 0.09, size = 43, normalized size = 0.77 \[ 8\,a^3\,x-\frac {a^3\,\left (8\,\ln \left (\mathrm {tanh}\left (c+d\,x\right )+1\right )+6\,\mathrm {tanh}\left (c+d\,x\right )+{\mathrm {tanh}\left (c+d\,x\right )}^2\right )}{2\,d} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

8*a^3*x - (a^3*(8*log(tanh(c + d*x) + 1) + 6*tanh(c + d*x) + tanh(c + d*x)^2))/(2*d)

________________________________________________________________________________________

sympy [A]  time = 0.23, size = 61, normalized size = 1.09 \[ \begin {cases} 8 a^{3} x - \frac {4 a^{3} \log {\left (\tanh {\left (c + d x \right )} + 1 \right )}}{d} - \frac {a^{3} \tanh ^{2}{\left (c + d x \right )}}{2 d} - \frac {3 a^{3} \tanh {\left (c + d x \right )}}{d} & \text {for}\: d \neq 0 \\x \left (a \tanh {\relax (c )} + a\right )^{3} & \text {otherwise} \end {cases} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

Piecewise((8*a**3*x - 4*a**3*log(tanh(c + d*x) + 1)/d - a**3*tanh(c + d*x)**2/(2*d) - 3*a**3*tanh(c + d*x)/d,
Ne(d, 0)), (x*(a*tanh(c) + a)**3, True))

________________________________________________________________________________________