First off, I challenge the framing of the question. You seem to be seeking answers for the question
How did the student get the correct answer from this work?
Unfortunately, I don't think that there is any possible way to answer that question without being the student. Maybe they cheated. Maybe they got lucky. Maybe they did some work in their heads but were unable to communicate that work in writing. Maybe they saw that exact problem in a homework assignment or study guide somewhere and somehow managed to memorize a correct answer. Without being in the head of the student, it is entirely impossible to know how they got that answer.
Instead, I think that there is a related question which can be answered:
If a student writes gibberish followed by a correct answer, what should I do?
In the classes that I teach, I strongly emphasize that most of mathematics is not about obtaining the correct answer, but about communicating to others how that answer was obtained. If you cannot communicate how you arrived at an answer, then you haven't done the basic work necessary for conducting mathematics.
In an exam setting, I make it very clear (both on the syllabus and in the instructions for the exam) that correct answers without supporting work will receive no credit. In this case, I don't see any work that I would be willing to give credit for (though I might be a harsh grader; Dave L Renfro sees some merit in a bit of what is there, and he isn't wrong; I do see an attempt to combine the terms with a common denominator—that is a reasonable start; that being said, I still probably wouldn't give it any credit). I don't need to know how the student got the correct answer in order to know that they haven't explained that answer.
That being said, if the student came to my office to challenge the marking, I would be willing to hear them out. If they could explain to me how to solve a similar problem that present to them on the fly, I would be willing to give them a handful of points on the exam (say 2-4 out of 10), with the admonition that, in the future, I won't be so generous (it is quite difficult to offer the option to revise a final, since grades are due pretty quickly after the final is graded). I might even encourage this student to come and talk to me; not even under the "guise" of helping them—they clearly need help, whether it be help with their mathematical skills, or help with their cheating technique. ;)
I will also point out that I am very carefully avoiding the issue of cheating entirely. Yes, it is very possible that the student cheated. But if you don't have any evidence of that (other than some suspicious answers on an exam), accusing the student of cheating does absolutely nothing to resolve the situation. It is probably better to assume good faith and let the student prove in office hours that they have no idea what they are doing. Whether they are cheating or not, they aren't going to get credit for something that they don't understand.