3.912 \(\int \frac{\cos (x)+\sin (x)}{\sqrt{\cos (x)} \sqrt{\sin (x)}} \, dx\)

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

[Out]

-(Sqrt[2]*ArcTan[1 - (Sqrt[2]*Sqrt[Sin[x]])/Sqrt[Cos[x]]]) + Sqrt[2]*ArcTan[1 + (Sqrt[2]*Sqrt[Sin[x]])/Sqrt[Co
s[x]]]

________________________________________________________________________________________

Rubi [B]  time = 0.211369, antiderivative size = 243, normalized size of antiderivative = 4.26, number of steps used = 22, number of rules used = 9, integrand size = 18, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.5, Rules used = {3107, 2575, 297, 1162, 617, 204, 1165, 628, 2574} \[ \frac{\tan ^{-1}\left (1-\frac{\sqrt{2} \sqrt{\cos (x)}}{\sqrt{\sin (x)}}\right )}{\sqrt{2}}-\frac{\tan ^{-1}\left (\frac{\sqrt{2} \sqrt{\cos (x)}}{\sqrt{\sin (x)}}+1\right )}{\sqrt{2}}-\frac{\tan ^{-1}\left (1-\frac{\sqrt{2} \sqrt{\sin (x)}}{\sqrt{\cos (x)}}\right )}{\sqrt{2}}+\frac{\tan ^{-1}\left (\frac{\sqrt{2} \sqrt{\sin (x)}}{\sqrt{\cos (x)}}+1\right )}{\sqrt{2}}+\frac{\log \left (\tan (x)-\frac{\sqrt{2} \sqrt{\sin (x)}}{\sqrt{\cos (x)}}+1\right )}{2 \sqrt{2}}-\frac{\log \left (\tan (x)+\frac{\sqrt{2} \sqrt{\sin (x)}}{\sqrt{\cos (x)}}+1\right )}{2 \sqrt{2}}-\frac{\log \left (\cot (x)-\frac{\sqrt{2} \sqrt{\cos (x)}}{\sqrt{\sin (x)}}+1\right )}{2 \sqrt{2}}+\frac{\log \left (\cot (x)+\frac{\sqrt{2} \sqrt{\cos (x)}}{\sqrt{\sin (x)}}+1\right )}{2 \sqrt{2}} \]

Antiderivative was successfully verified.

[In]

Int[(Cos[x] + Sin[x])/(Sqrt[Cos[x]]*Sqrt[Sin[x]]),x]

[Out]

ArcTan[1 - (Sqrt[2]*Sqrt[Cos[x]])/Sqrt[Sin[x]]]/Sqrt[2] - ArcTan[1 + (Sqrt[2]*Sqrt[Cos[x]])/Sqrt[Sin[x]]]/Sqrt
[2] - ArcTan[1 - (Sqrt[2]*Sqrt[Sin[x]])/Sqrt[Cos[x]]]/Sqrt[2] + ArcTan[1 + (Sqrt[2]*Sqrt[Sin[x]])/Sqrt[Cos[x]]
]/Sqrt[2] - Log[1 + Cot[x] - (Sqrt[2]*Sqrt[Cos[x]])/Sqrt[Sin[x]]]/(2*Sqrt[2]) + Log[1 + Cot[x] + (Sqrt[2]*Sqrt
[Cos[x]])/Sqrt[Sin[x]]]/(2*Sqrt[2]) + Log[1 - (Sqrt[2]*Sqrt[Sin[x]])/Sqrt[Cos[x]] + Tan[x]]/(2*Sqrt[2]) - Log[
1 + (Sqrt[2]*Sqrt[Sin[x]])/Sqrt[Cos[x]] + Tan[x]]/(2*Sqrt[2])

Rule 3107

Int[cos[(c_.) + (d_.)*(x_)]^(m_.)*sin[(c_.) + (d_.)*(x_)]^(n_.)*(cos[(c_.) + (d_.)*(x_)]*(a_.) + (b_.)*sin[(c_
.) + (d_.)*(x_)])^(p_.), x_Symbol] :> Int[ExpandTrig[cos[c + d*x]^m*sin[c + d*x]^n*(a*cos[c + d*x] + b*sin[c +
 d*x])^p, x], x] /; FreeQ[{a, b, c, d, m, n}, x] && IGtQ[p, 0]

Rule 2575

