check the picture below.
[tex]\bf f(x)=
\begin{cases}
3&x\le 3\\
6-x&x\ \textgreater \ 3
\end{cases}\qquad \displaystyle \int_{0}^{6}~f(x)\cdot dx[/tex]
so, you simply have a 3x3 square and a triangle with a base of 3 and a height of 3, get their areas, sum them up, it'd come out to 9 + 4.5 or 13.5.