This is an adaptation of Preview Activity 1.5.1 and Example 1.5.2 from Active Calculus.
By Dave Sabol