3.780 \(\int (\frac{1}{1+x^2}+\sin (x)) \, dx\)

Optimal. Leaf size=7 \[ \tan ^{-1}(x)-\cos (x) \]

[Out]

ArcTan[x] - Cos[x]

________________________________________________________________________________________

Rubi [A]  time = 0.0040017, antiderivative size = 7, normalized size of antiderivative = 1., number of steps used = 3, number of rules used = 2, integrand size = 10, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.2, Rules used = {203, 2638} \[ \tan ^{-1}(x)-\cos (x) \]

Antiderivative was successfully verified.

[In]

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

[Out]

ArcTan[x] - Cos[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])

Rule 2638

Int[sin[(c_.) + (d_.)*(x_)], x_Symbol] :> -Simp[Cos[c + d*x]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

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

Mathematica [A]  time = 0.007671, size = 7, normalized size = 1. \[ \tan ^{-1}(x)-\cos (x) \]

Antiderivative was successfully verified.

[In]

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

[Out]

ArcTan[x] - Cos[x]

________________________________________________________________________________________

Maple [A]  time = 0.002, size = 8, normalized size = 1.1 \begin{align*} \arctan \left ( x \right ) -\cos \left ( x \right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

arctan(x)-cos(x)

________________________________________________________________________________________

Maxima [A]  time = 1.46228, size = 9, normalized size = 1.29 \begin{align*} \arctan \left (x\right ) - \cos \left (x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

arctan(x) - cos(x)

________________________________________________________________________________________

Fricas [A]  time = 2.16774, size = 27, normalized size = 3.86 \begin{align*} \arctan \left (x\right ) - \cos \left (x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

arctan(x) - cos(x)

________________________________________________________________________________________

Sympy [A]  time = 0.086205, size = 5, normalized size = 0.71 \begin{align*} - \cos{\left (x \right )} + \operatorname{atan}{\left (x \right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-cos(x) + atan(x)

________________________________________________________________________________________

Giac [A]  time = 1.11073, size = 9, normalized size = 1.29 \begin{align*} \arctan \left (x\right ) - \cos \left (x\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

arctan(x) - cos(x)