3.447 \(\int \frac{\sec ^2(x) (-\cos (2 x)+2 \tan ^2(x))}{(\tan (x) \tan (2 x))^{3/2}} \, dx\)

Optimal. Leaf size=100 \[ \frac{2 \tan ^3(x)}{3 (\tan (x) \tan (2 x))^{3/2}}+\frac{3 \tan (x)}{4 \sqrt{\tan (x) \tan (2 x)}}+\frac{\tan (x)}{2 (\tan (x) \tan (2 x))^{3/2}}+2 \tanh ^{-1}\left (\frac{\tan (x)}{\sqrt{\tan (x) \tan (2 x)}}\right )-\frac{11 \tanh ^{-1}\left (\frac{\sqrt{2} \tan (x)}{\sqrt{\tan (x) \tan (2 x)}}\right )}{4 \sqrt{2}} \]

[Out]

2*ArcTanh[Tan[x]/Sqrt[Tan[x]*Tan[2*x]]] - (11*ArcTanh[(Sqrt[2]*Tan[x])/Sqrt[Tan[x]*Tan[2*x]]])/(4*Sqrt[2]) + T
an[x]/(2*(Tan[x]*Tan[2*x])^(3/2)) + (2*Tan[x]^3)/(3*(Tan[x]*Tan[2*x])^(3/2)) + (3*Tan[x])/(4*Sqrt[Tan[x]*Tan[2
*x]])

________________________________________________________________________________________

Rubi [B]  time = 1.22598, antiderivative size = 208, normalized size of antiderivative = 2.08, number of steps used = 21, number of rules used = 10, integrand size = 29, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.345, Rules used = {4397, 12, 6719, 6725, 266, 47, 50, 63, 203, 444} \[ \frac{\left (1-\tan ^2(x)\right ) \tan (x)}{3 \sqrt{2} \sqrt{\frac{\tan ^2(x)}{1-\tan ^2(x)}}}+\frac{3 \tan (x)}{4 \sqrt{2} \sqrt{\frac{\tan ^2(x)}{1-\tan ^2(x)}}}-\frac{11 \tan ^{-1}\left (\sqrt{\tan ^2(x)-1}\right ) \tan (x)}{4 \sqrt{2} \sqrt{\frac{\tan ^2(x)}{1-\tan ^2(x)}} \sqrt{\tan ^2(x)-1}}+\frac{2 \tan ^{-1}\left (\frac{\sqrt{\tan ^2(x)-1}}{\sqrt{2}}\right ) \tan (x)}{\sqrt{\frac{\tan ^2(x)}{1-\tan ^2(x)}} \sqrt{\tan ^2(x)-1}}+\frac{\left (1-\tan ^2(x)\right ) \cot (x)}{4 \sqrt{2} \sqrt{\frac{\tan ^2(x)}{1-\tan ^2(x)}}} \]

Antiderivative was successfully verified.

[In]

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

[Out]

(3*Tan[x])/(4*Sqrt[2]*Sqrt[Tan[x]^2/(1 - Tan[x]^2)]) + (Cot[x]*(1 - Tan[x]^2))/(4*Sqrt[2]*Sqrt[Tan[x]^2/(1 - T
an[x]^2)]) + (Tan[x]*(1 - Tan[x]^2))/(3*Sqrt[2]*Sqrt[Tan[x]^2/(1 - Tan[x]^2)]) - (11*ArcTan[Sqrt[-1 + Tan[x]^2
]]*Tan[x])/(4*Sqrt[2]*Sqrt[Tan[x]^2/(1 - Tan[x]^2)]*Sqrt[-1 + Tan[x]^2]) + (2*ArcTan[Sqrt[-1 + Tan[x]^2]/Sqrt[
2]]*Tan[x])/(Sqrt[Tan[x]^2/(1 - Tan[x]^2)]*Sqrt[-1 + Tan[x]^2])

Rule 4397

Int[u_, x_Symbol] :> Int[TrigSimplify[u], x] /; TrigSimplifyQ[u]

Rule 12

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

Rule 6719

Int[(u_.)*((a_.)*(v_)^(m_.)*(w_)^(n_.))^(p_), x_Symbol] :> Dist[(a^IntPart[p]*(a*v^m*w^n)^FracPart[p])/(v^(m*F
racPart[p])*w^(n*FracPart[p])), Int[u*v^(m*p)*w^(n*p), x], x] /; FreeQ[{a, m, n, p}, x] &&  !IntegerQ[p] &&  !
FreeQ[v, x] &&  !FreeQ[w, x]

