If I am interpreting "marginalrate" correctly, it is very simple:

if I (income) is less than $10000, the tax is .1I or I/10.

If I is larger than or equal to $10000, the tax is $1000+ .15(I- 10000).

That "$1000" is, of course the tax on the first $10000 income, and then you apply the 15% rate to the remainder: if you earn $45000, you pay 10% of the first $10000, or $1000, plus 15% of 45000- 10000= 25000 so you pay .15(25000)= $3750 on the rest for a total tax of $4750.