Int[(cos[(e_.) + (f_.)*(x_)]*(a_.))^(m_)*((b_.)*sin[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> With[{k = Denomina
tor[m]}, -Dist[(k*a*b)/f, Subst[Int[x^(k*(m + 1) - 1)/(a^2 + b^2*x^(2*k)), x], x, (a*Cos[e + f*x])^(1/k)/(b*Si
n[e + f*x])^(1/k)], x]] /; FreeQ[{a, b, e, f}, x] && EqQ[m + n, 0] && GtQ[m, 0] && LtQ[m, 1]

Rule 297

Int[(x_)^2/((a_) + (b_.)*(x_)^4), x_Symbol] :> With[{r = Numerator[Rt[a/b, 2]], s = Denominator[Rt[a/b, 2]]},
Dist[1/(2*s), Int[(r + s*x^2)/(a + b*x^4), x], x] - Dist[1/(2*s), Int[(r - s*x^2)/(a + b*x^4), x], x]] /; Free
Q[{a, b}, x] && (GtQ[a/b, 0] || (PosQ[a/b] && AtomQ[SplitProduct[SumBaseQ, a]] && AtomQ[SplitProduct[SumBaseQ,
 b]]))

Rule 1162

Int[((d_) + (e_.)*(x_)^2)/((a_) + (c_.)*(x_)^4), x_Symbol] :> With[{q = Rt[(2*d)/e, 2]}, Dist[e/(2*c), Int[1/S
imp[d/e + q*x + x^2, x], x], x] + Dist[e/(2*c), Int[1/Simp[d/e - q*x + x^2, x], x], x]] /; FreeQ[{a, c, d, e},
 x] && EqQ[c*d^2 - a*e^2, 0] && PosQ[d*e]

Rule 617

Int[((a_) + (b_.)*(x_) + (c_.)*(x_)^2)^(-1), x_Symbol] :> With[{q = 1 - 4*Simplify[(a*c)/b^2]}, Dist[-2/b, Sub
st[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])] /;
 FreeQ[{a, b, c}, x] && NeQ[b^2 - 4*a*c, 0]

Rule 204

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

Rule 1165

Int[((d_) + (e_.)*(x_)^2)/((a_) + (c_.)*(x_)^4), x_Symbol] :> With[{q = Rt[(-2*d)/e, 2]}, Dist[e/(2*c*q), Int[
(q - 2*x)/Simp[d/e + q*x - x^2, x], x], x] + Dist[e/(2*c*q), Int[(q + 2*x)/Simp[d/e - q*x - x^2, x], x], x]] /
; FreeQ[{a, c, d, e}, x] && EqQ[c*d^2 - a*e^2, 0] && NegQ[d*e]

Rule 628

Int[((d_) + (e_.)*(x_))/((a_.) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> Simp[(d*Log[RemoveContent[a + b*x +
c*x^2, x]])/b, x] /; FreeQ[{a, b, c, d, e}, x] && EqQ[2*c*d - b*e, 0]

Rule 2574

Int[(cos[(e_.) + (f_.)*(x_)]*(b_.))^(n_)*((a_.)*sin[(e_.) + (f_.)*(x_)])^(m_), x_Symbol] :> With[{k = Denomina
tor[m]}, Dist[(k*a*b)/f, Subst[Int[x^(k*(m + 1) - 1)/(a^2 + b^2*x^(2*k)), x], x, (a*Sin[e + f*x])^(1/k)/(b*Cos
[e + f*x])^(1/k)], x]] /; FreeQ[{a, b, e, f}, x] && EqQ[m + n, 0] && GtQ[m, 0] && LtQ[m, 1]

Rubi steps

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

Mathematica [C]  time = 0.0567925, size = 68, normalized size = 1.19 \[ \frac{2 \sqrt{\sin (x)} \sqrt [4]{\cos ^2(x)} \left (\sin (x) \sqrt{\cos ^2(x)} \text{Hypergeometric2F1}\left (\frac{3}{4},\frac{3}{4},\frac{7}{4},\sin ^2(x)\right )+3 \cos (x) \text{Hypergeometric2F1}\left (\frac{1}{4},\frac{1}{4},\frac{5}{4},\sin ^2(x)\right )\right )}{3 \cos ^{\frac{3}{2}}(x)} \]

Antiderivative was successfully verified.

[In]

Integrate[(Cos[x] + Sin[x])/(Sqrt[Cos[x]]*Sqrt[Sin[x]]),x]

[Out]

(2*(Cos[x]^2)^(1/4)*Sqrt[Sin[x]]*(3*Cos[x]*Hypergeometric2F1[1/4, 1/4, 5/4, Sin[x]^2] + Sqrt[Cos[x]^2]*Hyperge
ometric2F1[3/4, 3/4, 7/4, Sin[x]^2]*Sin[x]))/(3*Cos[x]^(3/2))

________________________________________________________________________________________

Maple [C]  time = 0.157, size = 137, normalized size = 2.4 \begin{align*} -{\frac{\sqrt{2}}{-1+\cos \left ( x \right ) }\sqrt{{\frac{\sin \left ( x \right ) +1-\cos \left ( x \right ) }{\sin \left ( x \right ) }}}\sqrt{{\frac{\cos \left ( x \right ) -1+\sin \left ( x \right ) }{\sin \left ( x \right ) }}}\sqrt{{\frac{-1+\cos \left ( x \right ) }{\sin \left ( x \right ) }}} \left ( \sin \left ( x \right ) \right ) ^{{\frac{3}{2}}} \left ( i{\it EllipticPi} \left ( \sqrt{{\frac{\sin \left ( x \right ) +1-\cos \left ( x \right ) }{\sin \left ( x \right ) }}},{\frac{1}{2}}-{\frac{i}{2}},{\frac{\sqrt{2}}{2}} \right ) -i{\it EllipticPi} \left ( \sqrt{{\frac{\sin \left ( x \right ) +1-\cos \left ( x \right ) }{\sin \left ( x \right ) }}},{\frac{1}{2}}+{\frac{i}{2}},{\frac{\sqrt{2}}{2}} \right ) -{\it EllipticF} \left ( \sqrt{{\frac{\sin \left ( x \right ) +1-\cos \left ( x \right ) }{\sin \left ( x \right ) }}},{\frac{\sqrt{2}}{2}} \right ) \right ){\frac{1}{\sqrt{\cos \left ( x \right ) }}}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((cos(x)+sin(x))/cos(x)^(1/2)/sin(x)^(1/2),x)

[Out]

-((sin(x)+1-cos(x))/sin(x))^(1/2)*2^(1/2)*((cos(x)-1+sin(x))/sin(x))^(1/2)*((-1+cos(x))/sin(x))^(1/2)*sin(x)^(
3/2)*(I*EllipticPi(((sin(x)+1-cos(x))/sin(x))^(1/2),1/2-1/2*I,1/2*2^(1/2))-I*EllipticPi(((sin(x)+1-cos(x))/sin
(x))^(1/2),1/2+1/2*I,1/2*2^(1/2))-EllipticF(((sin(x)+1-cos(x))/sin(x))^(1/2),1/2*2^(1/2)))/cos(x)^(1/2)/(-1+co
s(x))

________________________________________________________________________________________

Maxima [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\cos \left (x\right ) + \sin \left (x\right )}{\sqrt{\cos \left (x\right )} \sqrt{\sin \left (x\right )}}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((cos(x)+sin(x))/cos(x)^(1/2)/sin(x)^(1/2),x, algorithm="maxima")

[Out]

integrate((cos(x) + sin(x))/(sqrt(cos(x))*sqrt(sin(x))), x)

________________________________________________________________________________________

Fricas [B]  time = 2.39579, size = 275, normalized size = 4.82 \begin{align*} -\frac{1}{4} \, \sqrt{2} \arctan \left (-\frac{{\left (32 \, \sqrt{2} \cos \left (x\right )^{4} - 32 \, \sqrt{2} \cos \left (x\right )^{2} + 16 \, \sqrt{2} \cos \left (x\right ) \sin \left (x\right ) - \sqrt{2}\right )} \sqrt{\cos \left (x\right )} \sqrt{\sin \left (x\right )}}{8 \,{\left (4 \, \cos \left (x\right )^{5} - 3 \, \cos \left (x\right )^{3} -{\left (4 \, \cos \left (x\right )^{4} - 5 \, \cos \left (x\right )^{2}\right )} \sin \left (x\right ) - \cos \left (x\right )\right )}}\right ) \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((cos(x)+sin(x))/cos(x)^(1/2)/sin(x)^(1/2),x, algorithm="fricas")

[Out]

-1/4*sqrt(2)*arctan(-1/8*(32*sqrt(2)*cos(x)^4 - 32*sqrt(2)*cos(x)^2 + 16*sqrt(2)*cos(x)*sin(x) - sqrt(2))*sqrt
(cos(x))*sqrt(sin(x))/(4*cos(x)^5 - 3*cos(x)^3 - (4*cos(x)^4 - 5*cos(x)^2)*sin(x) - cos(x)))

________________________________________________________________________________________

Sympy [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\sin{\left (x \right )} + \cos{\left (x \right )}}{\sqrt{\sin{\left (x \right )}} \sqrt{\cos{\left (x \right )}}}\, dx \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((cos(x)+sin(x))/cos(x)**(1/2)/sin(x)**(1/2),x)

[Out]

Integral((sin(x) + cos(x))/(sqrt(sin(x))*sqrt(cos(x))), x)

________________________________________________________________________________________

Giac [F]  time = 0., size = 0, normalized size = 0. \begin{align*} \int \frac{\cos \left (x\right ) + \sin \left (x\right )}{\sqrt{\cos \left (x\right )} \sqrt{\sin \left (x\right )}}\,{d x} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((cos(x)+sin(x))/cos(x)^(1/2)/sin(x)^(1/2),x, algorithm="giac")

[Out]

integrate((cos(x) + sin(x))/(sqrt(cos(x))*sqrt(sin(x))), x)