\(\int \frac {\sec ^2(x)}{9+\tan ^2(x)} \, dx\) [692]

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

Optimal result

Integrand size = 13, antiderivative size = 27 \[ \int \frac {\sec ^2(x)}{9+\tan ^2(x)} \, dx=\frac {x}{3}-\frac {1}{3} \arctan \left (\frac {2 \cos (x) \sin (x)}{1+2 \cos ^2(x)}\right ) \]

[Out]

1/3*x-1/3*arctan(2*cos(x)*sin(x)/(1+2*cos(x)^2))

Rubi [A] (verified)

Time = 0.04 (sec) , antiderivative size = 27, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.154, Rules used = {3756, 209} \[ \int \frac {\sec ^2(x)}{9+\tan ^2(x)} \, dx=\frac {x}{3}-\frac {1}{3} \arctan \left (\frac {2 \sin (x) \cos (x)}{2 \cos ^2(x)+1}\right ) \]

[In]

Int[Sec[x]^2/(9 + Tan[x]^2),x]

[Out]

x/3 - ArcTan[(2*Cos[x]*Sin[x])/(1 + 2*Cos[x]^2)]/3

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 3756

Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((a_) + (b_.)*((c_.)*tan[(e_.) + (f_.)*(x_)])^(n_))^(p_.), x_Symbol] :> With[
{ff = FreeFactors[Tan[e + f*x], x]}, Dist[ff/(c^(m - 1)*f), Subst[Int[(c^2 + ff^2*x^2)^(m/2 - 1)*(a + b*(ff*x)
^n)^p, x], x, c*(Tan[e + f*x]/ff)], x]] /; FreeQ[{a, b, c, e, f, n, p}, x] && IntegerQ[m/2] && (IntegersQ[n, p
] || IGtQ[m, 0] || IGtQ[p, 0] || EqQ[n^2, 4] || EqQ[n^2, 16])

Rubi steps \begin{align*} \text {integral}& = \text {Subst}\left (\int \frac {1}{9+x^2} \, dx,x,\tan (x)\right ) \\ & = \frac {x}{3}-\frac {1}{3} \arctan \left (\frac {2 \cos (x) \sin (x)}{1+2 \cos ^2(x)}\right ) \\ \end{align*}

Mathematica [A] (verified)

Time = 0.06 (sec) , antiderivative size = 9, normalized size of antiderivative = 0.33 \[ \int \frac {\sec ^2(x)}{9+\tan ^2(x)} \, dx=-\frac {1}{3} \arctan (3 \cot (x)) \]

[In]

Integrate[Sec[x]^2/(9 + Tan[x]^2),x]

[Out]

-1/3*ArcTan[3*Cot[x]]

Maple [A] (verified)

Time = 6.79 (sec) , antiderivative size = 8, normalized size of antiderivative = 0.30

method result size
default \(\frac {\arctan \left (\frac {\tan \left (x \right )}{3}\right )}{3}\) \(8\)
risch \(\frac {i \ln \left ({\mathrm e}^{2 i x}+2\right )}{6}-\frac {i \ln \left ({\mathrm e}^{2 i x}+\frac {1}{2}\right )}{6}\) \(24\)

[In]

int(sec(x)^2/(9+tan(x)^2),x,method=_RETURNVERBOSE)

[Out]

1/3*arctan(1/3*tan(x))

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 21, normalized size of antiderivative = 0.78 \[ \int \frac {\sec ^2(x)}{9+\tan ^2(x)} \, dx=-\frac {1}{6} \, \arctan \left (\frac {10 \, \cos \left (x\right )^{2} - 1}{6 \, \cos \left (x\right ) \sin \left (x\right )}\right ) \]

[In]

integrate(sec(x)^2/(9+tan(x)^2),x, algorithm="fricas")

[Out]

-1/6*arctan(1/6*(10*cos(x)^2 - 1)/(cos(x)*sin(x)))

Sympy [F]

\[ \int \frac {\sec ^2(x)}{9+\tan ^2(x)} \, dx=\int \frac {\sec ^{2}{\left (x \right )}}{\tan ^{2}{\left (x \right )} + 9}\, dx \]

[In]

integrate(sec(x)**2/(9+tan(x)**2),x)

[Out]

Integral(sec(x)**2/(tan(x)**2 + 9), x)

Maxima [A] (verification not implemented)

none

Time = 0.29 (sec) , antiderivative size = 7, normalized size of antiderivative = 0.26 \[ \int \frac {\sec ^2(x)}{9+\tan ^2(x)} \, dx=\frac {1}{3} \, \arctan \left (\frac {1}{3} \, \tan \left (x\right )\right ) \]

[In]

integrate(sec(x)^2/(9+tan(x)^2),x, algorithm="maxima")

[Out]

1/3*arctan(1/3*tan(x))

Giac [A] (verification not implemented)

none

Time = 0.27 (sec) , antiderivative size = 7, normalized size of antiderivative = 0.26 \[ \int \frac {\sec ^2(x)}{9+\tan ^2(x)} \, dx=\frac {1}{3} \, \arctan \left (\frac {1}{3} \, \tan \left (x\right )\right ) \]

[In]

integrate(sec(x)^2/(9+tan(x)^2),x, algorithm="giac")

[Out]

1/3*arctan(1/3*tan(x))

Mupad [B] (verification not implemented)

Time = 26.38 (sec) , antiderivative size = 7, normalized size of antiderivative = 0.26 \[ \int \frac {\sec ^2(x)}{9+\tan ^2(x)} \, dx=\frac {\mathrm {atan}\left (\frac {\mathrm {tan}\left (x\right )}{3}\right )}{3} \]

[In]

int(1/(cos(x)^2*(tan(x)^2 + 9)),x)

[Out]

atan(tan(x)/3)/3