I have a piecewise linear function (spline) describing a progressive income tax schedule, with higher marginal rates kicking in for higher and higher incomes.
I want to understand the implications of a rule that some tax exempt income might still raise your average rate on the taxable part. Basically, with x
being taxable income and y
being exempt income, your taxes will be f(x+y)/(x+y)*x
, where f
is the nonlinear scheme that would apply to income without exemptions. I can define f
as a piecewise linear function, see above.
To calculate marginal tax rates on taxable and exempt income, I’d simply need the partial derivates of this expression, with the particular function f
plugged in, and this I can plot against the two variables. Or plot against one and use the other as a parameter for Manipulate
.
The derivative looks OK in Mathematica, though it is a bit hard to check with so many cases.
However, I get empty plots, which of course are pointless to manipulate. Where does this go wrong?
Manipulate[Plot[D[Tax[x+y]/(x+y)*x,y],{y,0,200000}],{x,0,200000}]
Think of Tax
this way:
Tax [z_]:= Piecewise[{
{0,0 <=z< 11265},
{0+ 0.0856(z-11265),11265<=z}
}]