Divide the percent by 100 before you multiply. 8.25% is 0.0825. Times $40 is $3.30. The total is $43.30. If the price you have already includes tax, do not run this again. You would tax the tax.
A state rate and a city rate are two percents of the same price only when both apply to that item. Add the dollars, or add the rates and then multiply once. Adding the rates after one of them was already applied to a different base is a different bill.