Does anyone know how to calculate the derivative of a mathematical expression, or function optimization with Lagrange multipliers, in Ruby?? This is for a advanced shop/crafting script I'm working on, and I'm going to use an general equilibirum economic model to handle the item prices.