### 3.268 $$\int \log (1+x^2) \, dx$$

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

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.0047707, antiderivative size = 16, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 3, integrand size = 6, $$\frac{\text{number of rules}}{\text{integrand size}}$$ = 0.5, Rules used = {2448, 321, 203} $x \log \left (x^2+1\right )-2 x+2 \tan ^{-1}(x)$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

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

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]

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 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 \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.0015108, size = 16, normalized size = 1. $x \log \left (x^2+1\right )-2 x+2 \tan ^{-1}(x)$

Antiderivative was successfully veriﬁed.

[In]

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

[Out]

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

________________________________________________________________________________________

Maple [A]  time = 0.002, size = 17, normalized size = 1.1 \begin{align*} -2\,x+2\,\arctan \left ( x \right ) +x\ln \left ({x}^{2}+1 \right ) \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Maxima [A]  time = 1.43056, size = 22, normalized size = 1.38 \begin{align*} x \log \left (x^{2} + 1\right ) - 2 \, x + 2 \, \arctan \left (x\right ) \end{align*}

Veriﬁcation 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 = 1.93475, size = 49, normalized size = 3.06 \begin{align*} x \log \left (x^{2} + 1\right ) - 2 \, x + 2 \, \arctan \left (x\right ) \end{align*}

Veriﬁcation 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.117136, size = 15, normalized size = 0.94 \begin{align*} x \log{\left (x^{2} + 1 \right )} - 2 x + 2 \operatorname{atan}{\left (x \right )} \end{align*}

Veriﬁcation 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 = 1.05528, size = 22, normalized size = 1.38 \begin{align*} x \log \left (x^{2} + 1\right ) - 2 \, x + 2 \, \arctan \left (x\right ) \end{align*}

Veriﬁcation of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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