adding calculus section and optimization proofs according to lecture notes