40 degrees and 50 degrees are complementary angles; stated differently, they can be the two acute angles of a right triangle.
That means that, for you problem in particular, sin(40) = cos(50) -- according to the definition of the sine and cosine functions for a right triangle. Then