From the definition of the statutory tax rates, it is possible to write a tax equation, giving the tax owed in function of the income, the tax brackets and the filing status.
The different variables are:
* I, income
* R, array of statutory rates, by bracket and filing status
* B, array of bracket start boundaries, by bracket and filing status
* f, filing status
* b, a bracket index
The equation uses an intermediary variable S, array of tax owed at the start of a given bracket. S is not an independent variable and can be calculated iteratively as shown above or directly expressed as a sum
The marginal rate is the ratio between the increase in tax owed and an increase in income. Using the tax equation, the marginal rate is the partial derivative of the tax equation over the variable I. As expected, the marginal rate is simply the statutory rate at this stage.
If wanted, partial derivatives over different variables provide solutions for other form of increase, e.g. if the start of the 10% bracket is changed, what is the corresponding increase in tax.