# Evaluate equation for multiple values

This works fine;

((x - Sqrt[x])/(x + Sqrt[x]) - (x^2 - x)/36) /. x -> {1, 4, 8}


but this does not

((x - Sqrt[x])/(x + Sqrt[x]) == (x^2 - x)/36) /. x -> {1, 4, 8}


I expected it to return {True, True, False} but it returns a single False.

How do I get {True, True, False}? TIA.

• for fun: MapThread[Equal, {(x - Sqrt[x])/(x + Sqrt[x]), (x^2 - x)/36} /. x -> {1, 4, 8}] or {(x - Sqrt[x])/(x + Sqrt[x]), (x^2 - x)/36} /. x -> {1, 4, 8} // MapThread[Equal]. Jul 7 at 10:50

Perhaps Map is what you are looking for

Map[(((x - Sqrt[x])/(x + Sqrt[x]) == (x^2 - x)/36)) /. x -> # &, {1,4, 8}]
(*{True, True, False}*)


Try

((# - Sqrt[#])/(# + Sqrt[#]) == (#^2 - #)/36) & /@ {1, 4, 8}
{True, True, False}


or

(x |-> ((x - Sqrt[x])/(x + Sqrt[x]) == (x^2 - x)/36)) /@ {1, 4, 8}
{True, True, False}


( |-> is Function, version 12.3!)

You can also use ReplaceAll, you just have to tell it to do multiple replacements for the different values of x:

((x - Sqrt[x])/(x + Sqrt[x]) == (x^2 - x)/36) /.
{{x -> 1}, {x -> 4}, {x -> 8}}
(* {True, False, True} *)