Why does the following not compute?
MaxValue[-y^2, y ∈ Interval[{-1, 1}]]
I expect it to compute the maximum value of the funtion over the interval from -1 to 1 but I instead get the error:
MaxValue::objfs: The objective function {-Subscript[y, 1]^2} should be scalar-valued.
What should I be using instead?