Consider this integral
$$\int_{0}^{\pi/4}\left[4\cos^2(x)-1\right]\color{red}{\sqrt{\tan x}}\,\mathrm dx\tag1=1$$
An attempt:
Rewrite $(1)$ as
$$\int_{0}^{\pi/4}4\cos^2(x)\sqrt{\tan x}\,\mathrm dx-\int_{0}^{\pi/4}\sqrt{\tan x}\,\mathrm dx=I_1-I_2\tag2$$
For $I_2$ we choose $u=\sqrt{\tan x}\implies {2u\over 1+u^2}dx=dx$, then it becomes
$$\int_{0}^{1}{2u^2\mathrm du\over 1+u^4}\tag3$$
Rearrange $(3)$ in the form of
$$\int_{0}^{1}{1+{1\over u^2}\over u^2+{1\over u^2}}\mathrm du+\int_{0}^{1}{1-{1\over u^2}\over u^2+{1\over u^2}}\mathrm du\tag4$$
Apply completing the square to $(4)$
$$\int_{0}^{1}{1+{1\over u^2}\over \left(u-{1\over u}\right)^2+2}\mathrm du+\int_{0}^{1}{1-{1\over u^2}\over \left(u+{1\over u}\right)^2-2}\mathrm du=I_3+I_4\tag5$$
For $I_3$ setting $v_1=u-{1\over u}$ and for $I_4$ setting $v_2=u+{1\over u}$ then
$$\left.{1\over \sqrt{2}}\tan^{-1}\left({v_1\over \sqrt{2}}\right)\right|_{0}^{\infty}-{1\over \sqrt{8}} \left.\ln{\left({v_2+\sqrt{2}\over v_2-\sqrt{2}}\right)}\right|_{2}^{\infty}={\pi\over \sqrt{8}}+{1\over \sqrt{8}}\ln{(3+2\sqrt{2})}\tag6$$
We can rewrite $I_1$ as
$$I_1=2\int_{0}^{\pi/4}\sqrt{\tan x}\,\mathrm dx+2\int_{0}^{\pi/4}\cos(2x)\sqrt{\tan x}\,\mathrm dx\tag7$$
$$I_1=2\cdot(6)+2\int_{0}^{\pi/4}\cos(2x)\sqrt{\tan x}\,\mathrm dx\tag8$$
$(8)$ we can apply integration by part, I am sure it would be lengthy.
How else can we tackle $(1)$ in another less lengthy way?