both angles, when added together, form a line...this means they equal 180 degrees.
5x + 20 + x + 40 = 180
6x + 60 = 180
6x = 180 - 60
6x = 120
x = 120/6
x = 20
5x + 20 = 5(20) + 20 = 100 + 20 = 120
x + 40 = 20 + 40 = 60
so ur 2 angles are 120 and 60 degrees