Bond convexity
In finance, bond convexity is a measure of the non-linear relationship between price and yield duration of a bond to changes in interest rates, the second derivative of the price of the bond with respect to interest rates (duration is the first derivative). In general, the higher the duration, the more sensitive the bond price is to the change in interest rates. Bond convexity is one of the most basic and widely used forms of convexity in finance.
Calculation of convexity
Duration is a linear measure or 1st derivative of how the price of a bond changes in response to interest rate changes. As interest rates change, the price is not likely to change linearly, but instead it would change over some curved function of interest rates. The more curved the price function of the bond is, the more inaccurate duration is as a measure of the interest rate sensitivity.
Convexity is a measure of the curvature or 2nd derivative of how the price of a bond varies with interest rate, i.e. how the duration of a bond changes as the interest rate changes. Specifically, one assumes that the interest rate is constant across the life of the bond and that changes in interest rates occur evenly. Using these assumptions, duration can be formulated as the first derivative of the price function of the bond with respect to the interest rate in question. Then the convexity would be the second derivative of the price function with respect to the interest rate.