To answer this question, we will use the rule of the distance between two points which is stated as follows:
d^2 = (x1-x2)^2 + (y1-y2)^2
The givens are:
d = sqrt(40) .............> d^2 = 40
point 1 is (4,y1)
point 2 is (2,3)
Therefore,
x1 = 4
x2 = 2
y1 = y1
y2 = 3
Substitute with the givens in the above equation:
40 = (4-2)^2 + (y1-3)^2
40 = 4 + y1^2 - 6y1 + 9
y1^2 - 6y1 + 9 + 4 - 40 = 0
y1^2 - 6y1 -27 = 0
(y1-9)(y1+3) = 0
either: y1 = 9
or: y1 = -3