Please check the picture attached to understand it more:
The Pythagorean Theorem states that for a right triangle
[tex]a^2+b^2=c^2[/tex]
In terms of points in the Cartesian plane a is equal to [tex]x_a-x_b=a[/tex]
And [tex]b=y_a-y_b[/tex]
Therefore,
[tex](x_a-x_b)^{2} + (y_a-y_b)^{2} =c^2[/tex]
Here since [tex]3\ \textgreater \ -3[/tex], [tex](3,y)=(x_a,y_a) \\ (-3,-1)=(x_b, y_b)[/tex]
We already know the value of c
[tex](3-(-3))^{2} +(y-(-1))^{2} = \sqrt{45} ^2 \\ 6^2+(y+1)^2=45 \\ 36+(y+1)^2=45 \\ (y+1)^2=9[/tex]
There are 2 cases
1st Case :
y+1 is equal to the positive squareroot of 9
[tex](y+1)^2=9 \\ y+1= \sqrt{9} \\ y+1=3 \\ y=2[/tex]
2nd case:
y+1 is equal to the negative squareroot of 9
[tex](y+1)^2=- \sqrt{9} \\ y+1=-3 \\ y=-4[/tex]
Therefore y={-4, 2}
Either of the two are possible