Optimal. Leaf size=43 \[ \frac {\log \left (\cosh \left (a+b \log \left (c x^n\right )\right )\right )}{b n}-\frac {\tanh ^2\left (a+b \log \left (c x^n\right )\right )}{2 b n} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.03, antiderivative size = 43, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 2, integrand size = 17, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.118, Rules used = {3554, 3556}
\begin {gather*} \frac {\log \left (\cosh \left (a+b \log \left (c x^n\right )\right )\right )}{b n}-\frac {\tanh ^2\left (a+b \log \left (c x^n\right )\right )}{2 b n} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 3554
Rule 3556
Rubi steps
\begin {align*} \int \frac {\tanh ^3\left (a+b \log \left (c x^n\right )\right )}{x} \, dx &=\frac {\text {Subst}\left (\int \tanh ^3(a+b x) \, dx,x,\log \left (c x^n\right )\right )}{n}\\ &=-\frac {\tanh ^2\left (a+b \log \left (c x^n\right )\right )}{2 b n}+\frac {\text {Subst}\left (\int \tanh (a+b x) \, dx,x,\log \left (c x^n\right )\right )}{n}\\ &=\frac {\log \left (\cosh \left (a+b \log \left (c x^n\right )\right )\right )}{b n}-\frac {\tanh ^2\left (a+b \log \left (c x^n\right )\right )}{2 b n}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.11, size = 43, normalized size = 1.00 \begin {gather*} \frac {\log \left (\cosh \left (a+b \log \left (c x^n\right )\right )\right )}{b n}-\frac {\tanh ^2\left (a+b \log \left (c x^n\right )\right )}{2 b n} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 2.07, size = 56, normalized size = 1.30
method | result | size |
derivativedivides | \(\frac {-\frac {\left (\tanh ^{2}\left (a +b \ln \left (c \,x^{n}\right )\right )\right )}{2}-\frac {\ln \left (\tanh \left (a +b \ln \left (c \,x^{n}\right )\right )-1\right )}{2}-\frac {\ln \left (\tanh \left (a +b \ln \left (c \,x^{n}\right )\right )+1\right )}{2}}{n b}\) | \(56\) |
default | \(\frac {-\frac {\left (\tanh ^{2}\left (a +b \ln \left (c \,x^{n}\right )\right )\right )}{2}-\frac {\ln \left (\tanh \left (a +b \ln \left (c \,x^{n}\right )\right )-1\right )}{2}-\frac {\ln \left (\tanh \left (a +b \ln \left (c \,x^{n}\right )\right )+1\right )}{2}}{n b}\) | \(56\) |
risch | \(\ln \left (x \right )-\frac {2 a}{n b}-\frac {2 \ln \left (c \right )}{n}-\frac {2 \ln \left (x^{n}\right )}{n}+\frac {i \pi \mathrm {csgn}\left (i c \,x^{n}\right )^{3}}{n}-\frac {i \pi \mathrm {csgn}\left (i c \,x^{n}\right )^{2} \mathrm {csgn}\left (i c \right )}{n}-\frac {i \pi \mathrm {csgn}\left (i c \,x^{n}\right )^{2} \mathrm {csgn}\left (i x^{n}\right )}{n}+\frac {i \pi \,\mathrm {csgn}\left (i c \,x^{n}\right ) \mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i x^{n}\right )}{n}+\frac {2 \left (x^{n}\right )^{2 b} c^{2 b} {\mathrm e}^{2 a} {\mathrm e}^{-i b \pi \mathrm {csgn}\left (i c \,x^{n}\right )^{3}} {\mathrm e}^{i b \pi \mathrm {csgn}\left (i c \,x^{n}\right )^{2} \mathrm {csgn}\left (i c \right )} {\mathrm e}^{i b \pi \mathrm {csgn}\left (i c \,x^{n}\right )^{2} \mathrm {csgn}\left (i x^{n}\right )} {\mathrm e}^{-i b \pi \,\mathrm {csgn}\left (i c \,x^{n}\right ) \mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i x^{n}\right )}}{b n \left (\left (x^{n}\right )^{2 b} c^{2 b} {\mathrm e}^{2 a} {\mathrm e}^{-i b \pi \mathrm {csgn}\left (i c \,x^{n}\right )^{3}} {\mathrm e}^{i b \pi \mathrm {csgn}\left (i c \,x^{n}\right )^{2} \mathrm {csgn}\left (i c \right )} {\mathrm e}^{i b \pi \mathrm {csgn}\left (i c \,x^{n}\right )^{2} \mathrm {csgn}\left (i x^{n}\right )} {\mathrm e}^{-i b \pi \,\mathrm {csgn}\left (i c \,x^{n}\right ) \mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i x^{n}\right )}+1\right )^{2}}+\frac {\ln \left (\left (x^{n}\right )^{2 b} c^{2 b} {\mathrm e}^{2 a} {\mathrm e}^{-i b \pi \mathrm {csgn}\left (i c \,x^{n}\right )^{3}} {\mathrm e}^{i b \pi \mathrm {csgn}\left (i c \,x^{n}\right )^{2} \mathrm {csgn}\left (i c \right )} {\mathrm e}^{i b \pi \mathrm {csgn}\left (i c \,x^{n}\right )^{2} \mathrm {csgn}\left (i x^{n}\right )} {\mathrm e}^{-i b \pi \,\mathrm {csgn}\left (i c \,x^{n}\right ) \mathrm {csgn}\left (i c \right ) \mathrm {csgn}\left (i x^{n}\right )}+1\right )}{b n}\) | \(449\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 304 vs.
\(2 (41) = 82\).
time = 0.31, size = 304, normalized size = 7.07 \begin {gather*} \frac {4 \, c^{2 \, b} e^{\left (2 \, b \log \left (x^{n}\right ) + 2 \, a\right )} + 3}{4 \, {\left (b c^{4 \, b} n e^{\left (4 \, b \log \left (x^{n}\right ) + 4 \, a\right )} + 2 \, b c^{2 \, b} n e^{\left (2 \, b \log \left (x^{n}\right ) + 2 \, a\right )} + b n\right )}} - \frac {2 \, c^{2 \, b} e^{\left (2 \, b \log \left (x^{n}\right ) + 2 \, a\right )} + 3}{4 \, {\left (b c^{4 \, b} n e^{\left (4 \, b \log \left (x^{n}\right ) + 4 \, a\right )} + 2 \, b c^{2 \, b} n e^{\left (2 \, b \log \left (x^{n}\right ) + 2 \, a\right )} + b n\right )}} + \frac {3 \, {\left (2 \, c^{2 \, b} e^{\left (2 \, b \log \left (x^{n}\right ) + 2 \, a\right )} + 1\right )}}{4 \, {\left (b c^{4 \, b} n e^{\left (4 \, b \log \left (x^{n}\right ) + 4 \, a\right )} + 2 \, b c^{2 \, b} n e^{\left (2 \, b \log \left (x^{n}\right ) + 2 \, a\right )} + b n\right )}} - \frac {3}{4 \, {\left (b c^{4 \, b} n e^{\left (4 \, b \log \left (x^{n}\right ) + 4 \, a\right )} + 2 \, b c^{2 \, b} n e^{\left (2 \, b \log \left (x^{n}\right ) + 2 \, a\right )} + b n\right )}} + \frac {\log \left (\frac {{\left (c^{2 \, b} e^{\left (2 \, b \log \left (x^{n}\right ) + 2 \, a\right )} + 1\right )} e^{\left (-2 \, a\right )}}{c^{2 \, b}}\right )}{b n} - \log \left (x\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 566 vs.
\(2 (41) = 82\).
time = 0.38, size = 566, normalized size = 13.16 \begin {gather*} -\frac {b n \cosh \left (b n \log \left (x\right ) + b \log \left (c\right ) + a\right )^{4} \log \left (x\right ) + 4 \, b n \cosh \left (b n \log \left (x\right ) + b \log \left (c\right ) + a\right ) \log \left (x\right ) \sinh \left (b n \log \left (x\right ) + b \log \left (c\right ) + a\right )^{3} + b n \log \left (x\right ) \sinh \left (b n \log \left (x\right ) + b \log \left (c\right ) + a\right )^{4} + 2 \, {\left (b n \log \left (x\right ) - 1\right )} \cosh \left (b n \log \left (x\right ) + b \log \left (c\right ) + a\right )^{2} + b n \log \left (x\right ) + 2 \, {\left (3 \, b n \cosh \left (b n \log \left (x\right ) + b \log \left (c\right ) + a\right )^{2} \log \left (x\right ) + b n \log \left (x\right ) - 1\right )} \sinh \left (b n \log \left (x\right ) + b \log \left (c\right ) + a\right )^{2} - {\left (\cosh \left (b n \log \left (x\right ) + b \log \left (c\right ) + a\right )^{4} + 4 \, \cosh \left (b n \log \left (x\right ) + b \log \left (c\right ) + a\right ) \sinh \left (b n \log \left (x\right ) + b \log \left (c\right ) + a\right )^{3} + \sinh \left (b n \log \left (x\right ) + b \log \left (c\right ) + a\right )^{4} + 2 \, {\left (3 \, \cosh \left (b n \log \left (x\right ) + b \log \left (c\right ) + a\right )^{2} + 1\right )} \sinh \left (b n \log \left (x\right ) + b \log \left (c\right ) + a\right )^{2} + 2 \, \cosh \left (b n \log \left (x\right ) + b \log \left (c\right ) + a\right )^{2} + 4 \, {\left (\cosh \left (b n \log \left (x\right ) + b \log \left (c\right ) + a\right )^{3} + \cosh \left (b n \log \left (x\right ) + b \log \left (c\right ) + a\right )\right )} \sinh \left (b n \log \left (x\right ) + b \log \left (c\right ) + a\right ) + 1\right )} \log \left (\frac {2 \, \cosh \left (b n \log \left (x\right ) + b \log \left (c\right ) + a\right )}{\cosh \left (b n \log \left (x\right ) + b \log \left (c\right ) + a\right ) - \sinh \left (b n \log \left (x\right ) + b \log \left (c\right ) + a\right )}\right ) + 4 \, {\left (b n \cosh \left (b n \log \left (x\right ) + b \log \left (c\right ) + a\right )^{3} \log \left (x\right ) + {\left (b n \log \left (x\right ) - 1\right )} \cosh \left (b n \log \left (x\right ) + b \log \left (c\right ) + a\right )\right )} \sinh \left (b n \log \left (x\right ) + b \log \left (c\right ) + a\right )}{b n \cosh \left (b n \log \left (x\right ) + b \log \left (c\right ) + a\right )^{4} + 4 \, b n \cosh \left (b n \log \left (x\right ) + b \log \left (c\right ) + a\right ) \sinh \left (b n \log \left (x\right ) + b \log \left (c\right ) + a\right )^{3} + b n \sinh \left (b n \log \left (x\right ) + b \log \left (c\right ) + a\right )^{4} + 2 \, b n \cosh \left (b n \log \left (x\right ) + b \log \left (c\right ) + a\right )^{2} + 2 \, {\left (3 \, b n \cosh \left (b n \log \left (x\right ) + b \log \left (c\right ) + a\right )^{2} + b n\right )} \sinh \left (b n \log \left (x\right ) + b \log \left (c\right ) + a\right )^{2} + b n + 4 \, {\left (b n \cosh \left (b n \log \left (x\right ) + b \log \left (c\right ) + a\right )^{3} + b n \cosh \left (b n \log \left (x\right ) + b \log \left (c\right ) + a\right )\right )} \sinh \left (b n \log \left (x\right ) + b \log \left (c\right ) + a\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 73 vs.
\(2 (34) = 68\).
time = 0.77, size = 73, normalized size = 1.70 \begin {gather*} \begin {cases} \log {\left (x \right )} \tanh ^{3}{\left (a \right )} & \text {for}\: b = 0 \wedge n = 0 \\\log {\left (x \right )} \tanh ^{3}{\left (a + b \log {\left (c \right )} \right )} & \text {for}\: n = 0 \\\log {\left (x \right )} \tanh ^{3}{\left (a \right )} & \text {for}\: b = 0 \\\frac {\log {\left (c x^{n} \right )}}{n} - \frac {\log {\left (\tanh {\left (a + b \log {\left (c x^{n} \right )} \right )} + 1 \right )}}{b n} - \frac {\tanh ^{2}{\left (a + b \log {\left (c x^{n} \right )} \right )}}{2 b n} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 127 vs.
\(2 (41) = 82\).
time = 0.47, size = 127, normalized size = 2.95 \begin {gather*} \frac {\log \left (\sqrt {2 \, x^{2 \, b n} {\left | c \right |}^{2 \, b} \cos \left (\pi b \mathrm {sgn}\left (c\right ) - \pi b\right ) e^{\left (2 \, a\right )} + x^{4 \, b n} {\left | c \right |}^{4 \, b} e^{\left (4 \, a\right )} + 1}\right )}{b n} - \frac {3 \, c^{4 \, b} x^{4 \, b n} e^{\left (4 \, a\right )} + 2 \, c^{2 \, b} x^{2 \, b n} e^{\left (2 \, a\right )} + 3}{2 \, {\left (c^{2 \, b} x^{2 \, b n} e^{\left (2 \, a\right )} + 1\right )}^{2} b n} - \log \left (x\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 1.07, size = 94, normalized size = 2.19 \begin {gather*} \frac {2}{b\,n+b\,n\,{\mathrm {e}}^{2\,a}\,{\left (c\,x^n\right )}^{2\,b}}-\ln \left (x\right )-\frac {2}{b\,n+2\,b\,n\,{\mathrm {e}}^{2\,a}\,{\left (c\,x^n\right )}^{2\,b}+b\,n\,{\mathrm {e}}^{4\,a}\,{\left (c\,x^n\right )}^{4\,b}}+\frac {\ln \left ({\mathrm {e}}^{2\,a}\,{\left (c\,x^n\right )}^{2\,b}+1\right )}{b\,n} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________