Constrained Optimization of a "taxation" curve not working Optimization.jl / Ipopt

All right, I tried a constraint in which I calculate the mean of exp(-20*dy/dx) and constrain its upper bound. It works sufficiently well that I can let people tune the peak marginal tax rate by controlling the upper bound, and it converges in a couple seconds so everything is working. It comes down to the need for a twice differentiable constraint for Ipopt.