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} \text {ArcTan}\left (\sqrt {\sec (x)-1}\right )-\cos (x) \text {ArcTan}\left (\sqrt {\sec (x)-1}\right )+\frac {1}{2} \cos (x) \sqrt {\sec (x)-1} \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 [C] Result contains higher order function than in optimal. Order 4 vs. order 3 in optimal.
time = 2.92, size = 283, normalized size = 6.90 \begin {gather*} -\tan ^{-1}\left (\sqrt {-1+\sec (x)}\right ) \cos (x)+\frac {1}{2} \cos (x) \sqrt {-1+\sec (x)}-\frac {1}{2} \left (-3-2 \sqrt {2}\right ) \cos ^2\left (\frac {x}{4}\right ) \left (1-\sqrt {2}+\left (-2+\sqrt {2}\right ) \cos \left (\frac {x}{2}\right )\right ) \cot \left (\frac {x}{4}\right ) \left (F\left (\sin ^{-1}\left (\frac {\tan \left (\frac {x}{4}\right )}{\sqrt {3-2 \sqrt {2}}}\right )|17-12 \sqrt {2}\right )-2 \Pi \left (-3+2 \sqrt {2};\sin ^{-1}\left (\frac {\tan \left (\frac {x}{4}\right )}{\sqrt {3-2 \sqrt {2}}}\right )|17-12 \sqrt {2}\right )\right ) \sqrt {\left (7-5 \sqrt {2}+\left (10-7 \sqrt {2}\right ) \cos \left (\frac {x}{2}\right )\right ) \sec ^2\left (\frac {x}{4}\right )} \sqrt {\left (-1-\sqrt {2}+\left (2+\sqrt {2}\right ) \cos \left (\frac {x}{2}\right )\right ) \sec ^2\left (\frac {x}{4}\right )} \sqrt {-1+\sec (x)} \sec (x) \sqrt {3-2 \sqrt {2}-\tan ^2\left (\frac {x}{4}\right )} \sqrt {1+\left (-3+2 \sqrt {2}\right ) \tan ^2\left (\frac {x}{4}\right )} \end {gather*}

Warning: Unable to verify antiderivative.

[In]

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

[Out]

-(ArcTan[Sqrt[-1 + Sec[x]]]*Cos[x]) + (Cos[x]*Sqrt[-1 + Sec[x]])/2 - ((-3 - 2*Sqrt[2])*Cos[x/4]^2*(1 - Sqrt[2]
 + (-2 + Sqrt[2])*Cos[x/2])*Cot[x/4]*(EllipticF[ArcSin[Tan[x/4]/Sqrt[3 - 2*Sqrt[2]]], 17 - 12*Sqrt[2]] - 2*Ell
ipticPi[-3 + 2*Sqrt[2], ArcSin[Tan[x/4]/Sqrt[3 - 2*Sqrt[2]]], 17 - 12*Sqrt[2]])*Sqrt[(7 - 5*Sqrt[2] + (10 - 7*
Sqrt[2])*Cos[x/2])*Sec[x/4]^2]*Sqrt[(-1 - Sqrt[2] + (2 + Sqrt[2])*Cos[x/2])*Sec[x/4]^2]*Sqrt[-1 + Sec[x]]*Sec[
x]*Sqrt[3 - 2*Sqrt[2] - Tan[x/4]^2]*Sqrt[1 + (-3 + 2*Sqrt[2])*Tan[x/4]^2])/2

________________________________________________________________________________________

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 = 2.59, 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 = 1.06, 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 [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

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

[Out]

undef

________________________________________________________________________________________

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

________________________________________________________________________________________