First 3000, no tax. The income From 3000 to 5000, which equals 2000, will be taxed at 1%, that's 200. Anything above 5000 will be taxed at 2%, hence 0.02 * (x - 5000).
If you calculate as 0.01 * (x -3000) + 0.02 * (x - 5000), then you tax the amount over 5000 twice.