Proving the Cauchy-Schwarz integral inequality in a different way Suppose $\alpha$ is monotonically increasing on $[a,b]$. Also suppose $f,g: [a,b] \rightarrow \mathbf{R}$, and both functions are Riemann-Stieltjes integrable with respect to $\alpha$. That is, $\forall \epsilon > 0$ there is a partition $P_\epsilon$ such that for all upper and lower sums:
\begin{equation*}
U(P_\epsilon,f,\alpha) - L(P_\epsilon,f,\alpha) < \epsilon
\end{equation*}
Use the Cauchy-Schwarz inequality

To prove the following:
\begin{equation*}
\left|\int_a^b f(x)g(x)d\alpha (x)\right|^2 \leq \left(\int_a^b [f(x)]^2 d\alpha(x)\right) \left(\int_a^b [g(x)]^2 d\alpha(x)\right) 
\end{equation*}
I've seen this proof using done by looking at $0 \leq \int_a^b (\lambda f(x) + g(x))^2 dx$, and then looking at the resulting quadratic equation. This problem, however, seems to be a more general case. How could I approach this?
 A: I know two beautiful direct proofs of this fact. I like a lot the second one!
First proof. If  $\alpha$ is monotonically increasing on the set $[a,b]\subsetneq \mathbb R$ , let $\mathcal{R}_\alpha[a, b]$ denote the  algebra of Riemann-Stieltjes integrable functions with respect to $\alpha$.
First, if $ f, g\in \mathcal{R}_\alpha[a, b]  $, then $ f^2, g^2\in \mathcal{R}_\alpha[a, b] $. 
Let us denote $ \lambda:= \displaystyle\sqrt{\int\limits_{a}^{b}f(x)^2\,d\alpha}  $ and $\mu:= \displaystyle\sqrt{\int\limits_{a}^{b}g(x)^2\,d\alpha } $ . Define $ h:[a,b]\to \mathbb{R} $ by $ h(x)=\lambda g(x)- \mu f(x)$. Clearly $\lambda,\mu\geq0$ and $ h\in \mathcal{R}_\alpha[a, b] $, so
    $ \begin{align}&\\
 0&\leq \int\limits_{a}^{b} h(x)^2\,d\alpha=\int\limits_{a}^{b}\big(\lambda g(x)- \mu f(x)\big)^2\,d\alpha\\
&=\lambda^2\int\limits_{a}^{b}g(x)^2\,d\alpha-2\lambda \mu \int\limits_{a}^{b}f(x) g(x) \,d\alpha+\mu^2 \int\limits_{a}^{b}f(x)^2\,d\alpha \\&=\lambda^2 \mu^2 -2\lambda\mu \int\limits_{a}^{b}f(x)g(x)\,d\alpha+\mu^2 \lambda^2 =2\lambda \mu \left( \lambda \mu- \int\limits_{a}^{b}f(x)g(x)\,d\alpha  \right).
 \end{align} $
Since $f, g\in \mathcal{R}_\alpha[a, b]$ are assumed to be both non-zero (otherwise, the desired inequality is obvious), then $ 2\lambda \mu >0 $, so it has to be that $\displaystyle \lambda \mu- \int\limits_{a}^{b}f(x)g(x)\,d\alpha \geq 0$, that is
        $$  \int\limits_{a}^{b}f(x)g(x)\,d\alpha \leq\lambda \mu  \qquad\qquad (*) $$
    On the other hand, $ \displaystyle -\int\limits_{a}^{b}f(x)g(x)\,d\alpha=\int\limits_{a}^{b}\big( (-f)(x) \big) g(x)\,d\alpha $, so, by means of $(*)$,
        \begin{align} -\int\limits_{a}^{b}f(x)g(x)\,d\alpha&=\int\limits_{a}^{b}\big( (-f)(x) \big) g(x)\,d\alpha\leq \sqrt{\, \int\limits_{a}^{b}  \big(-f(x)\big)^2 \,d\alpha}\,\cdot \,  \sqrt{\, \int\limits_{a}^{b}  g(x)^2\,d\alpha }\\&= \sqrt{\, \int\limits_{a}^{b}   f(x)^2 \,d\alpha} \, \cdot \, \sqrt{\, \int\limits_{a}^{b}  g(x)^2\,d\alpha }. \end{align} That is, we have proved that $ \displaystyle\left| \int\limits_{a}^{b}f(x)g(x)\,d\alpha\right|\leq \lambda \mu  $. Equivalently,
        $$ \left| \int\limits_{a}^{b}f(x)g(x)\,d\alpha\right|^2\leq \lambda^2 \mu^2= \left(\int\limits_a^b  f(x) ^2 \,d\alpha \right)    \left(\int\limits_a^b  g(x) ^2 \,d\alpha \right), $$
    as it was to be shown.  
Second proof. We take $\lambda,\mu$ as before, and since $ \displaystyle\left| \int\limits_{a}^{b}f(x)g(x)\,d\alpha\right|\leq  \int\limits_{a}^{b}\big|f(x)g(x)\big| \,d\alpha$, the Cauchy-Schwarz inequality can be proved just by showing that 
        $$ \int\limits_{a}^{b}\big|f(x)g(x)\big| \,d\alpha\leq \lambda\mu =\sqrt{\int\limits_{a}^{b}f(x)^2\,d\alpha }\:\cdot \sqrt{\int\limits_{a}^{b}g(x)^2\,d\alpha }  .  $$
     Equivalently (if we asumme that $f\neq 0 \neq g$),
     $$\int\limits_{a}^{b}\frac{\big|f(x)g(x)\big|}{\lambda \mu }\,d\alpha=\int\limits_{a}^{b}\frac{\big|f(x) \big|}{\lambda   } \cdot\frac{\big| g(x)\big|}{  \mu }\,d\alpha  \leq 1.$$
     Indeed, since for every pair of real numbers   $ \zeta, \eta\in\mathbb{R} $ we have that $|\zeta\eta|\leq \frac{\zeta^2+\eta^2}{2}$, it follows that
     \begin{align*}
  \int\limits_{a}^{b}\frac{\big|f(x) \big|}{\lambda   } \cdot\frac{\big| g(x)\big|}{  \mu }\,d\alpha&\leq \int\limits_{a}^{b}\frac{\frac{f(x)^2}{\lambda^2}+ \frac{g(x)^2}{\mu^2} }{2}\,d\alpha=\frac{1}{2}\left(\, \int\limits_{a}^{b}\frac{f(x)^2}{\lambda^2}\,d\alpha +\int\limits_{a}^{b} \frac{g(x)^2}{\mu^2}\,d\alpha \right)=\frac{1}{2}\left(\frac{\lambda^2}{\lambda^2 }+\frac{ \mu^2}{ \mu^2}\right)=1.
  \end{align*}
A: Hint: Taking $[0,1]$ for simplicity and letting $d\alpha = dx,$, note
$$\sum_{k=1}^{n}f\left (\frac{k}{n}\right )g\left ( \frac{k}{n}\right )\frac{1}{n} = \sum_{k=1}^{n}\left [f\left (\frac{k}{n}\right )\frac{1}{\sqrt n}\right ]\left [g\left ( \frac{k}{n}\right )\frac{1}{\sqrt n}\right ] .$$
Take $a_k,b_k$ to be the terms inside the brackets.
