3.324 \(\int \frac {a+x}{a^2+x^2} \, dx\)

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

[Out]

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

________________________________________________________________________________________

Rubi [A]  time = 0.01, antiderivative size = 19, normalized size of antiderivative = 1.00, number of steps used = 3, number of rules used = 3, integrand size = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.231, Rules used = {635, 203, 260} \[ \frac {1}{2} \log \left (a^2+x^2\right )+\tan ^{-1}\left (\frac {x}{a}\right ) \]

Antiderivative was successfully verified.

[In]

Int[(a + x)/(a^2 + x^2),x]

[Out]

ArcTan[x/a] + Log[a^2 + x^2]/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 260

Int[(x_)^(m_.)/((a_) + (b_.)*(x_)^(n_)), x_Symbol] :> Simp[Log[RemoveContent[a + b*x^n, x]]/(b*n), x] /; FreeQ
[{a, b, m, n}, x] && EqQ[m, n - 1]

Rule 635

Int[((d_) + (e_.)*(x_))/((a_) + (c_.)*(x_)^2), x_Symbol] :> Dist[d, Int[1/(a + c*x^2), x], x] + Dist[e, Int[x/
(a + c*x^2), x], x] /; FreeQ[{a, c, d, e}, x] &&  !NiceSqrtQ[-(a*c)]

Rubi steps

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

________________________________________________________________________________________

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

Antiderivative was successfully verified.

[In]

Integrate[(a + x)/(a^2 + x^2),x]

[Out]

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

________________________________________________________________________________________

fricas [A]  time = 0.40, size = 17, normalized size = 0.89 \[ \arctan \left (\frac {x}{a}\right ) + \frac {1}{2} \, \log \left (a^{2} + x^{2}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

giac [A]  time = 1.03, size = 17, normalized size = 0.89 \[ \arctan \left (\frac {x}{a}\right ) + \frac {1}{2} \, \log \left (a^{2} + x^{2}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maple [A]  time = 0.00, size = 18, normalized size = 0.95 \[ \arctan \left (\frac {x}{a}\right )+\frac {\ln \left (a^{2}+x^{2}\right )}{2} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

maxima [A]  time = 1.27, size = 17, normalized size = 0.89 \[ \arctan \left (\frac {x}{a}\right ) + \frac {1}{2} \, \log \left (a^{2} + x^{2}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

mupad [B]  time = 0.04, size = 17, normalized size = 0.89 \[ \frac {\ln \left (a^2+x^2\right )}{2}+\mathrm {atan}\left (\frac {x}{a}\right ) \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

sympy [C]  time = 0.11, size = 42, normalized size = 2.21 \[ \left (\frac {1}{2} - \frac {i}{2}\right ) \log {\left (- a + 2 a \left (\frac {1}{2} - \frac {i}{2}\right ) + x \right )} + \left (\frac {1}{2} + \frac {i}{2}\right ) \log {\left (- a + 2 a \left (\frac {1}{2} + \frac {i}{2}\right ) + x \right )} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________