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

   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 = 21, antiderivative size = 48 \[ \int \frac {\sec ^2(2+3 x)}{2+\tan ^2(2+3 x)} \, dx=\frac {x}{\sqrt {2}}-\frac {\arctan \left (\frac {\cos (2+3 x) \sin (2+3 x)}{1+\sqrt {2}+\cos ^2(2+3 x)}\right )}{3 \sqrt {2}} \]

[Out]

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

Rubi [A] (verified)

Time = 0.04 (sec) , antiderivative size = 48, 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.095, Rules used = {3756, 209} \[ \int \frac {\sec ^2(2+3 x)}{2+\tan ^2(2+3 x)} \, dx=\frac {x}{\sqrt {2}}-\frac {\arctan \left (\frac {\sin (3 x+2) \cos (3 x+2)}{\cos ^2(3 x+2)+\sqrt {2}+1}\right )}{3 \sqrt {2}} \]

[In]

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

[Out]

x/Sqrt[2] - ArcTan[(Cos[2 + 3*x]*Sin[2 + 3*x])/(1 + Sqrt[2] + Cos[2 + 3*x]^2)]/(3*Sqrt[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 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}& = \frac {1}{3} \text {Subst}\left (\int \frac {1}{2+x^2} \, dx,x,\tan (2+3 x)\right ) \\ & = \frac {x}{\sqrt {2}}-\frac {\arctan \left (\frac {\cos (2+3 x) \sin (2+3 x)}{1+\sqrt {2}+\cos ^2(2+3 x)}\right )}{3 \sqrt {2}} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.02 (sec) , antiderivative size = 22, normalized size of antiderivative = 0.46 \[ \int \frac {\sec ^2(2+3 x)}{2+\tan ^2(2+3 x)} \, dx=\frac {\arctan \left (\frac {\tan (2+3 x)}{\sqrt {2}}\right )}{3 \sqrt {2}} \]

[In]

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

[Out]

ArcTan[Tan[2 + 3*x]/Sqrt[2]]/(3*Sqrt[2])

Maple [A] (verified)

Time = 1.15 (sec) , antiderivative size = 18, normalized size of antiderivative = 0.38

method result size
derivativedivides \(\frac {\sqrt {2}\, \arctan \left (\frac {\tan \left (2+3 x \right ) \sqrt {2}}{2}\right )}{6}\) \(18\)
default \(\frac {\sqrt {2}\, \arctan \left (\frac {\tan \left (2+3 x \right ) \sqrt {2}}{2}\right )}{6}\) \(18\)
risch \(\frac {i \sqrt {2}\, \ln \left ({\mathrm e}^{2 i \left (2+3 x \right )}+3+2 \sqrt {2}\right )}{12}-\frac {i \sqrt {2}\, \ln \left ({\mathrm e}^{2 i \left (2+3 x \right )}+3-2 \sqrt {2}\right )}{12}\) \(48\)

[In]

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

[Out]

1/6*2^(1/2)*arctan(1/2*tan(2+3*x)*2^(1/2))

Fricas [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 43, normalized size of antiderivative = 0.90 \[ \int \frac {\sec ^2(2+3 x)}{2+\tan ^2(2+3 x)} \, dx=-\frac {1}{12} \, \sqrt {2} \arctan \left (\frac {3 \, \sqrt {2} \cos \left (3 \, x + 2\right )^{2} - \sqrt {2}}{4 \, \cos \left (3 \, x + 2\right ) \sin \left (3 \, x + 2\right )}\right ) \]

[In]

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

[Out]

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

Sympy [F]

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

[In]

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

[Out]

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

Maxima [A] (verification not implemented)

none

Time = 0.30 (sec) , antiderivative size = 17, normalized size of antiderivative = 0.35 \[ \int \frac {\sec ^2(2+3 x)}{2+\tan ^2(2+3 x)} \, dx=\frac {1}{6} \, \sqrt {2} \arctan \left (\frac {1}{2} \, \sqrt {2} \tan \left (3 \, x + 2\right )\right ) \]

[In]

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

[Out]

1/6*sqrt(2)*arctan(1/2*sqrt(2)*tan(3*x + 2))

Giac [A] (verification not implemented)

none

Time = 0.77 (sec) , antiderivative size = 17, normalized size of antiderivative = 0.35 \[ \int \frac {\sec ^2(2+3 x)}{2+\tan ^2(2+3 x)} \, dx=\frac {1}{6} \, \sqrt {2} \arctan \left (\frac {1}{2} \, \sqrt {2} \tan \left (3 \, x + 2\right )\right ) \]

[In]

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

[Out]

1/6*sqrt(2)*arctan(1/2*sqrt(2)*tan(3*x + 2))

Mupad [B] (verification not implemented)

Time = 26.89 (sec) , antiderivative size = 17, normalized size of antiderivative = 0.35 \[ \int \frac {\sec ^2(2+3 x)}{2+\tan ^2(2+3 x)} \, dx=\frac {\sqrt {2}\,\mathrm {atan}\left (\frac {\sqrt {2}\,\mathrm {tan}\left (3\,x+2\right )}{2}\right )}{6} \]

[In]

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

[Out]

(2^(1/2)*atan((2^(1/2)*tan(3*x + 2))/2))/6