Evaluate the following integral with variable upper limit Evaluate the integral $$J(d,x)=\int_0^x\frac{1}{\sqrt{d^2-\sin(r)-\cos(r)}}dr;\space d^2>\sqrt2$$ I am unsure where to begin with this. Any help appreciated.
 A: $\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}
\left.\vphantom{\Large A}\mrm{J}\pars{d,x}\right\vert_{\ d^{2}\ >\ \root2} & \equiv
\int_{0}^{x}{\dd r \over \root{d^{2} - \sin\pars{r} - \cos\pars{r}}} =
\int_{0}^{x}{\dd r \over \root{d^{2} - \root{2}\cos\pars{r - \pi/4}}}
\\[5mm] & =
\int_{-\pi/4}^{x - \pi/4}{\dd r \over \root{d^{2} - \root{2}\cos\pars{r}}} =
\int_{-\pi/4}^{x - \pi/4}{\dd r \over
\root{d^{2} - \root{2}\bracks{1 - 2\sin^{2}\pars{r/2}}}}
\\[5mm] & =
{2 \over \root{d^{2} - \root{2}}}\int_{-\pi/8}^{x/2 - \pi/8}
{\dd r \over \root{1 -\bracks{\root{2\root{2}/\pars{d^{2} - \root{2}2}}\,\ic}^{2} \sin^{2}\pars{r}}}
\\[1cm] & = 
{2 \over \root{d^{2} - \root{2}}}\int_{-\pi/8}^{x/2 - \pi/8}
{\dd r \over \root{1 -\bracks{\root{2\root{2}/\pars{d^{2} - \root{2}}}\,\ic}^{2} \sin^{2}\pars{r}}}
\\ & + {2 \over \root{d^{2} - \root{2}}}\int_{0}^{\pi/8}
{\dd r \over \root{1 -\bracks{\root{2\root{2}/\pars{d^{2} - \root{2}}}\,\ic}^{2} \sin^{2}\pars{r}}}
\\[1cm] & =
{2 \over \root{d^{2} - \root{2}}}\bracks{%
\mrm{F}\pars{{x \over 2} - {\pi \over 8},\root{2\root{2} \over d^{2} - {2}}\,\ic} +
\mrm{F}\pars{{\pi \over 8},\root{2\root{2} \over d^{2} - \root{2}}\,\ic}}
\end{align}

$\ds{\mrm{F}}$ is a Legendre Integral. The above $\ds{\,\mrm{F}}$ arguments satisfy some conditions which are discussed in the above mentioned link.

