Add a statement to assume x != 0 for simplifying rational expressions

fix #42324

Test plan: load each exercise locally and make sure it displays properly

Auditors: peter, cbhl