Problem with element and Maximize

*To*: mathgroup at smc.vnet.net*Subject*: [mg82746] Problem with element and Maximize*From*: Uncle Paul <paul at desinc.com>*Date*: Tue, 30 Oct 2007 03:31:51 -0500 (EST)

I'm not sure what I am doing wrong. I am trying to get the nearest integer maximim for the mentioned equation. I could round the X value, but I would like to operate Mathematica correctly. (*generate the equation*) data = {{0, 0}, {10, 10}, {20, 0}, {30, 10}}; eq = Fit[data, {1, x, x^2, x^3}, x] Plot[eq, {x, 0, 30}] Maximize[{eq, x \[Element] Integers}, x] (*wrong!*) Maximize[{eq}, x] (*correct, but not integer, of course*) Best Regards, Paul