\(\int 4 \sin ^2(x) \tan ^2(x) \, dx\) [830]

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

Optimal result

Integrand size = 10, antiderivative size = 16 \[ \int 4 \sin ^2(x) \tan ^2(x) \, dx=-6 x+6 \tan (x)-2 \sin ^2(x) \tan (x) \]

[Out]

-6*x+6*tan(x)-2*sin(x)^2*tan(x)

Rubi [A] (verified)

Time = 0.03 (sec) , antiderivative size = 16, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.500, Rules used = {12, 2671, 294, 327, 209} \[ \int 4 \sin ^2(x) \tan ^2(x) \, dx=-6 x+6 \tan (x)-2 \sin ^2(x) \tan (x) \]

[In]

Int[4*Sin[x]^2*Tan[x]^2,x]

[Out]

-6*x + 6*Tan[x] - 2*Sin[x]^2*Tan[x]

Rule 12

Int[(a_)*(u_), x_Symbol] :> Dist[a, Int[u, x], x] /; FreeQ[a, x] &&  !MatchQ[u, (b_)*(v_) /; FreeQ[b, x]]

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 294

Int[((c_.)*(x_))^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[c^(n - 1)*(c*x)^(m - n + 1)*((a + b*x^
n)^(p + 1)/(b*n*(p + 1))), x] - Dist[c^n*((m - n + 1)/(b*n*(p + 1))), Int[(c*x)^(m - n)*(a + b*x^n)^(p + 1), x
], x] /; FreeQ[{a, b, c}, x] && IGtQ[n, 0] && LtQ[p, -1] && GtQ[m + 1, n] &&  !ILtQ[(m + n*(p + 1) + 1)/n, 0]
&& IntBinomialQ[a, b, c, n, m, p, x]

Rule 327

Int[((c_.)*(x_))^(m_)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Simp[c^(n - 1)*(c*x)^(m - n + 1)*((a + b*x^n
)^(p + 1)/(b*(m + n*p + 1))), x] - Dist[a*c^n*((m - n + 1)/(b*(m + n*p + 1))), Int[(c*x)^(m - n)*(a + b*x^n)^p
, x], x] /; FreeQ[{a, b, c, p}, x] && IGtQ[n, 0] && GtQ[m, n - 1] && NeQ[m + n*p + 1, 0] && IntBinomialQ[a, b,
 c, n, m, p, x]

Rule 2671

Int[sin[(e_.) + (f_.)*(x_)]^(m_)*((b_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> With[{ff = FreeFactors[Ta
n[e + f*x], x]}, Dist[b*(ff/f), Subst[Int[(ff*x)^(m + n)/(b^2 + ff^2*x^2)^(m/2 + 1), x], x, b*(Tan[e + f*x]/ff
)], x]] /; FreeQ[{b, e, f, n}, x] && IntegerQ[m/2]

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

Mathematica [A] (verified)

Time = 0.01 (sec) , antiderivative size = 18, normalized size of antiderivative = 1.12 \[ \int 4 \sin ^2(x) \tan ^2(x) \, dx=4 \left (-\frac {3 x}{2}+\frac {1}{4} \sin (2 x)+\tan (x)\right ) \]

[In]

Integrate[4*Sin[x]^2*Tan[x]^2,x]

[Out]

4*((-3*x)/2 + Sin[2*x]/4 + Tan[x])

Maple [A] (verified)

Time = 2.33 (sec) , antiderivative size = 28, normalized size of antiderivative = 1.75

method result size
default \(\frac {4 \sin \left (x \right )^{5}}{\cos \left (x \right )}+4 \left (\sin \left (x \right )^{3}+\frac {3 \sin \left (x \right )}{2}\right ) \cos \left (x \right )-6 x\) \(28\)
risch \(-6 x -\frac {i {\mathrm e}^{2 i x}}{2}+\frac {i {\mathrm e}^{-2 i x}}{2}+\frac {8 i}{{\mathrm e}^{2 i x}+1}\) \(33\)

[In]

int(4*sin(x)^2*tan(x)^2,x,method=_RETURNVERBOSE)

[Out]

4*sin(x)^5/cos(x)+4*(sin(x)^3+3/2*sin(x))*cos(x)-6*x

Fricas [A] (verification not implemented)

none

Time = 0.24 (sec) , antiderivative size = 22, normalized size of antiderivative = 1.38 \[ \int 4 \sin ^2(x) \tan ^2(x) \, dx=-\frac {2 \, {\left (3 \, x \cos \left (x\right ) - {\left (\cos \left (x\right )^{2} + 2\right )} \sin \left (x\right )\right )}}{\cos \left (x\right )} \]

[In]

integrate(4*sin(x)^2*tan(x)^2,x, algorithm="fricas")

[Out]

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

Sympy [A] (verification not implemented)

Time = 0.02 (sec) , antiderivative size = 20, normalized size of antiderivative = 1.25 \[ \int 4 \sin ^2(x) \tan ^2(x) \, dx=- 6 x + \frac {4 \sin ^{3}{\left (x \right )}}{\cos {\left (x \right )}} + 6 \sin {\left (x \right )} \cos {\left (x \right )} \]

[In]

integrate(4*sin(x)**2*tan(x)**2,x)

[Out]

-6*x + 4*sin(x)**3/cos(x) + 6*sin(x)*cos(x)

Maxima [A] (verification not implemented)

none

Time = 0.29 (sec) , antiderivative size = 20, normalized size of antiderivative = 1.25 \[ \int 4 \sin ^2(x) \tan ^2(x) \, dx=-6 \, x + \frac {2 \, \tan \left (x\right )}{\tan \left (x\right )^{2} + 1} + 4 \, \tan \left (x\right ) \]

[In]

integrate(4*sin(x)^2*tan(x)^2,x, algorithm="maxima")

[Out]

-6*x + 2*tan(x)/(tan(x)^2 + 1) + 4*tan(x)

Giac [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 20, normalized size of antiderivative = 1.25 \[ \int 4 \sin ^2(x) \tan ^2(x) \, dx=-6 \, x + \frac {2 \, \tan \left (x\right )}{\tan \left (x\right )^{2} + 1} + 4 \, \tan \left (x\right ) \]

[In]

integrate(4*sin(x)^2*tan(x)^2,x, algorithm="giac")

[Out]

-6*x + 2*tan(x)/(tan(x)^2 + 1) + 4*tan(x)

Mupad [B] (verification not implemented)

Time = 26.21 (sec) , antiderivative size = 18, normalized size of antiderivative = 1.12 \[ \int 4 \sin ^2(x) \tan ^2(x) \, dx=2\,\cos \left (x\right )\,\sin \left (x\right )-6\,x+\frac {4\,\sin \left (x\right )}{\cos \left (x\right )} \]

[In]

int(4*sin(x)^2*tan(x)^2,x)

[Out]

2*cos(x)*sin(x) - 6*x + (4*sin(x))/cos(x)