Checking for latex can cause issues. You could also look into pattern matching. The difficulty lies in telling students they are wrong when their math is essentially correct but not in the exact form. See the pic. Notice all the correct answers that may not be incorrect but a student could type in.
I agree that checking against the latex can cause issues. Here is an example of what I would do. The code I used is what I found after doing lots of research about checking correct equations.
I agree with the fragility of latex noted by others. That said, the mistake in the latex is the use of curly braces. They should be parentheses (and the exponent in curly braces):