$\newcommand{\bbx}[1]{\,\bbox[8px,border:1px groove navy]{\displaystyle{#1}}\,}
\newcommand{\braces}[1]{\left\lbrace\,{#1}\,\right\rbrace}
\newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack}
\newcommand{\dd}{\mathrm{d}}
\newcommand{\ds}[1]{\displaystyle{#1}}
\newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,}
\newcommand{\ic}{\mathrm{i}}
\newcommand{\mc}[1]{\mathcal{#1}}
\newcommand{\mrm}[1]{\mathrm{#1}}
\newcommand{\pars}[1]{\left(\,{#1}\,\right)}
\newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
\newcommand{\root}[2][]{\,\sqrt[#1]{\,{#2}\,}\,}
\newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}}
\newcommand{\verts}[1]{\left\vert\,{#1}\,\right\vert}$
\begin{align}
&\bbox[#ffe,10px]{\ds{\int_{0}^{\pi/4}{\root{\sin\pars{2x}} \over \cos^{2}\pars{x}}\,\dd x}} =
\int_{0}^{\pi/4}{\root{\sin\pars{2x}} \over \bracks{1 + \cos\pars{2x}}/2}\,\dd x
\\[5mm] \stackrel{2x\ \mapsto\ x}{=}\,\,\,&
\int_{0}^{\pi/2}{\root{\sin\pars{x}} \over 1 + \cos\pars{x}}\,\dd x
\\[5mm] = & \
\left.\Re\int_{x = 0}^{\pi/2}\pars{z - 1/z \over 2\ic}^{1/2}
{1 \over 1 + \pars{z + 1/z}/2}\,{\dd z \over \ic z}\,\right\vert_{\ z\ =\ \exp\pars{\ic x}}
\\[5mm] = &\
\left.\root{2}\,\Im\int_{x = 0}^{\pi/2}\pars{{1 - z^{2} \over z}\,\ic}^{1/2}
{\dd z \over \pars{1 + z}^{2}}\,\right\vert_{\ z\ =\ \exp\pars{\ic x}}
\\[1cm] \stackrel{\mrm{as}\ \epsilon\ \to\ 0^{+}}{\sim} &\
-\root{2}\,\Im\int_{1}^{\epsilon}\pars{1 + y^{2} \over y}^{1/2}
\,{\ic\,\dd y \over \pars{1 + \ic y}^{2}}
\\[3mm] &\ -
\root{2}\,\Im\int_{\pi/2}^{0}{\exp\pars{\ic\bracks{\pi/4 - \theta/2}} \over \epsilon^{1/2}}
\,\epsilon\expo{\ic\theta}\ic\dd\theta
\\[3mm] &\
-\root{2}\,\Im\int_{\epsilon}^{1}\pars{1 - x^{2} \over x}^{1/2}\expo{\ic\pi/4}\,{\dd x \over \pars{1 + x}^{2}}
\\[1cm] \stackrel{\mrm{as}\ \epsilon\ \to\ 0^{+}}{\to} &\
\root{2}\,\int_{0}^{1}\pars{1 + y^{2} \over y}^{1/2}
\,{1 - y^{2} \over \pars{1 + y^{2}}^{2}}\,\dd y \\ & -
\int_{0}^{1}\pars{1 - x^{2} \over x}^{1/2}\,{\dd x \over \pars{1 + x}^{2}}
\\[5mm] & =
\underbrace{\root{2}\,\int_{0}^{1}
\,{1 - y^{2} \over \pars{1 + y^{2}}^{3/2}}\,{\dd y \over y^{1/2}}}
_{\ds{\mc{I}_{1}}}\ -\
\underbrace{\int_{0}^{1}{\pars{1 - x}^{1/2} \over \pars{1 + x}^{3/2}}
\,{\dd x \over x^{1/2}}}_{\ds{\mc{I}_{2}}} = \,\mc{I}_{1} - \,\mc{I}_{2}
\label{1}\tag{1}
\end{align}
\begin{align}
\mc{I}_{1} & \equiv
\root{2}\,\int_{0}^{1}
\,{1 - y^{2} \over \pars{1 + y^{2}}^{3/2}}\,{\dd y \over y^{1/2}} =
-\root{2}\,\int_{0}^{1}
\,{-1/y^{2} + 1 \over \pars{1/y + y}^{3/2}}\,\dd y
\\[5mm] & \stackrel{1/y\ +\ y\ \mapsto\ y}{=}\,\,\,
-\root{2}\int_{\infty}^{2}{\dd y \over y^{3/2}}
\implies \bbx{\,\mc{I}_{1} = 2}\label{2}\tag{2}
\end{align}
\begin{align}
\mc{I}_{2} & \equiv
\int_{0}^{1}{\pars{1 - x}^{1/2} \over \pars{1 + x}^{3/2}}
\,{\dd x \over x^{1/2}} =
\int_{0}^{1}x^{-1/2}\,\pars{1 - x}^{1/2}\,
\bracks{1 - \pars{-1}x}^{\,-3/2}\,\dd x
\\[5mm] & =
\mrm{B}\pars{{1 \over 2},{3 \over 2}}\,
{}_{2}\mrm{F}_{1}\pars{{3 \over 2},{1 \over 2};2;-1}\label{3}\tag{3}
\end{align}
$\ds{\mrm{B}}$ and
$\ds{\,{}_{2}\mrm{F}_{1}\,}$ are the
Beta and
Hypergeometric Functions, respectively. \eqref{3} is the [Euler Type Expression of the Hypergeometric Function](https://en.wikipedia.org/wiki/Hypergeometric_function#Euler_type).
\begin{align}
\mbox{Note that}\quad\mrm{B}\pars{{1 \over 2},{3 \over 2}} & =
{\Gamma\pars{1/2}\Gamma\pars{3/2} \over \Gamma\pars{2}} = {\pi \over 2}
\label{4}\tag{4}
\end{align}
The Hypergeometric function is evaluated with the
[Kummer Theorem](https://en.wikipedia.org/wiki/Hypergeometric_function#Kummer.27s_theorem_.28z.C2.A0.3D.C2.A0.E2.88.921.29). Namely,
\begin{align}
{}_{2}\mrm{F}_{1}\pars{{3 \over 2},{1 \over 2};2;-1} & =
{\Gamma\pars{2}\Gamma\pars{7/4} \over \Gamma\pars{5/2}\Gamma\pars{5/4}} =
{\pars{3/4}\Gamma\pars{3/4} \over \bracks{\pars{1/2}\pars{3/2}\root{\pi}}\bracks{\pars{1/4}\Gamma\pars{1/4}}}
\\[5mm] & =
{4\,\Gamma\pars{3/4} \over \root{\pi}}\,
{1 \over \pi/\bracks{\Gamma\pars{3/4}\sin\pars{\pi/4}}} =
{2 \over \pi}\,\root{2 \over \pi}\Gamma^{2}\pars{3 \over 4}
\label{5}\tag{5}
\end{align}
With \eqref{4} and \eqref{5}, \eqref{3} becomes
$$
\bbx{\mc{I}_{2} \equiv
\int_{0}^{1}{\pars{1 - x}^{1/2} \over \pars{1 + x}^{3/2}}
\,{\dd x \over x^{1/2}} =
\root{2 \over \pi}\Gamma^{2}\pars{3 \over 4}}
$$
such that \eqref{1} becomes:
$$
\bbox[20px,#ffe,border:1px dotted navy]{\ds{%
\int_{0}^{\pi/4}{\root{\sin\pars{2x}} \over \cos^{2}\pars{x}}\,\dd x =
2 - \root{2 \over \pi}\Gamma^{2}\pars{3 \over 4}}}
$$