I can't see your attachment (it's not been approved yet) but to perform that derivative, you use the chain rule. So
[tex]\frac{d}{dp}(\cos t)=-\sin t\frac{dt}{dp}[/tex]
It is a bit frustating that you had the possibility to read the attachement and give a comment on it, while other members have not yet been able to read it because it is "pending".