Differentiate from first principles (sin x and cos x) (#902)