Explanation:
this represents a trigonometric triangle (right-angled) inside an imaginary circle.
imagine the triangle is turned 90° counterclockwise, so that A is the bottom left vertex, B is the bottom right vertex.
then x is the angle (40°) defining radius of the circumscribing circle.
remember, sine is the up/down leg, cosine is the left/right leg. and in a larger circle they are all multiplied by the radius.
so,
4 = cos(40) × x
x = 4 / cos(40) = 5.221629157... ≈ 5.22