Question 1102309
Ignoring the math book restriction, there are  9! = 362880 unique ways of arranging the books.
Now we need to divide that by the number of arrangements where  the two math books are together:
There are 8 ways for m1m2 to appear and 8 ways for m2m1 to appear, so we need to divide by 16:

362880/16 = {{{ highlight(22680) }}}
—
EDIT 11/25:  Yes, my answer over-deducts (i.e. dividing by 16 takes out too many arrangements) for the M1M2, M2M1 cases.   9! - 2*8!  removes the arrangements properly for M1M2 & M2M1 together.    [ If I had sanity-checked my answer I'd have seen that it is way too small. ]