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

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

[Out]

b*arctan(x)+1/2*a*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 = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.231, Rules used = {649, 209, 266} \begin {gather*} \frac {1}{2} a \log \left (x^2+1\right )+b \tan ^{-1}(x) \end {gather*}

Antiderivative was successfully verified.

[In]

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

[Out]

b*ArcTan[x] + (a*Log[1 + x^2])/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 266

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 649

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

________________________________________________________________________________________

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

Antiderivative was successfully verified.

[In]

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

[Out]

b*ArcTan[x] + (a*Log[1 + x^2])/2

________________________________________________________________________________________

Mathics [C] Result contains complex when optimal does not.
time = 1.80, size = 23, normalized size = 1.44 \begin {gather*} \frac {\text {Log}\left [-I+x\right ] \left (a-I b\right )}{2}+\frac {\text {Log}\left [I+x\right ] \left (a+I b\right )}{2} \end {gather*}

Antiderivative was successfully verified.

[In]

mathics('Integrate[(a*x + b)/(1 + x^2),x]')

[Out]

Log[-I + x] (a - I b) / 2 + Log[I + x] (a + I b) / 2

________________________________________________________________________________________

Maple [A]
time = 0.02, size = 15, normalized size = 0.94

method result size
default \(b \arctan \left (x \right )+\frac {a \ln \left (x^{2}+1\right )}{2}\) \(15\)
meijerg \(b \arctan \left (x \right )+\frac {a \ln \left (x^{2}+1\right )}{2}\) \(15\)
risch \(b \arctan \left (x \right )+\frac {a \ln \left (x^{2}+1\right )}{2}\) \(15\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Maxima [A]
time = 0.34, size = 14, normalized size = 0.88 \begin {gather*} b \arctan \left (x\right ) + \frac {1}{2} \, a \log \left (x^{2} + 1\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Fricas [A]
time = 0.32, size = 14, normalized size = 0.88 \begin {gather*} b \arctan \left (x\right ) + \frac {1}{2} \, a \log \left (x^{2} + 1\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Sympy [C] Result contains complex when optimal does not.
time = 0.09, size = 26, normalized size = 1.62 \begin {gather*} \left (\frac {a}{2} - \frac {i b}{2}\right ) \log {\left (x - i \right )} + \left (\frac {a}{2} + \frac {i b}{2}\right ) \log {\left (x + i \right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Giac [A]
time = 0.00, size = 16, normalized size = 1.00 \begin {gather*} \frac {1}{2} a \ln \left (x^{2}+1\right )+b \arctan x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

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

________________________________________________________________________________________

Mupad [B]
time = 0.04, size = 14, normalized size = 0.88 \begin {gather*} \frac {a\,\ln \left (x^2+1\right )}{2}+b\,\mathrm {atan}\left (x\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

(a*log(x^2 + 1))/2 + b*atan(x)

________________________________________________________________________________________