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

3.7.96.1 Optimal result
3.7.96.2 Mathematica [A] (verified)
3.7.96.3 Rubi [A] (verified)
3.7.96.4 Maple [A] (verified)
3.7.96.5 Fricas [A] (verification not implemented)
3.7.96.6 Sympy [F]
3.7.96.7 Maxima [A] (verification not implemented)
3.7.96.8 Giac [A] (verification not implemented)
3.7.96.9 Mupad [B] (verification not implemented)

3.7.96.1 Optimal result

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

output
x-arctan((1-2*cos(x)^2+cos(x)*sin(x))/(2+cos(x)^2+2*cos(x)*sin(x)))
 
3.7.96.2 Mathematica [A] (verified)

Time = 0.08 (sec) , antiderivative size = 31, normalized size of antiderivative = 0.94 \[ \int \frac {\sec ^2(x)}{2+2 \tan (x)+\tan ^2(x)} \, dx=2 \left (-\frac {1}{4} \arctan \left (\frac {\cos (x)}{\cos (x)+\sin (x)}\right )+\frac {1}{4} \arctan (\sec (x) (\cos (x)+\sin (x)))\right ) \]

input
Integrate[Sec[x]^2/(2 + 2*Tan[x] + Tan[x]^2),x]
 
output
2*(-1/4*ArcTan[Cos[x]/(Cos[x] + Sin[x])] + ArcTan[Sec[x]*(Cos[x] + Sin[x]) 
]/4)
 
3.7.96.3 Rubi [A] (verified)

Time = 0.21 (sec) , antiderivative size = 5, normalized size of antiderivative = 0.15, number of steps used = 5, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.235, Rules used = {3042, 4842, 1082, 217}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \frac {\sec ^2(x)}{\tan ^2(x)+2 \tan (x)+2} \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {\sec (x)^2}{\tan (x)^2+2 \tan (x)+2}dx\)

\(\Big \downarrow \) 4842

\(\displaystyle \int \frac {1}{\tan ^2(x)+2 \tan (x)+2}d\tan (x)\)

\(\Big \downarrow \) 1082

\(\displaystyle -\int \frac {1}{-(\tan (x)+1)^2-1}d(\tan (x)+1)\)

\(\Big \downarrow \) 217

\(\displaystyle \arctan (\tan (x)+1)\)

input
Int[Sec[x]^2/(2 + 2*Tan[x] + Tan[x]^2),x]
 
output
ArcTan[1 + Tan[x]]
 

3.7.96.3.1 Defintions of rubi rules used

rule 217
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(-(Rt[-a, 2]*Rt[-b, 2])^( 
-1))*ArcTan[Rt[-b, 2]*(x/Rt[-a, 2])], x] /; FreeQ[{a, b}, x] && PosQ[a/b] & 
& (LtQ[a, 0] || LtQ[b, 0])
 

rule 1082
Int[((a_) + (b_.)*(x_) + (c_.)*(x_)^2)^(-1), x_Symbol] :> With[{q = 1 - 4*S 
implify[a*(c/b^2)]}, Simp[-2/b   Subst[Int[1/(q - x^2), x], x, 1 + 2*c*(x/b 
)], x] /; RationalQ[q] && (EqQ[q^2, 1] ||  !RationalQ[b^2 - 4*a*c])] /; Fre 
eQ[{a, b, c}, x]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 4842
Int[(u_)*(F_)[(c_.)*((a_.) + (b_.)*(x_))]^2, x_Symbol] :> With[{d = FreeFac 
tors[Tan[c*(a + b*x)], x]}, Simp[d/(b*c)   Subst[Int[SubstFor[1, Tan[c*(a + 
 b*x)]/d, u, x], x], x, Tan[c*(a + b*x)]/d], x] /; FunctionOfQ[Tan[c*(a + b 
*x)]/d, u, x, True]] /; FreeQ[{a, b, c}, x] && NonsumQ[u] && (EqQ[F, Sec] | 
| EqQ[F, sec])
 
3.7.96.4 Maple [A] (verified)

Time = 8.09 (sec) , antiderivative size = 6, normalized size of antiderivative = 0.18

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

input
int(sec(x)^2/(2+2*tan(x)+tan(x)^2),x,method=_RETURNVERBOSE)
 
output
arctan(1+tan(x))
 
3.7.96.5 Fricas [A] (verification not implemented)

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

input
integrate(sec(x)^2/(2+2*tan(x)+tan(x)^2),x, algorithm="fricas")
 
output
-1/2*arctan(-1/2*(3*cos(x)^2 + 6*cos(x)*sin(x) + 1)/(2*cos(x)^2 - cos(x)*s 
in(x) - 1))
 
3.7.96.6 Sympy [F]

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

input
integrate(sec(x)**2/(2+2*tan(x)+tan(x)**2),x)
 
output
Integral(sec(x)**2/(tan(x)**2 + 2*tan(x) + 2), x)
 
3.7.96.7 Maxima [A] (verification not implemented)

Time = 0.31 (sec) , antiderivative size = 5, normalized size of antiderivative = 0.15 \[ \int \frac {\sec ^2(x)}{2+2 \tan (x)+\tan ^2(x)} \, dx=\arctan \left (\tan \left (x\right ) + 1\right ) \]

input
integrate(sec(x)^2/(2+2*tan(x)+tan(x)^2),x, algorithm="maxima")
 
output
arctan(tan(x) + 1)
 
3.7.96.8 Giac [A] (verification not implemented)

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

input
integrate(sec(x)^2/(2+2*tan(x)+tan(x)^2),x, algorithm="giac")
 
output
arctan(tan(x) + 1)
 
3.7.96.9 Mupad [B] (verification not implemented)

Time = 26.79 (sec) , antiderivative size = 5, normalized size of antiderivative = 0.15 \[ \int \frac {\sec ^2(x)}{2+2 \tan (x)+\tan ^2(x)} \, dx=\mathrm {atan}\left (\mathrm {tan}\left (x\right )+1\right ) \]

input
int(1/(cos(x)^2*(2*tan(x) + tan(x)^2 + 2)),x)
 
output
atan(tan(x) + 1)