To solve this problem, we treat the 3 mathematics books as a single block, since they must be together.
So, now we have:
- 1 block of mathematics books, and
- 4 physics books.
This gives us a total of \( 1 + 4 = 5 \) items (the block and the 4 physics books) to arrange.
The number of ways to arrange these 5 items is \( 5! \).
Now, within the block of mathematics books, the 3 mathematics books can be arranged in \( 3! \) ways.
Thus, the total number of ways to arrange the books is:
\[
5! \times 3! = 120 \times 6 = 720
\]
Thus, the correct answer is option (D), 720.