Following integral? How to solve the following:
$$\int_1^{x} \lfloor t\rfloor dt $$
I can conclude the answer is asymptotic to $\displaystyle \frac{1}{2} x^2 - \frac{1}{2} x$ and specifically it looks just like $\displaystyle \frac{1}{2}x^2$ except entirely linear (basically between consecutive integer points the function is a line that passes through both points)
How to express this though?
 A: Break the integral up at every integer bigger than $1$. That is,
$$
\int_1^x \lfloor t \rfloor \, dt = \sum_{n = 1}^{\lfloor x \rfloor - 1} \int_{n}^{n+1}\lfloor t \rfloor \, dt + \int_{\lfloor x \rfloor}^x \lfloor t \rfloor \, dt.
$$
On each interval $[n,n+1)$, $\lfloor t \rfloor = n$ and $\lfloor t \rfloor = \lfloor x \rfloor$ on $[\lfloor x \rfloor, x)$ so that
$$
\begin{align*}
\int_1^x \lfloor t \rfloor \, dt &= \sum_{n = 1}^{\lfloor x \rfloor - 1} \int_{n}^{n+1} n \, dt + \int_{\lfloor x \rfloor}^x \lfloor x \rfloor \, dt\\ 
&= \left(\sum_{n = 1}^{\lfloor x \rfloor - 1} n\right) + (x - \lfloor x \rfloor) \lfloor x \rfloor\\
&= \frac{1}{2}(\lfloor x \rfloor - 1)\lfloor x \rfloor + (x - \lfloor x \rfloor) \lfloor x \rfloor\\
\end{align*}
$$
A: You can divide the integral into two part by splitting the domain of integration into two parts:
$$ \int_{1}^{\lfloor x \rfloor} \lfloor t \rfloor \, dt + \int_{\lfloor x \rfloor}^{x} \lfloor t \rfloor \, dt $$
But here we present a method using the Lebesgue-Stieltjes integration:
\begin{align*}
\int_{1}^{x} \lfloor t \rfloor \, dt
&=\left[ t \lfloor t \rfloor \right]_{1^{-}}^{x} - \int_{1^{-}}^{x} t \, d\lfloor t \rfloor \\
&= x\lfloor x \rfloor - \sum_{1\leq n \leq x} n \\
&= x\lfloor x \rfloor - \frac{\lfloor x \rfloor(\lfloor x \rfloor + 1)}{2} \\
&= \frac{x(x-1)}{2} - \frac{\{ x \}(\{ x \}-1)}{2},
\end{align*}
where $\{ x \} = x - \lfloor x \rfloor$ denotes the fractional part of $x$.
