Add the areas of two rectangles: \(\displaystyle 2\times 2~\&~4\times 4\).Is the definite integral of the function, attached JPEG, from 2 to 8 --> 20, simply by counting the number of blocks.
.
... the piecewise function f(x)= 2 if x< 4, f(x)= 4 if x> 4.
Then the area is \(\displaystyle \int_2^8 f(x)dx = \)
\(\displaystyle \int_2^4 2dx \ + \ \int_4^8 4dx = \)
\(\displaystyle \left[2x\right]_2^4 \ + \ \left[4t\right]_4^8 = \ \ \ \ \ \) <------ You meant\(\displaystyle \ \ \ \left[2x\right]_2^4 \ + \ \left[4x\right]_4^8 \)
\(\displaystyle 2(4 - 2) \ + \ 4(8 - 4) = \)
\(\displaystyle 4 + 16 = \)
\(\displaystyle 20\).