Rule 6725

Int[(u_)/((a_) + (b_.)*(x_)^(n_)), x_Symbol] :> With[{v = RationalFunctionExpand[u/(a + b*x^n), x]}, Int[v, x]
 /; SumQ[v]] /; FreeQ[{a, b}, x] && IGtQ[n, 0]

Rule 266

Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_), x_Symbol] :> Dist[1/n, Subst[Int[x^(Simplify[(m + 1)/n] - 1)*(a
+ b*x)^p, x], x, x^n], x] /; FreeQ[{a, b, m, n, p}, x] && IntegerQ[Simplify[(m + 1)/n]]

Rule 47

Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> Simp[((a + b*x)^(m + 1)*(c + d*x)^n)/(b*
(m + 1)), x] - Dist[(d*n)/(b*(m + 1)), Int[(a + b*x)^(m + 1)*(c + d*x)^(n - 1), x], x] /; FreeQ[{a, b, c, d},
x] && NeQ[b*c - a*d, 0] && GtQ[n, 0] && LtQ[m, -1] &&  !(IntegerQ[n] &&  !IntegerQ[m]) &&  !(ILeQ[m + n + 2, 0
] && (FractionQ[m] || GeQ[2*n + m + 1, 0])) && IntLinearQ[a, b, c, d, m, n, x]

Rule 50

Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> Simp[((a + b*x)^(m + 1)*(c + d*x)^n)/(b*
(m + n + 1)), x] + Dist[(n*(b*c - a*d))/(b*(m + n + 1)), Int[(a + b*x)^m*(c + d*x)^(n - 1), x], x] /; FreeQ[{a
, b, c, d}, x] && NeQ[b*c - a*d, 0] && GtQ[n, 0] && NeQ[m + n + 1, 0] &&  !(IGtQ[m, 0] && ( !IntegerQ[n] || (G
tQ[m, 0] && LtQ[m - n, 0]))) &&  !ILtQ[m + n + 2, 0] && IntLinearQ[a, b, c, d, m, n, x]

Rule 63

Int[((a_.) + (b_.)*(x_))^(m_)*((c_.) + (d_.)*(x_))^(n_), x_Symbol] :> With[{p = Denominator[m]}, Dist[p/b, Sub
st[Int[x^(p*(m + 1) - 1)*(c - (a*d)/b + (d*x^p)/b)^n, x], x, (a + b*x)^(1/p)], x]] /; FreeQ[{a, b, c, d}, x] &
& NeQ[b*c - a*d, 0] && LtQ[-1, m, 0] && LeQ[-1, n, 0] && LeQ[Denominator[n], Denominator[m]] && IntLinearQ[a,
b, c, d, m, n, 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 444

Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.)*((c_) + (d_.)*(x_)^(n_))^(q_.), x_Symbol] :> Dist[1/n, Subst[Int
[(a + b*x)^p*(c + d*x)^q, x], x, x^n], x] /; FreeQ[{a, b, c, d, m, n, p, q}, x] && NeQ[b*c - a*d, 0] && EqQ[m
- n + 1, 0]

Rubi steps

