Bond convexity closed-form formula (Blake and Orszag):
D = coupon payment per period P = present value (price) B = face value i = discount rate per period (half-year) a = fraction of a period remaining until next coupon payment m = number of coupon dates until maturity
Look up Bond duration closed-form formula