The cos(x) will always equal sin(90-x) which can be looked at as sin(y)=cos(x) where 90=x+y
To give you a few quick examples:
sin(60)=cos(30)
sin(10)=cos(80)
sin(90)=cos(0)
The numbers must always add up to 90.
so cos(40) in the problem is equal to sin(50).
or
--------------------------------
If you have questions, please email me at ericahigley@yahoo.com.