3.3.68 \(\int \log (1+x^2) \, dx\) [268]

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

[Out]

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

________________________________________________________________________________________

Rubi [A]
time = 0.00, antiderivative size = 16, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 6, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.500, Rules used = {2498, 327, 209} \begin {gather*} x \log \left (x^2+1\right )-2 x+2 \tan ^{-1}(x) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

-2*x + 2*ArcTan[x] + x*Log[1 + x^2]

Rule 209

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

Rule 327

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 2498

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 (1+x^2\right ) \, dx &=x \log \left (1+x^2\right )-2 \int \frac {x^2}{1+x^2} \, dx\\ &=-2 x+x \log \left (1+x^2\right )+2 \int \frac {1}{1+x^2} \, dx\\ &=-2 x+2 \tan ^{-1}(x)+x \log \left (1+x^2\right )\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.00, size = 16, normalized size = 1.00 \begin {gather*} -2 x+2 \tan ^{-1}(x)+x \log \left (1+x^2\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

-2*x + 2*ArcTan[x] + x*Log[1 + x^2]

________________________________________________________________________________________

Mathics [A]
time = 1.69, size = 16, normalized size = 1.00 \begin {gather*} -2 x+x \text {Log}\left [1+x^2\right ]+2 \text {ArcTan}\left [x\right ] \end {gather*}

Antiderivative was successfully verified.

[In]

mathics('Integrate[Log[1 + x^2],x]')

[Out]

-2 x + x Log[1 + x ^ 2] + 2 ArcTan[x]

________________________________________________________________________________________

Maple [A]
time = 0.02, size = 17, normalized size = 1.06

method result size
default \(-2 x +2 \arctan \left (x \right )+x \ln \left (x^{2}+1\right )\) \(17\)
risch \(-2 x +2 \arctan \left (x \right )+x \ln \left (x^{2}+1\right )\) \(17\)
meijerg \(-2 x +\frac {2 x \arctan \left (\sqrt {x^{2}}\right )}{\sqrt {x^{2}}}+x \ln \left (x^{2}+1\right )\) \(27\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(ln(x^2+1),x,method=_RETURNVERBOSE)

[Out]

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

________________________________________________________________________________________

Maxima [A]
time = 0.35, size = 16, normalized size = 1.00 \begin {gather*} x \log \left (x^{2} + 1\right ) - 2 \, x + 2 \, \arctan \left (x\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

x*log(x^2 + 1) - 2*x + 2*arctan(x)

________________________________________________________________________________________

Fricas [A]
time = 0.35, size = 16, normalized size = 1.00 \begin {gather*} x \log \left (x^{2} + 1\right ) - 2 \, x + 2 \, \arctan \left (x\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

x*log(x^2 + 1) - 2*x + 2*arctan(x)

________________________________________________________________________________________

Sympy [A]
time = 0.06, size = 15, normalized size = 0.94 \begin {gather*} x \log {\left (x^{2} + 1 \right )} - 2 x + 2 \operatorname {atan}{\left (x \right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

x*log(x**2 + 1) - 2*x + 2*atan(x)

________________________________________________________________________________________

Giac [A]
time = 0.00, size = 17, normalized size = 1.06 \begin {gather*} x \ln \left (x^{2}+1\right )-2 \left (x-\arctan x\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(log(x^2+1),x)

[Out]

x*log(x^2 + 1) - 2*x + 2*arctan(x)

________________________________________________________________________________________

Mupad [B]
time = 0.18, size = 16, normalized size = 1.00 \begin {gather*} 2\,\mathrm {atan}\left (x\right )-2\,x+x\,\ln \left (x^2+1\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

2*atan(x) - 2*x + x*log(x^2 + 1)

________________________________________________________________________________________