\begin{align*} \int \frac{\sec ^2(x) \left (-\cos (2 x)+2 \tan ^2(x)\right )}{(\tan (x) \tan (2 x))^{3/2}} \, dx &=\int \frac{\sec ^2(x) \left (-\cos (2 x)+2 \tan ^2(x)\right )}{(-1+\sec (2 x))^{3/2}} \, dx\\ &=\operatorname{Subst}\left (\int \frac{\left (1-x^2\right ) \left (-1+3 x^2+2 x^4\right )}{2 \sqrt{2} x^2 \sqrt{\frac{x^2}{1-x^2}} \left (1+x^2\right )} \, dx,x,\tan (x)\right )\\ &=\frac{\operatorname{Subst}\left (\int \frac{\left (1-x^2\right ) \left (-1+3 x^2+2 x^4\right )}{x^2 \sqrt{\frac{x^2}{1-x^2}} \left (1+x^2\right )} \, dx,x,\tan (x)\right )}{2 \sqrt{2}}\\ &=\frac{\tan (x) \operatorname{Subst}\left (\int \frac{\left (1-x^2\right )^{3/2} \left (-1+3 x^2+2 x^4\right )}{x^3 \left (1+x^2\right )} \, dx,x,\tan (x)\right )}{2 \sqrt{2} \sqrt{\frac{\tan ^2(x)}{1-\tan ^2(x)}} \sqrt{1-\tan ^2(x)}}\\ &=\frac{\tan (x) \operatorname{Subst}\left (\int \left (-\frac{\left (1-x^2\right )^{3/2}}{x^3}+\frac{4 \left (1-x^2\right )^{3/2}}{x}-\frac{2 x \left (1-x^2\right )^{3/2}}{1+x^2}\right ) \, dx,x,\tan (x)\right )}{2 \sqrt{2} \sqrt{\frac{\tan ^2(x)}{1-\tan ^2(x)}} \sqrt{1-\tan ^2(x)}}\\ &=-\frac{\tan (x) \operatorname{Subst}\left (\int \frac{\left (1-x^2\right )^{3/2}}{x^3} \, dx,x,\tan (x)\right )}{2 \sqrt{2} \sqrt{\frac{\tan ^2(x)}{1-\tan ^2(x)}} \sqrt{1-\tan ^2(x)}}-\frac{\tan (x) \operatorname{Subst}\left (\int \frac{x \left (1-x^2\right )^{3/2}}{1+x^2} \, dx,x,\tan (x)\right )}{\sqrt{2} \sqrt{\frac{\tan ^2(x)}{1-\tan ^2(x)}} \sqrt{1-\tan ^2(x)}}+\frac{\left (\sqrt{2} \tan (x)\right ) \operatorname{Subst}\left (\int \frac{\left (1-x^2\right )^{3/2}}{x} \, dx,x,\tan (x)\right )}{\sqrt{\frac{\tan ^2(x)}{1-\tan ^2(x)}} \sqrt{1-\tan ^2(x)}}\\ &=-\frac{\tan (x) \operatorname{Subst}\left (\int \frac{(1-x)^{3/2}}{x^2} \, dx,x,\tan ^2(x)\right )}{4 \sqrt{2} \sqrt{\frac{\tan ^2(x)}{1-\tan ^2(x)}} \sqrt{1-\tan ^2(x)}}-\frac{\tan (x) \operatorname{Subst}\left (\int \frac{(1-x)^{3/2}}{1+x} \, dx,x,\tan ^2(x)\right )}{2 \sqrt{2} \sqrt{\frac{\tan ^2(x)}{1-\tan ^2(x)}} \sqrt{1-\tan ^2(x)}}+\frac{\tan (x) \operatorname{Subst}\left (\int \frac{(1-x)^{3/2}}{x} \, dx,x,\tan ^2(x)\right )}{\sqrt{2} \sqrt{\frac{\tan ^2(x)}{1-\tan ^2(x)}} \sqrt{1-\tan ^2(x)}}\\ &=\frac{\cot (x) \left (1-\tan ^2(x)\right )}{4 \sqrt{2} \sqrt{\frac{\tan ^2(x)}{1-\tan ^2(x)}}}-\frac{\tan (x) \left (1-\tan ^2(x)\right )}{3 \sqrt{2} \sqrt{\frac{\tan ^2(x)}{1-\tan ^2(x)}}}+\frac{\sqrt{2} \tan (x) \left (1-\tan ^2(x)\right )}{3 \sqrt{\frac{\tan ^2(x)}{1-\tan ^2(x)}}}+\frac{(3 \tan (x)) \operatorname{Subst}\left (\int \frac{\sqrt{1-x}}{x} \, dx,x,\tan ^2(x)\right )}{8 \sqrt{2} \sqrt{\frac{\tan ^2(x)}{1-\tan ^2(x)}} \sqrt{1-\tan ^2(x)}}+\frac{\tan (x) \operatorname{Subst}\left (\int \frac{\sqrt{1-x}}{x} \, dx,x,\tan ^2(x)\right )}{\sqrt{2} \sqrt{\frac{\tan ^2(x)}{1-\tan ^2(x)}} \sqrt{1-\tan ^2(x)}}-\frac{\tan (x) \operatorname{Subst}\left (\int \frac{\sqrt{1-x}}{1+x} \, dx,x,\tan ^2(x)\right )}{\sqrt{2} \sqrt{\frac{\tan ^2(x)}{1-\tan ^2(x)}} \sqrt{1-\tan ^2(x)}}\\ &=\frac{3 \tan (x)}{4 \sqrt{2} \sqrt{\frac{\tan ^2(x)}{1-\tan ^2(x)}}}+\frac{\cot (x) \left (1-\tan ^2(x)\right )}{4 \sqrt{2} \sqrt{\frac{\tan ^2(x)}{1-\tan ^2(x)}}}-\frac{\tan (x) \left (1-\tan ^2(x)\right )}{3 \sqrt{2} \sqrt{\frac{\tan ^2(x)}{1-\tan ^2(x)}}}+\frac{\sqrt{2} \tan (x) \left (1-\tan ^2(x)\right )}{3 \sqrt{\frac{\tan ^2(x)}{1-\tan ^2(x)}}}+\frac{(3 \tan (x)) \operatorname{Subst}\left (\int \frac{1}{\sqrt{1-x} x} \, dx,x,\tan ^2(x)\right )}{8 \sqrt{2} \sqrt{\frac{\tan ^2(x)}{1-\tan ^2(x)}} \sqrt{1-\tan ^2(x)}}+\frac{\tan (x) \operatorname{Subst}\left (\int \frac{1}{\sqrt{1-x} x} \, dx,x,\tan ^2(x)\right )}{\sqrt{2} \sqrt{\frac{\tan ^2(x)}{1-\tan ^2(x)}} \sqrt{1-\tan ^2(x)}}-\frac{\left (\sqrt{2} \tan (x)\right ) \operatorname{Subst}\left (\int \frac{1}{\sqrt{1-x} (1+x)} \, dx,x,\tan ^2(x)\right )}{\sqrt{\frac{\tan ^2(x)}{1-\tan ^2(x)}} \sqrt{1-\tan ^2(x)}}\\ &=\frac{3 \tan (x)}{4 \sqrt{2} \sqrt{\frac{\tan ^2(x)}{1-\tan ^2(x)}}}+\frac{\cot (x) \left (1-\tan ^2(x)\right )}{4 \sqrt{2} \sqrt{\frac{\tan ^2(x)}{1-\tan ^2(x)}}}-\frac{\tan (x) \left (1-\tan ^2(x)\right )}{3 \sqrt{2} \sqrt{\frac{\tan ^2(x)}{1-\tan ^2(x)}}}+\frac{\sqrt{2} \tan (x) \left (1-\tan ^2(x)\right )}{3 \sqrt{\frac{\tan ^2(x)}{1-\tan ^2(x)}}}-\frac{(3 \tan (x)) \operatorname{Subst}\left (\int \frac{1}{1-x^2} \, dx,x,\sqrt{1-\tan ^2(x)}\right )}{4 \sqrt{2} \sqrt{\frac{\tan ^2(x)}{1-\tan ^2(x)}} \sqrt{1-\tan ^2(x)}}-\frac{\left (\sqrt{2} \tan (x)\right ) \operatorname{Subst}\left (\int \frac{1}{1-x^2} \, dx,x,\sqrt{1-\tan ^2(x)}\right )}{\sqrt{\frac{\tan ^2(x)}{1-\tan ^2(x)}} \sqrt{1-\tan ^2(x)}}+\frac{\left (2 \sqrt{2} \tan (x)\right ) \operatorname{Subst}\left (\int \frac{1}{2-x^2} \, dx,x,\sqrt{1-\tan ^2(x)}\right )}{\sqrt{\frac{\tan ^2(x)}{1-\tan ^2(x)}} \sqrt{1-\tan ^2(x)}}\\ &=\frac{3 \tan (x)}{4 \sqrt{2} \sqrt{\frac{\tan ^2(x)}{1-\tan ^2(x)}}}-\frac{3 \tanh ^{-1}\left (\sqrt{1-\tan ^2(x)}\right ) \tan (x)}{4 \sqrt{2} \sqrt{\frac{\tan ^2(x)}{1-\tan ^2(x)}} \sqrt{1-\tan ^2(x)}}-\frac{\sqrt{2} \tanh ^{-1}\left (\sqrt{1-\tan ^2(x)}\right ) \tan (x)}{\sqrt{\frac{\tan ^2(x)}{1-\tan ^2(x)}} \sqrt{1-\tan ^2(x)}}+\frac{2 \tanh ^{-1}\left (\frac{\sqrt{1-\tan ^2(x)}}{\sqrt{2}}\right ) \tan (x)}{\sqrt{\frac{\tan ^2(x)}{1-\tan ^2(x)}} \sqrt{1-\tan ^2(x)}}+\frac{\cot (x) \left (1-\tan ^2(x)\right )}{4 \sqrt{2} \sqrt{\frac{\tan ^2(x)}{1-\tan ^2(x)}}}-\frac{\tan (x) \left (1-\tan ^2(x)\right )}{3 \sqrt{2} \sqrt{\frac{\tan ^2(x)}{1-\tan ^2(x)}}}+\frac{\sqrt{2} \tan (x) \left (1-\tan ^2(x)\right )}{3 \sqrt{\frac{\tan ^2(x)}{1-\tan ^2(x)}}}\\ \end{align*}

