Solving Riemann-Stieltjes integral:$\int_{- \pi/4}^{\pi/4} f(x)dg(x)$ I'm having trouble solving this Riemann-Stieltjes integral:
$$\int_{- \pi/4}^{\pi/4} f(x)dg(x),$$ where $$f(x):= \begin{cases} \frac{\sin^4x}{\cos^2x}{} &\text{if }x\ge0,  \\{}\\ \frac1{\cos^3x} &\text{if }x<0,\end{cases}$$
and $$g(x)=\begin{cases} \phantom{-} 1+\sin(x) &\text{if }-\pi/4 <x<\pi/4,  \\ -1 &\text{otherwise}.\end{cases}$$
I believe the only jump discontinuities are at $-\pi/4$ and $\pi/4$. Which $g=-1$ at both of those points. I'm struggling with the rest. What formula should I be using to compute the integral and what should my answer look like? Thanks for any help!
 A: Let $T = \pi/4$. The first term in the Riemann-Stieltjes sum, $f(\xi_1)(g(x_1) - g(-T))$, does not tend to zero when $x_1 \downarrow -T$ and $\xi_1 \downarrow -T$, and similarly for the last term. The integral is
$$I = \int_{-T}^T f(x) dg(x) = \\
\lim_{\epsilon \downarrow 0} \{
 f(-T) (g(-T + \epsilon)- g(-T)) + \\
 f(T) (g(T)- g(T - \epsilon)) \} + \\
\int_{-T}^T f(x) \cos x \,dx = \\
2 \operatorname{arctanh}(\sqrt 2 - 1) + \frac {19 \sqrt 2} 6 - 2.$$
It can be verified that
$$I = f(T) g(T) - f(-T) g(-T) - \int_{-T}^T g(x) df(x) = \\
f(T) g(T) - f(-T) g(-T) - \\
\lim_{\epsilon \downarrow 0} g(0) (f(\epsilon) - f(-\epsilon)) - \\
\int_{-T}^0 g(x) \left( \frac 1 {\cos^3 x} \right)' dx -
\int_0^T g(x) \left( \frac {\sin^4 x} {\cos^2 x} \right)' dx.$$
A: Since $g$ is differentiable on $-\pi/4 <x<\pi/4$ your integral changes to Riemann integral simply by the following theorem: $$\int_a^bf(x)dg(x)=\int_a^bf(x)g'(x)dx$$ so you will have $\int_{- \pi/4}^{\pi/4} f(x)dg(x)= \int_{- \pi/4}^{\pi/4}\frac{\sin^4x}{\cos^2x}d(1+\sin x)=\int_{- \pi/4}^{\pi/4}\frac{\sin^4x}{\cos^2x}\cos x dx$
A: 
Since $g$ is differentiable there is no trouble with sum this boils down to Riemann integral of $g'\cdot f$

Namely from here we have $$\color{blue}{\int_a^bf(x)dg(x)=\int_a^bf(x)g'(x)dx}$$
Therefore, 
 $$\int_{-\pi/4}^{\pi/4} f(x) dg(x) = \int_{-\pi/4}^0 \frac 1{\cos^3 x} d(1+\sin x) + \int_0^{\pi/4}  \frac{\sin^4 x}{\cos^2 x} d(1+\sin x)\\=\int_{-\pi/4}^0 \frac 1{\cos^2 x} dx + \int_0^{\pi/4}  \frac{\sin^4 x}{\cos^2 x} d(\sin x)$$
But $$\int_{-\pi/4}^0 \frac 1{\cos^2 x} dx =\int^{\pi/4}_0 (\tan x)' dx =1$$
and
$$\int_0^{\pi/4}  \frac{\sin^4 x}{\cos^2 x} d(\sin x) = \int_0^{\pi/4}  \frac{\sin^4 x}{1-\sin^2 x} d(\sin x) =\int_0^{\sqrt{2}/2}  \frac{t^4 }{1-t^2 } dt\\=\int_0^{\sqrt{2}/2}  -t^2+\frac{t^2 }{1-t^2 } dt$$
 $$
$$
