\(\int \frac {1}{a^2+x^2} \, dx\) [89]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [C] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 9, antiderivative size = 10 \[ \int \frac {1}{a^2+x^2} \, dx=\frac {\arctan \left (\frac {x}{a}\right )}{a} \]

[Out]

arctan(x/a)/a

Rubi [A] (verified)

Time = 0.12 (sec) , antiderivative size = 10, normalized size of antiderivative = 1.00, number of steps used = 1, number of rules used = 1, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.111, Rules used = {209} \[ \int \frac {1}{a^2+x^2} \, dx=\frac {\arctan \left (\frac {x}{a}\right )}{a} \]

[In]

Int[(a^2 + x^2)^(-1),x]

[Out]

ArcTan[x/a]/a

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

Rubi steps \begin{align*} \text {integral}& = \frac {\arctan \left (\frac {x}{a}\right )}{a} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.00 (sec) , antiderivative size = 10, normalized size of antiderivative = 1.00 \[ \int \frac {1}{a^2+x^2} \, dx=\frac {\arctan \left (\frac {x}{a}\right )}{a} \]

[In]

Integrate[(a^2 + x^2)^(-1),x]

[Out]

ArcTan[x/a]/a

Maple [A] (verified)

Time = 0.07 (sec) , antiderivative size = 11, normalized size of antiderivative = 1.10

method result size
default \(\frac {\arctan \left (\frac {x}{a}\right )}{a}\) \(11\)
risch \(\frac {\arctan \left (\frac {x}{a}\right )}{a}\) \(11\)
parallelrisch \(-\frac {i \ln \left (-i a +x \right )-i \ln \left (i a +x \right )}{2 a}\) \(27\)

[In]

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

[Out]

arctan(x/a)/a

Fricas [A] (verification not implemented)

none

Time = 0.24 (sec) , antiderivative size = 10, normalized size of antiderivative = 1.00 \[ \int \frac {1}{a^2+x^2} \, dx=\frac {\arctan \left (\frac {x}{a}\right )}{a} \]

[In]

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

[Out]

arctan(x/a)/a

Sympy [C] (verification not implemented)

Result contains complex when optimal does not.

Time = 0.05 (sec) , antiderivative size = 20, normalized size of antiderivative = 2.00 \[ \int \frac {1}{a^2+x^2} \, dx=\frac {- \frac {i \log {\left (- i a + x \right )}}{2} + \frac {i \log {\left (i a + x \right )}}{2}}{a} \]

[In]

integrate(1/(a**2+x**2),x)

[Out]

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

Maxima [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 10, normalized size of antiderivative = 1.00 \[ \int \frac {1}{a^2+x^2} \, dx=\frac {\arctan \left (\frac {x}{a}\right )}{a} \]

[In]

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

[Out]

arctan(x/a)/a

Giac [A] (verification not implemented)

none

Time = 0.28 (sec) , antiderivative size = 10, normalized size of antiderivative = 1.00 \[ \int \frac {1}{a^2+x^2} \, dx=\frac {\arctan \left (\frac {x}{a}\right )}{a} \]

[In]

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

[Out]

arctan(x/a)/a

Mupad [B] (verification not implemented)

Time = 0.04 (sec) , antiderivative size = 10, normalized size of antiderivative = 1.00 \[ \int \frac {1}{a^2+x^2} \, dx=\frac {\mathrm {atan}\left (\frac {x}{a}\right )}{a} \]

[In]

int(1/(a^2 + x^2),x)

[Out]

atan(x/a)/a