3.72 \(\int x^2 \log (a^2+x^2) \, dx\)

Optimal. Leaf size=44 \[ \frac{1}{3} x^3 \log \left (a^2+x^2\right )+\frac{2 a^2 x}{3}-\frac{2}{3} a^3 \tan ^{-1}\left (\frac{x}{a}\right )-\frac{2 x^3}{9} \]

[Out]

(2*a^2*x)/3 - (2*x^3)/9 - (2*a^3*ArcTan[x/a])/3 + (x^3*Log[a^2 + x^2])/3

________________________________________________________________________________________

Rubi [A]  time = 0.0228396, antiderivative size = 44, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 12, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.25, Rules used = {2455, 302, 203} \[ \frac{1}{3} x^3 \log \left (a^2+x^2\right )+\frac{2 a^2 x}{3}-\frac{2}{3} a^3 \tan ^{-1}\left (\frac{x}{a}\right )-\frac{2 x^3}{9} \]

Antiderivative was successfully verified.

[In]

Int[x^2*Log[a^2 + x^2],x]

[Out]

(2*a^2*x)/3 - (2*x^3)/9 - (2*a^3*ArcTan[x/a])/3 + (x^3*Log[a^2 + x^2])/3

Rule 2455

Int[((a_.) + Log[(c_.)*((d_) + (e_.)*(x_)^(n_))^(p_.)]*(b_.))*((f_.)*(x_))^(m_.), x_Symbol] :> Simp[((f*x)^(m
+ 1)*(a + b*Log[c*(d + e*x^n)^p]))/(f*(m + 1)), x] - Dist[(b*e*n*p)/(f*(m + 1)), Int[(x^(n - 1)*(f*x)^(m + 1))
/(d + e*x^n), x], x] /; FreeQ[{a, b, c, d, e, f, m, n, p}, x] && NeQ[m, -1]

Rule 302

Int[(x_)^(m_)/((a_) + (b_.)*(x_)^(n_)), x_Symbol] :> Int[PolynomialDivide[x^m, a + b*x^n, x], x] /; FreeQ[{a,
b}, x] && IGtQ[m, 0] && IGtQ[n, 0] && GtQ[m, 2*n - 1]

Rule 203

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTan[(Rt[b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[b, 2]), x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rubi steps

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

Mathematica [A]  time = 0.0020295, size = 44, normalized size = 1. \[ \frac{1}{3} x^3 \log \left (a^2+x^2\right )+\frac{2 a^2 x}{3}-\frac{2}{3} a^3 \tan ^{-1}\left (\frac{x}{a}\right )-\frac{2 x^3}{9} \]

Antiderivative was successfully verified.

[In]

Integrate[x^2*Log[a^2 + x^2],x]

[Out]

(2*a^2*x)/3 - (2*x^3)/9 - (2*a^3*ArcTan[x/a])/3 + (x^3*Log[a^2 + x^2])/3

________________________________________________________________________________________

Maple [A]  time = 0.004, size = 37, normalized size = 0.8 \begin{align*}{\frac{2\,{a}^{2}x}{3}}-{\frac{2\,{x}^{3}}{9}}-{\frac{2\,{a}^{3}}{3}\arctan \left ({\frac{x}{a}} \right ) }+{\frac{{x}^{3}\ln \left ({a}^{2}+{x}^{2} \right ) }{3}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x^2*ln(a^2+x^2),x)

[Out]

2/3*a^2*x-2/9*x^3-2/3*a^3*arctan(x/a)+1/3*x^3*ln(a^2+x^2)

________________________________________________________________________________________

Maxima [A]  time = 1.41594, size = 49, normalized size = 1.11 \begin{align*} -\frac{2}{3} \, a^{3} \arctan \left (\frac{x}{a}\right ) + \frac{1}{3} \, x^{3} \log \left (a^{2} + x^{2}\right ) + \frac{2}{3} \, a^{2} x - \frac{2}{9} \, x^{3} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^2*log(a^2+x^2),x, algorithm="maxima")

[Out]

-2/3*a^3*arctan(x/a) + 1/3*x^3*log(a^2 + x^2) + 2/3*a^2*x - 2/9*x^3

________________________________________________________________________________________

Fricas [A]  time = 2.02291, size = 93, normalized size = 2.11 \begin{align*} -\frac{2}{3} \, a^{3} \arctan \left (\frac{x}{a}\right ) + \frac{1}{3} \, x^{3} \log \left (a^{2} + x^{2}\right ) + \frac{2}{3} \, a^{2} x - \frac{2}{9} \, x^{3} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^2*log(a^2+x^2),x, algorithm="fricas")

[Out]

-2/3*a^3*arctan(x/a) + 1/3*x^3*log(a^2 + x^2) + 2/3*a^2*x - 2/9*x^3

________________________________________________________________________________________

Sympy [C]  time = 0.335372, size = 53, normalized size = 1.2 \begin{align*} - 2 a^{3} \left (- \frac{i \log{\left (- i a + x \right )}}{6} + \frac{i \log{\left (i a + x \right )}}{6}\right ) + \frac{2 a^{2} x}{3} + \frac{x^{3} \log{\left (a^{2} + x^{2} \right )}}{3} - \frac{2 x^{3}}{9} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x**2*ln(a**2+x**2),x)

[Out]

-2*a**3*(-I*log(-I*a + x)/6 + I*log(I*a + x)/6) + 2*a**2*x/3 + x**3*log(a**2 + x**2)/3 - 2*x**3/9

________________________________________________________________________________________

Giac [A]  time = 1.07825, size = 49, normalized size = 1.11 \begin{align*} -\frac{2}{3} \, a^{3} \arctan \left (\frac{x}{a}\right ) + \frac{1}{3} \, x^{3} \log \left (a^{2} + x^{2}\right ) + \frac{2}{3} \, a^{2} x - \frac{2}{9} \, x^{3} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^2*log(a^2+x^2),x, algorithm="giac")

[Out]

-2/3*a^3*arctan(x/a) + 1/3*x^3*log(a^2 + x^2) + 2/3*a^2*x - 2/9*x^3