@asmeurer Does sympy considers cos(q1) - sin(q1), different from -sin(q1) + cos(q1).

because the dot function here is giving the solution as -sin(q1) + cos(q1), which I simplified in writing to cos(q1) - sin(q1), hence the AssertionError