The sine was changed for the cosine in the third problem