Optimal. Leaf size=71 \[ -\frac{2 b x^{m+2} \tanh ^{-1}(\tanh (a+b x))}{m^2+3 m+2}+\frac{x^{m+1} \tanh ^{-1}(\tanh (a+b x))^2}{m+1}+\frac{2 b^2 x^{m+3}}{m^3+6 m^2+11 m+6} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0321608, antiderivative size = 71, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 13, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.154, Rules used = {2168, 30} \[ -\frac{2 b x^{m+2} \tanh ^{-1}(\tanh (a+b x))}{m^2+3 m+2}+\frac{x^{m+1} \tanh ^{-1}(\tanh (a+b x))^2}{m+1}+\frac{2 b^2 x^{m+3}}{m^3+6 m^2+11 m+6} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2168
Rule 30
Rubi steps
\begin{align*} \int x^m \tanh ^{-1}(\tanh (a+b x))^2 \, dx &=\frac{x^{1+m} \tanh ^{-1}(\tanh (a+b x))^2}{1+m}-\frac{(2 b) \int x^{1+m} \tanh ^{-1}(\tanh (a+b x)) \, dx}{1+m}\\ &=-\frac{2 b x^{2+m} \tanh ^{-1}(\tanh (a+b x))}{2+3 m+m^2}+\frac{x^{1+m} \tanh ^{-1}(\tanh (a+b x))^2}{1+m}+\frac{\left (2 b^2\right ) \int x^{2+m} \, dx}{2+3 m+m^2}\\ &=\frac{2 b^2 x^{3+m}}{6+11 m+6 m^2+m^3}-\frac{2 b x^{2+m} \tanh ^{-1}(\tanh (a+b x))}{2+3 m+m^2}+\frac{x^{1+m} \tanh ^{-1}(\tanh (a+b x))^2}{1+m}\\ \end{align*}
Mathematica [A] time = 0.107658, size = 62, normalized size = 0.87 \[ \frac{x^{m+1} \left (\left (m^2+5 m+6\right ) \tanh ^{-1}(\tanh (a+b x))^2-2 b (m+3) x \tanh ^{-1}(\tanh (a+b x))+2 b^2 x^2\right )}{(m+1) (m+2) (m+3)} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.04, size = 98, normalized size = 1.4 \begin{align*}{\frac{{x}^{3}{b}^{2}{{\rm e}^{m\ln \left ( x \right ) }}}{3+m}}+{\frac{ \left ({a}^{2}+2\,a \left ({\it Artanh} \left ( \tanh \left ( bx+a \right ) \right ) -bx-a \right ) + \left ({\it Artanh} \left ( \tanh \left ( bx+a \right ) \right ) -bx-a \right ) ^{2} \right ) x{{\rm e}^{m\ln \left ( x \right ) }}}{1+m}}+2\,{\frac{b \left ({\it Artanh} \left ( \tanh \left ( bx+a \right ) \right ) -bx \right ){x}^{2}{{\rm e}^{m\ln \left ( x \right ) }}}{2+m}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: ValueError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] time = 2.22331, size = 356, normalized size = 5.01 \begin{align*} \frac{{\left ({\left (b^{2} m^{2} + 3 \, b^{2} m + 2 \, b^{2}\right )} x^{3} + 2 \,{\left (a b m^{2} + 4 \, a b m + 3 \, a b\right )} x^{2} +{\left (a^{2} m^{2} + 5 \, a^{2} m + 6 \, a^{2}\right )} x\right )} \cosh \left (m \log \left (x\right )\right ) +{\left ({\left (b^{2} m^{2} + 3 \, b^{2} m + 2 \, b^{2}\right )} x^{3} + 2 \,{\left (a b m^{2} + 4 \, a b m + 3 \, a b\right )} x^{2} +{\left (a^{2} m^{2} + 5 \, a^{2} m + 6 \, a^{2}\right )} x\right )} \sinh \left (m \log \left (x\right )\right )}{m^{3} + 6 \, m^{2} + 11 \, m + 6} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-2)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Exception raised: TypeError} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int x^{m} \operatorname{artanh}\left (\tanh \left (b x + a\right )\right )^{2}\,{d x} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]