<s>[INST] Integration of an unusual trig function I am trying to solve the following definite integral:
$$ \int_{0}^{\frac{\pi}{4}} \sqrt{\tan^2t + \frac{1}{2}} \, dt $$
I have tried the usual trig substitutions with no avail. 
 [/INST] Let $$\displaystyle I = \int \sqrt{\tan^2 t +\frac{1}{2}}dt\;,$$ Now Put $\displaystyle \tan t = \frac{1}{\sqrt{2}}\tan \phi\;,$
Then $$\displaystyle dt = \frac{1}{\sqrt{2}}\frac{\sec^2 \phi}{\sec^2 t} d\phi =\frac{1}{\sqrt{2}}\frac{\sec^2 \phi}{1+\tan^2 t}d\phi = \sqrt{2}\left(\frac{\sec^2 \phi}{2+\tan^2 \phi}\right)d\phi$$
So Integral $\displaystyle I = \int \frac{\sec^3 \phi}{2+\tan^2 \phi}d\phi = \int\frac{1}{\left(2\cos^2 \phi+\sin^2 \phi\right)}\cdot \frac{1}{\cos \phi}d\phi $
So Integral $$\displaystyle I = \int\frac{\cos \phi}{\left(1-\sin^2 \phi\right)(2-\sin^2 \phi)}d\phi$$
Now Put $\sin \phi = u\;,$ Then $\cos \phi d\phi = du$
So Integral $$\displaystyle I = \int\frac{1}{(1-u^2)(2-u^2)}du = \int\frac{1}{(u^2-1)(u^2-2)}du = \int \left[\frac{(u^2-1)-(u^2-2)}{(u^2-1)(u^2-2)}\right]du$$
So we get $$\displaystyle I = \int\frac{1}{u^2-2}du-\int \frac{1}{u^2-1}du$$
So we get $$\displaystyle I = \frac{1}{2\sqrt{2}}\ln \left|\frac{u-\sqrt{2}}{u+\sqrt{2}}\right|-\frac{1}{2}\ln \left|\frac{u-1}{u+1}\right|+\mathcal{C}$$
</s>