Consider that angles of 5x and 40 are supplementary, that is, they add up 180°, then, you have:
5x + 40° = 180° subtract 40° both sides
5x = 180° - 40°
5x = 140° divide by 5 both sides
x = 140°/5
x = 28°
Next, consider that you have two parallel lines crossed by a secant line. Then, angles 5x and 3y-1 are