We are given the radius of the moon, r = 408 km.
Â
The problem states that the satellite is in elliptical orbit around the moon. The ellipse equation is:
[(x – h)^2 / a^2] + [(y – k)^2 / b^2] = 1
where,
 h and k are the center point coordinates
a = length of semi major axis and (assuming horizontal ellipse)
b = length of semi minor axis
Â
Assuming that the center of the moon is at one focus. Also assuming that the vertex is at the origin and the coordinates are (0,0). Therefore the equation becomes:
[x^2 / a^2] + [y ^2 / b^2] = 1
Â
In this case
a = 408 km + 781 km = 1189 km.
b = 408 km + 562 km = 970 km.
Â
Substitute the values of a and b  into the equation:
Â
[x^2 / 1189^2] + [y ^2 / 970^2] = 1Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â (horizontal ellipse)
Â
This is the final equation for horizontal ellipse.
Now if the ellipse is vertical, simply swap the values of a and b.
Â
[x^2 / 970^2] + [y ^2 / 1189^2] = 1Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â (vertical ellipse)