3.38 \(\int x^2 \tan ^{-1}(\tan (a+b x)) \, dx\)

Optimal. Leaf size=23 \[ \frac{1}{3} x^3 \tan ^{-1}(\tan (a+b x))-\frac{b x^4}{12} \]

[Out]

-(b*x^4)/12 + (x^3*ArcTan[Tan[a + b*x]])/3

________________________________________________________________________________________

Rubi [A]  time = 0.008892, antiderivative size = 23, normalized size of antiderivative = 1., number of steps used = 2, number of rules used = 2, integrand size = 11, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.182, Rules used = {2168, 30} \[ \frac{1}{3} x^3 \tan ^{-1}(\tan (a+b x))-\frac{b x^4}{12} \]

Antiderivative was successfully verified.

[In]

Int[x^2*ArcTan[Tan[a + b*x]],x]

[Out]

-(b*x^4)/12 + (x^3*ArcTan[Tan[a + b*x]])/3

Rule 2168

Int[(u_)^(m_)*(v_)^(n_.), x_Symbol] :> With[{a = Simplify[D[u, x]], b = Simplify[D[v, x]]}, Simp[(u^(m + 1)*v^
n)/(a*(m + 1)), x] - Dist[(b*n)/(a*(m + 1)), Int[u^(m + 1)*v^(n - 1), x], x] /; NeQ[b*u - a*v, 0]] /; FreeQ[{m
, n}, x] && PiecewiseLinearQ[u, v, x] && NeQ[m, -1] && ((LtQ[m, -1] && GtQ[n, 0] &&  !(ILtQ[m + n, -2] && (Fra
ctionQ[m] || GeQ[2*n + m + 1, 0]))) || (IGtQ[n, 0] && IGtQ[m, 0] && LeQ[n, m]) || (IGtQ[n, 0] &&  !IntegerQ[m]
) || (ILtQ[m, 0] &&  !IntegerQ[n]))

Rule 30

Int[(x_)^(m_.), x_Symbol] :> Simp[x^(m + 1)/(m + 1), x] /; FreeQ[m, x] && NeQ[m, -1]

Rubi steps

\begin{align*} \int x^2 \tan ^{-1}(\tan (a+b x)) \, dx &=\frac{1}{3} x^3 \tan ^{-1}(\tan (a+b x))-\frac{1}{3} b \int x^3 \, dx\\ &=-\frac{b x^4}{12}+\frac{1}{3} x^3 \tan ^{-1}(\tan (a+b x))\\ \end{align*}

Mathematica [A]  time = 0.0162567, size = 20, normalized size = 0.87 \[ -\frac{1}{12} x^3 \left (b x-4 \tan ^{-1}(\tan (a+b x))\right ) \]

Antiderivative was successfully verified.

[In]

Integrate[x^2*ArcTan[Tan[a + b*x]],x]

[Out]

-(x^3*(b*x - 4*ArcTan[Tan[a + b*x]]))/12

________________________________________________________________________________________

Maple [A]  time = 0.041, size = 20, normalized size = 0.9 \begin{align*} -{\frac{b{x}^{4}}{12}}+{\frac{{x}^{3}\arctan \left ( \tan \left ( bx+a \right ) \right ) }{3}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x^2*arctan(tan(b*x+a)),x)

[Out]

-1/12*b*x^4+1/3*x^3*arctan(tan(b*x+a))

________________________________________________________________________________________

Maxima [B]  time = 0.989099, size = 109, normalized size = 4.74 \begin{align*} \frac{\frac{4 \,{\left ({\left (b x + a\right )}^{3} - 3 \,{\left (b x + a\right )}^{2} a + 3 \,{\left (b x + a\right )} a^{2}\right )} \arctan \left (\tan \left (b x + a\right )\right )}{b^{2}} - \frac{{\left (b x + a\right )}^{4} - 4 \,{\left (b x + a\right )}^{3} a + 6 \,{\left (b x + a\right )}^{2} a^{2}}{b^{2}}}{12 \, b} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^2*arctan(tan(b*x+a)),x, algorithm="maxima")

[Out]

1/12*(4*((b*x + a)^3 - 3*(b*x + a)^2*a + 3*(b*x + a)*a^2)*arctan(tan(b*x + a))/b^2 - ((b*x + a)^4 - 4*(b*x + a
)^3*a + 6*(b*x + a)^2*a^2)/b^2)/b

________________________________________________________________________________________

Fricas [A]  time = 1.70805, size = 31, normalized size = 1.35 \begin{align*} \frac{1}{4} \, b x^{4} + \frac{1}{3} \, a x^{3} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^2*arctan(tan(b*x+a)),x, algorithm="fricas")

[Out]

1/4*b*x^4 + 1/3*a*x^3

________________________________________________________________________________________

Sympy [A]  time = 0.775372, size = 109, normalized size = 4.74 \begin{align*} \begin{cases} \frac{x^{2} \left (\operatorname{atan}{\left (\tan{\left (a + b x \right )} \right )} + \pi \left \lfloor{\frac{a + b x - \frac{\pi }{2}}{\pi }}\right \rfloor \right )^{2}}{2 b} - \frac{x \left (\operatorname{atan}{\left (\tan{\left (a + b x \right )} \right )} + \pi \left \lfloor{\frac{a + b x - \frac{\pi }{2}}{\pi }}\right \rfloor \right )^{3}}{3 b^{2}} + \frac{\left (\operatorname{atan}{\left (\tan{\left (a + b x \right )} \right )} + \pi \left \lfloor{\frac{a + b x - \frac{\pi }{2}}{\pi }}\right \rfloor \right )^{4}}{12 b^{3}} & \text{for}\: b \neq 0 \\\frac{x^{3} \left (\operatorname{atan}{\left (\tan{\left (a \right )} \right )} + \pi \left \lfloor{\frac{a - \frac{\pi }{2}}{\pi }}\right \rfloor \right )}{3} & \text{otherwise} \end{cases} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x**2*atan(tan(b*x+a)),x)

[Out]

Piecewise((x**2*(atan(tan(a + b*x)) + pi*floor((a + b*x - pi/2)/pi))**2/(2*b) - x*(atan(tan(a + b*x)) + pi*flo
or((a + b*x - pi/2)/pi))**3/(3*b**2) + (atan(tan(a + b*x)) + pi*floor((a + b*x - pi/2)/pi))**4/(12*b**3), Ne(b
, 0)), (x**3*(atan(tan(a)) + pi*floor((a - pi/2)/pi))/3, True))

________________________________________________________________________________________

Giac [A]  time = 1.15182, size = 36, normalized size = 1.57 \begin{align*} \frac{1}{4} \, b x^{4} - \frac{1}{3} \, \pi x^{3} \left \lfloor \frac{a}{\pi } + \frac{1}{2} \right \rfloor + \frac{1}{3} \, a x^{3} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^2*arctan(tan(b*x+a)),x, algorithm="giac")

[Out]

1/4*b*x^4 - 1/3*pi*x^3*floor(a/pi + 1/2) + 1/3*a*x^3