A town Y is 200km from town x in a direction 040°.how far is y east of x?

draw your sketch of the right-angled triangle with XY the hypotenuse

and you will see that
distance east / 200 = cos% 50°
distance due east = 200 cos 50° = ..... km