Actually what the problem meant about the westward component of the ball’s displacement is the horizontal component of the displacement. To help us better understand the problem, I attached a figure of the situation.
We can see from the figure that to solve for the value of the horizontal component, we have to make use of the sin function. That is:
sin θ = side opposite to the angle / hypotenuse of the triangle
sin 42 = x / 40 m
x = (40 m) sin 42
x = 26.77 m
Therefore the ball has a westward displacement of about 26.77 m