Check exact answers

Hi, I have tried to find previous questions and support on this but anything I have found either doesn’t help or doesn’t seem to work.

I’m trying to code slide 2 to check for the answer to be 5sqrt2 or any equivalent (should they not simplify the answer). I’m sure I have seen this before but can’t seem to get it to work.

https://cl.desmos.com/t/check-exact-answers/7803?u=helenvg

Do you mean any equivalent within a certain level of tolerance (i.e. they put it as a decimal rounded to 3 places), or only as an exact answer with a radical (not allowing a decimal approximation)? The method you need will depend on that.

Here’s my crack at it. This should accept exact answers as an integer (if you change the given radicand), and both reduced and unreduced radicals.