How to write below quadratic utility function equations in GAMS with conditions

kkkk.png
how can i write quadratic equation in gams with upper and lower bounds. Attaching JPG file for reference. yours suggestions please.

You either introduce a binary variable b that tells you where you x is (x<=omega/alpha => b=0, else b=1) and use that to model the function or if you are in the lon-linear model realm anyway use ifthen(x<=omega/alpha, omegax - alpha/2sqr(x), omega/alpha).

-Michael