Mathematica [A]  time = 4.59417, size = 168, normalized size = 1.68 \[ \frac{\tan ^2(2 x) \left (2 \tan ^2(x)-\cos (2 x)\right ) \left (-3 \sin (x) \cos (x) \tan ^{-1}\left (\sqrt{\tan ^2(x)-1}\right ) \sqrt{\tan ^2(x)-1}+\frac{4 \sqrt{2} \cos (2 x) \tan (x) \left (\sqrt{2} \tanh ^{-1}\left (\sqrt{1-\tan ^2(x)}\right )-2 \tanh ^{-1}\left (\frac{1}{2} \sqrt{2-2 \tan ^2(x)}\right )\right )}{\sqrt{1-\tan ^2(x)}}+\frac{1}{3} \left (-3 \cot (x)-4 \sin (x) \cos (x)+(9 \cos (2 x)+5) \tan ^3(x)\right )\right )}{2 (6 \cos (2 x)+\cos (4 x)-3) (\tan (x) \tan (2 x))^{3/2}} \]

Antiderivative was successfully verified.

[In]

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

[Out]

((-Cos[2*x] + 2*Tan[x]^2)*((4*Sqrt[2]*(-2*ArcTanh[Sqrt[2 - 2*Tan[x]^2]/2] + Sqrt[2]*ArcTanh[Sqrt[1 - Tan[x]^2]
])*Cos[2*x]*Tan[x])/Sqrt[1 - Tan[x]^2] - 3*ArcTan[Sqrt[-1 + Tan[x]^2]]*Cos[x]*Sin[x]*Sqrt[-1 + Tan[x]^2] + (-3
*Cot[x] - 4*Cos[x]*Sin[x] + (5 + 9*Cos[2*x])*Tan[x]^3)/3)*Tan[2*x]^2)/(2*(-3 + 6*Cos[2*x] + Cos[4*x])*(Tan[x]*
Tan[2*x])^(3/2))

