With the hours in A1, and rate in B1,

=IF(A1<=37.5,B1*A1,IF(AND(A1>37.5,A1<40),B1*37.5+(A1-37.5)*(B1*1.5),IF(A1>=40,(B1*37.5)+(B1*1.5*2.5)+((A1-40)*B1*2))))