The safety margin can be calculated using different methods, but one common approach is the therapeutic index (TI), which is the ratio of the toxic dose (TD50) to the effective dose (ED50). Mathematically, it is expressed as: TI = TD50 / ED50 Where TD50 is the dose at which 50% of the population experiences toxic effects, and ED50 is the dose at which 50% of the population experiences the desired therapeutic effect. A higher therapeutic index indicates a wider safety margin.