________________________________________________________________________________________

Maple [B]  time = 0.482, size = 559, normalized size = 5.6 \begin{align*} \text{result too large to display} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

1/96*2^(1/2)*4^(1/2)*(cos(x)-1)^2*(48*cos(x)^4*arctanh(1/2*2^(1/2)*cos(x)*4^(1/2)*(cos(x)-1)/sin(x)^2/((2*cos(
x)^2-1)/(cos(x)+1)^2)^(1/2))*2^(1/2)-201*cos(x)^4*ln(-2*(cos(x)^2*((2*cos(x)^2-1)/(cos(x)+1)^2)^(1/2)-2*cos(x)
^2+cos(x)-((2*cos(x)^2-1)/(cos(x)+1)^2)^(1/2)+1)/sin(x)^2)+168*cos(x)^4*ln(-4*(cos(x)^2*((2*cos(x)^2-1)/(cos(x
)+1)^2)^(1/2)-2*cos(x)^2+cos(x)-((2*cos(x)^2-1)/(cos(x)+1)^2)^(1/2)+1)/sin(x)^2)-33*cos(x)^4*arctanh(1/2*4^(1/
2)*(2*cos(x)^2-3*cos(x)+1)/sin(x)^2/((2*cos(x)^2-1)/(cos(x)+1)^2)^(1/2))-22*cos(x)^4*((2*cos(x)^2-1)/(cos(x)+1
)^2)^(1/2)-48*cos(x)^3*arctanh(1/2*2^(1/2)*cos(x)*4^(1/2)*(cos(x)-1)/sin(x)^2/((2*cos(x)^2-1)/(cos(x)+1)^2)^(1
/2))*2^(1/2)+201*cos(x)^3*ln(-2*(cos(x)^2*((2*cos(x)^2-1)/(cos(x)+1)^2)^(1/2)-2*cos(x)^2+cos(x)-((2*cos(x)^2-1
)/(cos(x)+1)^2)^(1/2)+1)/sin(x)^2)-168*cos(x)^3*ln(-4*(cos(x)^2*((2*cos(x)^2-1)/(cos(x)+1)^2)^(1/2)-2*cos(x)^2
+cos(x)-((2*cos(x)^2-1)/(cos(x)+1)^2)^(1/2)+1)/sin(x)^2)+33*cos(x)^3*arctanh(1/2*4^(1/2)*(2*cos(x)^2-3*cos(x)+
1)/sin(x)^2/((2*cos(x)^2-1)/(cos(x)+1)^2)^(1/2))+36*cos(x)^2*((2*cos(x)^2-1)/(cos(x)+1)^2)^(1/2)-8*((2*cos(x)^
2-1)/(cos(x)+1)^2)^(1/2))/sin(x)^3/cos(x)^3/(sin(x)^2/(2*cos(x)^2-1))^(3/2)/((2*cos(x)^2-1)/(cos(x)+1)^2)^(3/2
)

