<s>[INST] Riemann Steiljes Integral when alpha changes For example if the question was following

$$ \int_{0}^2  x\,d \alpha $$

where $ \alpha (x) = x $ if $ 0\le x\le 1 $ and $ \alpha(x) = 3x $  when $ 1< x \le 2 $

Is it correct to solve it using
$$ \int_{0}^2  x d \alpha  =  \int_{0}^1  x d x  + \int_{1}^2  x d (3x)? $$

If that is possible, does it mean that the value of $\alpha$ at $1$ is does not change the answer say if it was
$ \alpha (x) = x $ if $ 0\le x< 1 $ and $ \alpha(x)=3x $  when $ 1\le x\le 2 $ ?
 [/INST] No, you must take account of the jump discontinuity of $\alpha$ at $x = 1$. The correct evaluation should be
\begin{align*}
\int_{0}^{2} x \, d\alpha(x)
&= \int_{0}^{1} x \, dx + 1 \cdot \{ \alpha(1+) - \alpha(1-) \} + \int_{1}^{2} x \, d(3x) \\
&= \left[ \frac{x^{2}}{2} \right]_{0}^{1} + 1 \cdot (3 - 1) + \left[ \frac{3x^{2}}{2} \right]_{1}^{2} \\
&= \frac{1}{2} + 2 + \frac{9}{2}
 = 7.
\end{align*}
Or as Mhenni Benghorbal pointed out, you can apply the Riemann-Stieltjes version of the integration by parts as follows:
\begin{align*}
\int_{0}^{2} x \, d\alpha(x)
&= \left[ x \alpha(x) \right]_{0}^{2} - \int_{0}^{2} \alpha(x) \, dx \\
&= 2\alpha(2) - \int_{0}^{1} x \, dx - \int_{1}^{2} 3x \, dx \\
&= 12 - \left[ \frac{x^{2}}{2} \right]_{0}^{1} -\left[ \frac{3x^{2}}{2} \right]_{1}^{2} \\
&= 12 - \frac{1}{2} - \frac{9}{2} = 7.
\end{align*}
</s>