# Sum of all integer solutions for an inequality

I have two functions: $f(x) = x^{2}-3|x-1|$ and $g(x)=2|x-2|$.

I need to find the sum of all integer solutions for the following inequality: $$g[f(x)]\leq 2$$

-
Do you mean by $[.]$ the floor function or it is just parentheses, $g(f(x))$? –  Babak S. Nov 26 '12 at 9:10
It was not specified in the task, but I guess it's a rather a floor function. –  Max Dremin Nov 26 '12 at 9:16
The floor function would make no sense, both because $f$ takes integer values at the integers anyway, and because that would leave $g$ without an argument; so it must be intended as $g(f(x))$. –  joriki Nov 26 '12 at 10:30
I get it now. Thanks, @joriki. And so it goes as g(f(x)). –  Max Dremin Nov 26 '12 at 10:38

The inequality is fulfilled if $|f(x)-2|\le1$. Since $f(x)$ takes integer values at the integers, that means $f(x)\in\{1,2,3\}$. Substituting the integers from $-5$ to $5$ shows that the only solution is $x=3$.