You are given the hypotenuse length and the angle between S1 and the hypotenuse.
From this and the definition of the cosine function
cos(angle between S1 and hypotenuse) = S1/hypotenuse so
cos(40deg) = S1/15
you can solve this for S1. You can then use either sin(40deg) or the Pythagorean theorem to solve for S2.