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

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

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.01, antiderivative size = 23, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 8, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.375, Rules used = {2448, 321, 203} \[ x \log \left (a^2+x^2\right )+2 a \tan ^{-1}\left (\frac {x}{a}\right )-2 x \]

Antiderivative was successfully verified.

[In]

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

[Out]

-2*x + 2*a*ArcTan[x/a] + x*Log[a^2 + x^2]

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])

Rule 321

Int[((c_.)*(x_))^(m_)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[(c^(n - 1)*(c*x)^(m - n + 1)*(a + b*x^n
)^(p + 1))/(b*(m + n*p + 1)), x] - Dist[(a*c^n*(m - n + 1))/(b*(m + n*p + 1)), Int[(c*x)^(m - n)*(a + b*x^n)^p
, x], x] /; FreeQ[{a, b, c, p}, x] && IGtQ[n, 0] && GtQ[m, n - 1] && NeQ[m + n*p + 1, 0] && IntBinomialQ[a, b,
 c, n, m, p, x]

Rule 2448

Int[Log[(c_.)*((d_) + (e_.)*(x_)^(n_))^(p_.)], x_Symbol] :> Simp[x*Log[c*(d + e*x^n)^p], x] - Dist[e*n*p, Int[
x^n/(d + e*x^n), x], x] /; FreeQ[{c, d, e, n, p}, x]

Rubi steps

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

________________________________________________________________________________________

Mathematica [A]  time = 0.00, size = 23, normalized size = 1.00 \[ x \log \left (a^2+x^2\right )+2 a \tan ^{-1}\left (\frac {x}{a}\right )-2 x \]

Antiderivative was successfully verified.

[In]

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

[Out]

-2*x + 2*a*ArcTan[x/a] + x*Log[a^2 + x^2]

________________________________________________________________________________________

fricas [A]  time = 0.43, size = 23, normalized size = 1.00 \[ 2 \, a \arctan \left (\frac {x}{a}\right ) + x \log \left (a^{2} + x^{2}\right ) - 2 \, x \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

giac [A]  time = 1.17, size = 23, normalized size = 1.00 \[ 2 \, a \arctan \left (\frac {x}{a}\right ) + x \log \left (a^{2} + x^{2}\right ) - 2 \, x \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maple [A]  time = 0.01, size = 24, normalized size = 1.04 \[ 2 a \arctan \left (\frac {x}{a}\right )+x \ln \left (a^{2}+x^{2}\right )-2 x \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maxima [A]  time = 0.96, size = 23, normalized size = 1.00 \[ 2 \, a \arctan \left (\frac {x}{a}\right ) + x \log \left (a^{2} + x^{2}\right ) - 2 \, x \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

mupad [B]  time = 0.07, size = 23, normalized size = 1.00 \[ x\,\ln \left (a^2+x^2\right )-2\,x+2\,a\,\mathrm {atan}\left (\frac {x}{a}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(log(a^2 + x^2),x)

[Out]

x*log(a^2 + x^2) - 2*x + 2*a*atan(x/a)

________________________________________________________________________________________

sympy [C]  time = 0.16, size = 36, normalized size = 1.57 \[ - 2 a \left (\frac {i \log {\left (- i a + x \right )}}{2} - \frac {i \log {\left (i a + x \right )}}{2}\right ) + x \log {\left (a^{2} + x^{2} \right )} - 2 x \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-2*a*(I*log(-I*a + x)/2 - I*log(I*a + x)/2) + x*log(a**2 + x**2) - 2*x

________________________________________________________________________________________