How to handle sine and cosine derivatives when the AP…