Trick: Split the integral into three parts.
$$\begin{align}\int_0^{\sqrt{R^2-1}}g(x)-f(x)\,\mathrm dx&=\int_0^{\sqrt{R^2-1}}\sqrt{R^2-x^2}-1\,\mathrm dx\\&=\left(\int_0^{\sqrt{R^2-1}}\frac{\sqrt{R^2-x^2}}2-\frac{x^2}{\sqrt{R^2-x^2}}+\frac{a^2}{\sqrt{R^2-x^2}}\,\mathrm dx\right)-\sqrt{R^2-1}\\&=\left(\int_0^{\sqrt{R^2-1}}\left(\frac x2\right)'\sqrt{R^2-x^2}+\frac x2\left(\sqrt{R^2-x^2}\right)'+\frac{R^2}2\left(\sin^{-1}\frac xR\right)'\,\mathrm dx\right)-\sqrt{R^2-1}\\&=\left[\frac x2\sqrt{R^2-x^2}+\frac{R^2}2\sin^{-1}\frac xR\right]_0^{\sqrt{R^2-1}}-\sqrt{R^2-1}\\&=\frac{\sqrt{R^2-1}}2+\frac{R^2}2\sin^{-1}\left(\frac{\sqrt{R^2-1}}R\right)-\sqrt{R^2-1}\\&=\boxed{\frac{R^2}2\cos^{-1}\left(\frac1R\right)-\frac{\sqrt{R^2-1}}2}\end{align}$$