3.1.9 \(\int \tan ^{-1}(\sqrt {-1+\sec (x)}) \sin (x) \, dx\) [9]

Optimal. Leaf size=41 \[ \frac {1}{2} \tan ^{-1}\left (\sqrt {-1+\sec (x)}\right )-\tan ^{-1}\left (\sqrt {-1+\sec (x)}\right ) \cos (x)+\frac {1}{2} \cos (x) \sqrt {-1+\sec (x)} \]

[Out]

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

________________________________________________________________________________________

Rubi [A]
time = 0.02, antiderivative size = 41, normalized size of antiderivative = 1.00, number of steps used = 7, number of rules used = 7, integrand size = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.583, Rules used = {4420, 5311, 12, 248, 44, 65, 209} \begin {gather*} \frac {1}{2} \cos (x) \sqrt {\sec (x)-1}+\frac {1}{2} \tan ^{-1}\left (\sqrt {\sec (x)-1}\right )-\cos (x) \tan ^{-1}\left (\sqrt {\sec (x)-1}\right ) \end {gather*}

Antiderivative was successfully verified.

[In]

Int[ArcTan[Sqrt[-1 + Sec[x]]]*Sin[x],x]

[Out]

ArcTan[Sqrt[-1 + Sec[x]]]/2 - ArcTan[Sqrt[-1 + Sec[x]]]*Cos[x] + (Cos[x]*Sqrt[-1 + Sec[x]])/2

Rule 12

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

Rule 44

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

Rule 65

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 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 248

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

Rule 4420

Int[(u_)*(F_)[(c_.)*((a_.) + (b_.)*(x_))], x_Symbol] :> With[{d = FreeFactors[Cos[c*(a + b*x)], x]}, Dist[-d/(
b*c), Subst[Int[SubstFor[1, Cos[c*(a + b*x)]/d, u, x], x], x, Cos[c*(a + b*x)]/d], x] /; FunctionOfQ[Cos[c*(a
+ b*x)]/d, u, x, True]] /; FreeQ[{a, b, c}, x] && (EqQ[F, Sin] || EqQ[F, sin])

Rule 5311

Int[ArcTan[u_], x_Symbol] :> Simp[x*ArcTan[u], x] - Int[SimplifyIntegrand[x*(D[u, x]/(1 + u^2)), x], x] /; Inv
erseFunctionFreeQ[u, x]

Rubi steps

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

________________________________________________________________________________________

Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(87\) vs. \(2(41)=82\).
time = 0.74, size = 87, normalized size = 2.12 \begin {gather*} -\tan ^{-1}\left (\sqrt {-1+\sec (x)}\right ) \cos (x)+\frac {1}{8} \left (4 \cos (x)+\sqrt {2} \tan ^{-1}\left (\frac {2 \sqrt {2} \tan \left (\frac {x}{4}\right )}{\sqrt {\cos (x) \sec ^4\left (\frac {x}{4}\right )}}\right ) \cot \left (\frac {x}{4}\right ) \sqrt {\cos (x) \sec ^4\left (\frac {x}{4}\right )}\right ) \sqrt {-1+\sec (x)} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[ArcTan[Sqrt[-1 + Sec[x]]]*Sin[x],x]

[Out]

-(ArcTan[Sqrt[-1 + Sec[x]]]*Cos[x]) + ((4*Cos[x] + Sqrt[2]*ArcTan[(2*Sqrt[2]*Tan[x/4])/Sqrt[Cos[x]*Sec[x/4]^4]
]*Cot[x/4]*Sqrt[Cos[x]*Sec[x/4]^4])*Sqrt[-1 + Sec[x]])/8

________________________________________________________________________________________