________________________________________________________________________________________

Maxima [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{2 \, \tan \left (x\right )^{2} - \cos \left (2 \, x\right )}{\left (\tan \left (2 \, x\right ) \tan \left (x\right )\right )^{\frac{3}{2}} \cos \left (x\right )^{2}}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

integrate((2*tan(x)^2 - cos(2*x))/((tan(2*x)*tan(x))^(3/2)*cos(x)^2), x)

________________________________________________________________________________________

Fricas [B]  time = 3.30021, size = 784, normalized size = 7.84 \begin{align*} -\frac{24 \,{\left (\cos \left (x\right )^{5} - \cos \left (x\right )^{3}\right )} \log \left (-\frac{4 \, \sqrt{2}{\left (8 \, \cos \left (x\right )^{5} - 6 \, \cos \left (x\right )^{3} + \cos \left (x\right )\right )} \sqrt{-\frac{\cos \left (x\right )^{2} - 1}{2 \, \cos \left (x\right )^{2} - 1}} -{\left (32 \, \cos \left (x\right )^{4} - 16 \, \cos \left (x\right )^{2} + 1\right )} \sin \left (x\right )}{\sin \left (x\right )}\right ) \sin \left (x\right ) - 33 \,{\left (\sqrt{2} \cos \left (x\right )^{5} - \sqrt{2} \cos \left (x\right )^{3}\right )} \log \left (\frac{4 \,{\left (\sqrt{2}{\left (2 \,{\left (3 \, \sqrt{2} - 4\right )} \cos \left (x\right )^{3} -{\left (3 \, \sqrt{2} - 4\right )} \cos \left (x\right )\right )} \sqrt{-\frac{\cos \left (x\right )^{2} - 1}{2 \, \cos \left (x\right )^{2} - 1}} +{\left (3 \,{\left (2 \, \sqrt{2} - 3\right )} \cos \left (x\right )^{2} - 2 \, \sqrt{2} + 3\right )} \sin \left (x\right )\right )}}{{\left (\cos \left (x\right )^{2} - 1\right )} \sin \left (x\right )}\right ) \sin \left (x\right ) - 2 \, \sqrt{2}{\left (22 \, \cos \left (x\right )^{6} - 47 \, \cos \left (x\right )^{4} + 26 \, \cos \left (x\right )^{2} - 4\right )} \sqrt{-\frac{\cos \left (x\right )^{2} - 1}{2 \, \cos \left (x\right )^{2} - 1}} - 44 \,{\left (\cos \left (x\right )^{5} - \cos \left (x\right )^{3}\right )} \sin \left (x\right )}{48 \,{\left (\cos \left (x\right )^{5} - \cos \left (x\right )^{3}\right )} \sin \left (x\right )} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

-1/48*(24*(cos(x)^5 - cos(x)^3)*log(-(4*sqrt(2)*(8*cos(x)^5 - 6*cos(x)^3 + cos(x))*sqrt(-(cos(x)^2 - 1)/(2*cos
(x)^2 - 1)) - (32*cos(x)^4 - 16*cos(x)^2 + 1)*sin(x))/sin(x))*sin(x) - 33*(sqrt(2)*cos(x)^5 - sqrt(2)*cos(x)^3
)*log(4*(sqrt(2)*(2*(3*sqrt(2) - 4)*cos(x)^3 - (3*sqrt(2) - 4)*cos(x))*sqrt(-(cos(x)^2 - 1)/(2*cos(x)^2 - 1))
+ (3*(2*sqrt(2) - 3)*cos(x)^2 - 2*sqrt(2) + 3)*sin(x))/((cos(x)^2 - 1)*sin(x)))*sin(x) - 2*sqrt(2)*(22*cos(x)^
6 - 47*cos(x)^4 + 26*cos(x)^2 - 4)*sqrt(-(cos(x)^2 - 1)/(2*cos(x)^2 - 1)) - 44*(cos(x)^5 - cos(x)^3)*sin(x))/(
(cos(x)^5 - cos(x)^3)*sin(x))

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((-cos(2*x)+2*tan(x)**2)/cos(x)**2/(tan(x)*tan(2*x))**(3/2),x)

[Out]

Timed out

________________________________________________________________________________________

Giac [B]  time = 1.34416, size = 265, normalized size = 2.65 \begin{align*} \frac{11 \, \sqrt{2} \log \left (\sqrt{-\tan \left (x\right )^{2} + 1} + 1\right )}{16 \, \mathrm{sgn}\left (\tan \left (x\right )^{2} - 1\right ) \mathrm{sgn}\left (\tan \left (x\right )\right )} - \frac{11 \, \sqrt{2} \log \left (-\sqrt{-\tan \left (x\right )^{2} + 1} + 1\right )}{16 \, \mathrm{sgn}\left (\tan \left (x\right )^{2} - 1\right ) \mathrm{sgn}\left (\tan \left (x\right )\right )} - \frac{2 \, \sqrt{2}{\left (-\tan \left (x\right )^{2} + 1\right )}^{\frac{3}{2}} + 3 \, \sqrt{2} \sqrt{-\tan \left (x\right )^{2} + 1}}{12 \, \mathrm{sgn}\left (\tan \left (x\right )^{2} - 1\right ) \mathrm{sgn}\left (\tan \left (x\right )\right )} + \frac{\log \left (\frac{\sqrt{2} - \sqrt{-\tan \left (x\right )^{2} + 1}}{\sqrt{2} + \sqrt{-\tan \left (x\right )^{2} + 1}}\right )}{\mathrm{sgn}\left (\tan \left (x\right )^{2} - 1\right ) \mathrm{sgn}\left (\tan \left (x\right )\right )} - \frac{\sqrt{2} \sqrt{-\tan \left (x\right )^{2} + 1}}{8 \, \mathrm{sgn}\left (\tan \left (x\right )^{2} - 1\right ) \mathrm{sgn}\left (\tan \left (x\right )\right ) \tan \left (x\right )^{2}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

11/16*sqrt(2)*log(sqrt(-tan(x)^2 + 1) + 1)/(sgn(tan(x)^2 - 1)*sgn(tan(x))) - 11/16*sqrt(2)*log(-sqrt(-tan(x)^2
 + 1) + 1)/(sgn(tan(x)^2 - 1)*sgn(tan(x))) - 1/12*(2*sqrt(2)*(-tan(x)^2 + 1)^(3/2) + 3*sqrt(2)*sqrt(-tan(x)^2
+ 1))/(sgn(tan(x)^2 - 1)*sgn(tan(x))) + log((sqrt(2) - sqrt(-tan(x)^2 + 1))/(sqrt(2) + sqrt(-tan(x)^2 + 1)))/(
sgn(tan(x)^2 - 1)*sgn(tan(x))) - 1/8*sqrt(2)*sqrt(-tan(x)^2 + 1)/(sgn(tan(x)^2 - 1)*sgn(tan(x))*tan(x)^2)