First order calculus

Signed-off-by: Mingxi Wu <thisisforivy@gmail.com>