I have the function $$g(x)=|x^2-x-2|$$ which is defined on $$-\frac{3}{2}\leq x\leq \frac{3}{2}$$

I am struggeling with that g(x) has absolute values wrapped around. I taught that I just draw the graph and flip the negative values upwards but that seems not to work.

I started by finding the roots, $x_1=2, x_2=-1$ and then I taught that because this is a second order function, the max (or min) should be either in one of the limit points or at $\frac{1}{2}$ because it is just between the roots.

I cant get it right, I think that the abs value confuses me, how do I handle them?


2 Answers 2


Your function is defined on the interval [-3/2;3/2], so if you want to handle the absolute value you can consider the interval on which it is positive and the one where it is negative.

The polynome is negative between the roots, so on [-1;3/2] your function is $g_1(x)=x^2-x-2$ and it is then positive outside so on [-3/2;-1] your function is $g_2(x)=-x^2+x+2$.

And then you can study min and max of this piecewise function.

  • $\begingroup$ Ah, so what I really do is flip the signs of the part that should be negative without the absolute wrapping? $\endgroup$
    – rablentain
    Mar 7, 2015 at 8:18
  • $\begingroup$ that's how absolute value works. $\endgroup$
    – Tanj
    Mar 7, 2015 at 8:20

You will certainly have a minimum at $x=-1$, since you have found that $g(-1)=0$ and $g(x)\geq 0$ due to the absolute value. The rest of your analysis is correct; just check the boundaries of the interval and the vertex of the parabola, $x=1/2$.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .