Dollar duration of zero coupon bond

Here I use Mathetmatica to illustrate how the first derivative of the price of a zero-coupon bond (with respect to yield) is the dollar duration of the bond. Notice that the first derivative, as the slope of the tangent line, is not the same thing as “duration.” Rather, the first derivative is the dollar duration and it is “infected” by the bond’s price. That means, in this case (ie, continuous compounding), we can divide out the price to get the modified duration (30 for a zero coupon bond with 30 year maturity).