Mathics [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {cought exception: maximum recursion depth exceeded} \end {gather*}

Warning: Unable to verify antiderivative.

[In]

mathics('Integrate[Sin[x]*ArcTan[Sqrt[Sec[x] - 1]],x]')

[Out]

cought exception: maximum recursion depth exceeded

________________________________________________________________________________________

Maple [A]
time = 0.07, size = 42, normalized size = 1.02

method result size
derivativedivides \(-\frac {\arctan \left (\sqrt {-\left (\frac {1}{\sec \left (x \right )}-1\right ) \sec \left (x \right )}\right )}{\sec \left (x \right )}+\frac {\sqrt {-1+\sec \left (x \right )}}{2 \sec \left (x \right )}+\frac {\arctan \left (\sqrt {-1+\sec \left (x \right )}\right )}{2}\) \(42\)
default \(-\frac {\arctan \left (\sqrt {-\left (\frac {1}{\sec \left (x \right )}-1\right ) \sec \left (x \right )}\right )}{\sec \left (x \right )}+\frac {\sqrt {-1+\sec \left (x \right )}}{2 \sec \left (x \right )}+\frac {\arctan \left (\sqrt {-1+\sec \left (x \right )}\right )}{2}\) \(42\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(arctan((-1+sec(x))^(1/2))*sin(x),x,method=_RETURNVERBOSE)

[Out]

-1/sec(x)*arctan((-(1/sec(x)-1)*sec(x))^(1/2))+1/2*(-1+sec(x))^(1/2)/sec(x)+1/2*arctan((-1+sec(x))^(1/2))

________________________________________________________________________________________

Maxima [A]
time = 0.36, size = 60, normalized size = 1.46 \begin {gather*} -\arctan \left (\sqrt {-\frac {\cos \left (x\right ) - 1}{\cos \left (x\right )}}\right ) \cos \left (x\right ) - \frac {\sqrt {-\frac {\cos \left (x\right ) - 1}{\cos \left (x\right )}}}{2 \, {\left (\frac {\cos \left (x\right ) - 1}{\cos \left (x\right )} - 1\right )}} + \frac {1}{2} \, \arctan \left (\sqrt {-\frac {\cos \left (x\right ) - 1}{\cos \left (x\right )}}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(arctan((-1+sec(x))^(1/2))*sin(x),x, algorithm="maxima")

[Out]

-arctan(sqrt(-(cos(x) - 1)/cos(x)))*cos(x) - 1/2*sqrt(-(cos(x) - 1)/cos(x))/((cos(x) - 1)/cos(x) - 1) + 1/2*ar
ctan(sqrt(-(cos(x) - 1)/cos(x)))

________________________________________________________________________________________

Fricas [A]
time = 0.35, size = 32, normalized size = 0.78 \begin {gather*} -\frac {1}{2} \, {\left (2 \, \cos \left (x\right ) - 1\right )} \arctan \left (\sqrt {\sec \left (x\right ) - 1}\right ) + \frac {1}{2} \, \sqrt {-\frac {\cos \left (x\right ) - 1}{\cos \left (x\right )}} \cos \left (x\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(arctan((-1+sec(x))^(1/2))*sin(x),x, algorithm="fricas")

[Out]

-1/2*(2*cos(x) - 1)*arctan(sqrt(sec(x) - 1)) + 1/2*sqrt(-(cos(x) - 1)/cos(x))*cos(x)

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \sin {\left (x \right )} \operatorname {atan}{\left (\sqrt {\sec {\left (x \right )} - 1} \right )}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(atan((-1+sec(x))**(1/2))*sin(x),x)

[Out]

Integral(sin(x)*atan(sqrt(sec(x) - 1)), x)

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 130 vs. \(2 (31) = 62\).
time = 0.03, size = 138, normalized size = 3.37 \begin {gather*} \left (\frac {\arcsin \left (2 \cos x-1\right )}{2 \left (\mathrm {sign}\left (\cos x\right )^{2}-1\right )}+\frac {\mathrm {sign}\left (\cos x\right )^{2} \arctan \left (\frac {\mathrm {sign}\left (\cos x\right )^{2}+\frac {-2 \sqrt {-\cos ^{2}x+\cos x}+1}{-2 \cos x+1}+\frac {\left (-2 \sqrt {-\cos ^{2}x+\cos x}+1\right ) \mathrm {sign}\left (\cos x\right )^{2}}{-2 \cos x+1}-1}{2 \mathrm {sign}\left (\cos x\right )}\right )}{\left (\mathrm {sign}\left (\cos x\right )^{2}-1\right ) \mathrm {sign}\left (\cos x\right )}\right ) \mathrm {sign}\left (\cos x\right )-\cos x\cdot \arctan \left (\frac {\sqrt {-\cos ^{2}x+\cos x} \mathrm {sign}\left (\cos x\right )}{\cos x}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(arctan((-1+sec(x))^(1/2))*sin(x),x)

[Out]

-arctan(sqrt(-cos(x)^2 + cos(x))*sgn(cos(x))/cos(x))*cos(x) + 1/2*(2*arctan(1/2*((2*sqrt(-cos(x)^2 + cos(x)) -
 1)*sgn(cos(x))^2/(2*cos(x) - 1) + sgn(cos(x))^2 + (2*sqrt(-cos(x)^2 + cos(x)) - 1)/(2*cos(x) - 1) - 1)/sgn(co
s(x)))*sgn(cos(x))/(sgn(cos(x))^2 - 1) + arcsin(2*cos(x) - 1)/(sgn(cos(x))^2 - 1))*sgn(cos(x))

________________________________________________________________________________________

Mupad [B]
time = 0.42, size = 60, normalized size = 1.46 \begin {gather*} -\mathrm {atan}\left (\sqrt {\frac {1}{\cos \left (x\right )}-1}\right )\,\cos \left (x\right )-\frac {\cos \left (x\right )\,\left (\frac {3\,\mathrm {asin}\left (\sqrt {\cos \left (x\right )}\right )}{2\,{\cos \left (x\right )}^{3/2}}-\frac {3\,\sqrt {1-\cos \left (x\right )}}{2\,\cos \left (x\right )}\right )\,\sqrt {1-\cos \left (x\right )}}{3\,\sqrt {\frac {1}{\cos \left (x\right )}-1}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(atan((1/cos(x) - 1)^(1/2))*sin(x),x)

[Out]

- atan((1/cos(x) - 1)^(1/2))*cos(x) - (cos(x)*((3*asin(cos(x)^(1/2)))/(2*cos(x)^(3/2)) - (3*(1 - cos(x))^(1/2)
)/(2*cos(x)))*(1 - cos(x))^(1/2))/(3*(1/cos(x) - 1)^(1/2))

________________________________________________________________________________________