Compute $\int_{a}^{b}\left|x\right|\mathrm{d}x$ The reason I ask this is because $$\int_{x=a}^{x=b}\left|x\right|\mathrm{d}x$$  gives exactly the same result as $$\int_{x=a}^{x=b}x\mathrm{d}x=\frac{b^2}{2}-\frac{a^2}{2}=\int_{x=a}^{x=b}\left|x\right|\mathrm{d}x$$ when $0 \leq a \leq b$
But for a non trivial case could someone please show the steps of integration of $$\int_{x=a}^{x=b}\left|x\right|\mathrm{d}x$$ for $-7\le a\le 8$ and $0\le b\le 12$.
Thank you.

This is not true in general, and depends on $a$ and $b$:
$$\int_{-1}^1 xdx =0 $$
but
$$\int_{-1}^1 \lvert x\rvert dx = 2\int_{0}^1 \lvert x\rvert dx = 1.  $$
What you mention clearly holds if $0 \leq a \leq b$ (since anyway in this case $x=\lvert x \rvert$ for $x\in[a,b]$).
Edit:
If $a < 0$, b$>0$, then
$$\begin{align}
\int_a^b \lvert x\rvert dx &= \int_a^0 \lvert x\rvert dx + \int_0^b \lvert x\rvert dx = \int_a^0 (-x)  dx+ \int_0^b x dx = \int_0^a x  dx+ \int_0^b x dx\\
&=
 \frac{b^2+a^2}{2}
\end{align}
$$
while
$$\begin{align}
\int_a^b x dx &= \frac{b^2-a^2}{2}
\end{align}
$$
