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

________________________________________________________________________________________

Rubi [A]  time = 0.0062446, antiderivative size = 19, normalized size of antiderivative = 1., 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 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)]

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]

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.0042114, size = 19, normalized size = 1. \[ \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

________________________________________________________________________________________

Maple [A]  time = 0.001, size = 18, normalized size = 1. \begin{align*} \arctan \left ({\frac{x}{a}} \right ) +{\frac{\ln \left ({a}^{2}+{x}^{2} \right ) }{2}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Maxima [A]  time = 1.42015, size = 23, normalized size = 1.21 \begin{align*} \arctan \left (\frac{x}{a}\right ) + \frac{1}{2} \, \log \left (a^{2} + x^{2}\right ) \end{align*}

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)

________________________________________________________________________________________

Fricas [A]  time = 2.09241, size = 46, normalized size = 2.42 \begin{align*} \arctan \left (\frac{x}{a}\right ) + \frac{1}{2} \, \log \left (a^{2} + x^{2}\right ) \end{align*}

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)

________________________________________________________________________________________

Sympy [C]  time = 0.101728, size = 42, normalized size = 2.21 \begin{align*} \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 )} \end{align*}

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)

________________________________________________________________________________________

Giac [A]  time = 1.05321, size = 23, normalized size = 1.21 \begin{align*} \arctan \left (\frac{x}{a}\right ) + \frac{1}{2} \, \log \left (a^{2} + x^{2}\right ) \end{align*}

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)