Finding the integral: $\int_{0}^{\large\frac{\pi}{4}}\frac{\cos(x)\:dx}{a\cos(x)+b \sin(x)}$ What is 
$$\int_{0}^{\large\frac{\pi}{4}}\frac{\cos(x)\:dx}{a\cos(x)+b \sin(x)}?$$
$a,b \in \mathbb{R}$ appropriate fixed numbers. 

$\newcommand{\bbx}[1]{\,\bbox[8px,border:1px groove navy]{{#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}
&\int_{0}^{\pi/4}{\cos\pars{x} \over a\cos\pars{x} + b\sin\pars{x}}\,\dd x
\\[5mm] = &\
{1 \over a}\int_{0}^{\pi/4}
{\cos\pars{x} \over \cos\pars{x} + \tan\pars{\mu}\sin\pars{x}}\,\dd x
\qquad\qquad\qquad\qquad\pars{~\tan\pars{\mu} \equiv {b \over a}~}
\\[5mm] = &\
{\cos\pars{\mu} \over a}\int_{0}^{\pi/4}
{\cos\pars{x} \over \cos\pars{x - \mu}}\,\dd x =
{\cos\pars{\mu} \over a}\int_{-\mu}^{\pi/4 - \mu}
{\cos\pars{x + \mu} \over \cos\pars{x}}\,\dd x
\\[5mm] = &\
{1 \over a\sec^{2}\pars{\mu}}\,{\pi \over 4} -
{\cos\pars{\mu}\sin\pars{\mu} \over a}\int_{-\mu}^{\pi/4 - \mu}
\tan\pars{x}\,\dd x
\\[5mm] = &
{1 \over a\bracks{\tan^{2}\pars{\mu} + 1}}\,{\pi \over 4} -
{\tan\pars{\mu} \over a\bracks{\tan^{2}\pars{\mu} + 1}}\bracks{-\ln\pars{\cos\pars{{\pi \over 4} - \mu}} + \ln\pars{\cos\pars{-\mu}}}
\\[5mm] = &\
{\pi \over 4}\,{a \over a^{2} + b^{2}} -
{b \over a^{2} + b^{2}}\bracks{%
{1 \over 2}\ln\pars{\tan^{2}\pars{\pi/4 - \mu} + 1 \over
\tan^{2}\pars{\mu} + 1}}
\\[5mm] = &\
{\pi \over 4}\,{a \over a^{2} + b^{2}} -
{b \over 2\pars{a^{2} + b^{2}}}
\ln\pars{\braces{\bracks{1 - b/a}/\bracks{1 + b/a}}^{2} + 1 \over
b^{2}/a^{2} + 1}
\\[5mm] = &\
\bbx{\ds{{\pi \over 4}\,{a \over a^{2} + b^{2}} -
{b \over a^{2} + b^{2}}\ln\pars{\root{2}\verts{a  \over a + b}}}}
\end{align}
