how to create a circuit to represent x^2 +2?
Since the input is 3 bits wide, there are only 8 possible states, and 8 possible outputs.  The largest possible output value is 51, so requires 6 bits to express directly.

A really simple way to implement this in hardware is with a lookup table.  It only needs to be 8 locations of 6 bits each.  If doing it with discrete parts, then you probably use a 256 byte memory.

Of course this is also trivial to do several ways in the firmware of a microcontroller.  The most appropriate method depends on various constraints you haven't told us anything about.