I’ve been getting a lot of questions about absolute values, and so I thought I would try and clarify things here as much as possible. I’ll give some basic definitions and intuition, and then go through some examples, from easier to harder.

The absolute value function is just….a function. You give it a number, and it returns a number. In the same way that f(x)=x^2 is a function. You give it a number and it returns that number multiplied by itself. So the absolute value function, which we write as f(x)=|x| takes a number and returns the same number if the number was positive, and the negative of the number if it was negative, thus returning always a positive number.

We can think of this as the function “how far away from the point 0 (the origin) on the real number line is x?”. It doesn’t care about what direction it is, only how far away it is. So the point 2 is a distance of 2 from the origin, and -2 is also a distance 2 from the origin.

Note that the definition above comes in two parts:

  1. If the input is positive (or 0), return the original number
  2. If the input is negative, return minus that number.

We can write this formally as a piecewise defined function as (piecewise because it is defined in pieces):

Screenshot 2019-02-22 11.32.47

The function is defined differently therefore for x\ge 0 and for x<0. So, when we are dealing with this function, we should deal with the two regions separately. You might ask why the first one is greater than or equal to and the second one is only less than. The answer is that we could write it as greater than for the first, and less than or equal to for the second, but it would be exactly the same thing, because for the point 0, -x is the same as x. If we plot a graph of the function, it looks like this:

Screenshot 2019-02-22 11.35.21

Now, how about not just looking at the absolute value of x but of something a little more complicated. How would we define |2x-3|? Well, in the above definition it does say what x is, so we can simply plug in anything for x. Thus, we would have:

Screenshot 2019-02-22 11.36.53

But the part after the ‘if’ can be simplified a little, just by solving each one for x and we get:

Screenshot 2019-02-22 11.37.23

So this now says that rather than having a different function for x less than zero, and for greater than or equal to zero, it’s now either side of x=\frac{3}{2}. Again, which part we put the equality doesn’t matter, so long as it is somewhere defined for x=\frac{3}{2}. We can plot this and we find that it looks like

Screenshot 2019-02-22 11.41.00

The graph is twice as steep as the previous one (because of the 2 in |2x-3|) and is defined separately for either side of x=\frac{3}{2}.

If we want to solve an equation with an absolute value, we do so by considering each piece separately. So, if you wanted to solve |x|=3, you would have:

  1. For x<0 the definition of the absolute value is that |x|=-x and so we have -x=3 , which gives x=-3
  2. For x\ge0 the definition of the absolute value is that |x|=x and so we have x=3, which gives x=3

The solution is thus the union of these two solutions ie \{-3\}\cup\{3\}=\{-3,3\}.

How about an absolute value inequality? What if we wanted to solve |2x-3|>4? Again, we do this using the piecewise defined function. We treat each piece separately. We know that this absolute value has its pieces defined separately for x<\frac{3}{2} and for x\ge \frac{3}{2}, so let’s calculate the inequalities in each region separately:

  • For x<\frac{3}{2}:

by the above definition of the absolute value, in this region |2x-3|=-(2x-3), so the inequality in this region is

-(2x-3)>4.

Multiplying both sides by -1 changes the direction of the inequality to give: 2x-3<-4 which can be solved to give: x<-\frac{1}{2}.

But we know that this is only valid in the region x<\frac{3}{2} (for this piece). So we have to take the intersection of the solution, with the region that it’s valid in.

In interval notation this gives:

(-\infty,\frac{3}{2})\cap(-\infty,-\frac{1}{2})=(-\infty,-\frac{1}{2})

  • For x\ge\frac{3}{2}:

by the above definition of the absolute value, in this region |2x-3|=(2x-3), so the inequality in this region is

(2x-3)> 4.

which can be solved to give: x>\frac{7}{2}.

But we know that this is only valid in the region x>\frac{3}{2} (for this piece). So we have to take the intersection of the solution, with the region that it’s valid in.

In interval notation this gives:

[\frac{3}{2},\infty)\cap(\frac{7}{2},\infty)=(\frac{7}{2},\infty)

OK, now we have the solutions in the two regions, and we can take the union of the two (ie. either of them are valid solutions to the original inequality, and the answer is:

(-\infty,-\frac{1}{2})\cup(\frac{7}{2}\infty)

Looking at the above graph for the function f(x)=|2x-3| and asking for what values of x is the y value greater than 4, the answer above seems to make sense. It’s true for any x<-\frac{1}{2} or for any value x>\frac{7}{2}.

OK, so this is how to calculate a very simple absolute value inequality, but now let’s look at something a little more complicated.

Find all x such that |2x-3|<|x-2|.

Now we have two absolute values to have to think about. I am going to give one method to think about this sort of problem, which is very general, but there are other methods. I recommend this as a failsafe one which will work in just about any context, with any number of absolute value functions.

The first thing we will do is to take everything over to one side of the inequality to give:

|2x-3|-|x-2|<0

Let’s forget about the inequality for now and just focus on the left hand side. We can think of a function f(x)=|2x-3|-|x-2| and eventually we will want to ask when this is less than zero. For now, let’s see if we can understand the function itself.

In the previous example we used the definition of the absolute value to write out a piecewise defined function. We can do the same thing in this case, except we have to be careful because |2x-3| is defined in two pieces, for x<\frac{3}{2} and x\ge \frac{3}{2}, and |x-2| is defined in two pieces for x<2 and x\ge 2. So the whole thing can be written in three pieces. One for x<\frac{3}{2} (in which case the terms inside both absolute value signs are negative). One for \frac{3}{2}\le x<2 (in which case the term inside the first absolute value sign is positive, and in the second is negative). And one for x\ge 2 (in which case the terms inside both absolute values signs are positive). So overall we can summarise all of the above by:

Screenshot 2019-02-22 12.53.30

which can be simplified to:

Screenshot 2019-02-22 13.00.25

OK, so now we have three regions that we have to solve our original inequality in:

  • For x<\frac{3}{2}, we have: -x+1<0
  • For \frac{3}{2}\le x<2, we have: 3x-5<0
  • For x\ge 2, we have: x-1<0

Now let’s solve each of these separately:

  • For x<\frac{3}{2}

Solving -x+1<0 gives x>1. But this solution is only valid in the region x<\frac{3}{2}, so we have to take the intersection of these two intervals:

(-\infty,\frac{3}{2})\cap(1,\infty)=(1,\frac{3}{2})

  • For \frac{3}{2}\le x<2

Solving 3x-5<0 gives x<\frac{5}{3}. But this solution is only valid in the region \frac{3}{2}\le x<2, so we have to take the intersection of these two intervals:

[\frac{3}{2},2)\cap(-\infty,\frac{5}{3})=[\frac{3}{2},\frac{5}{3})

  • For x\ge 2

Solving x-1<0 gives x<1. But this solution is only valid in the region x\ge 2, so we have to take the intersection of these two intervals:

[2,\infty)\cap(-\infty,1)=\emptyset

Now we have three intervals and we can take the union of them to get the final answer:

(1,\frac{3}{2})\cup[\frac{3}{2},\frac{5}{3})\cup\emptyset=(1,\frac{5}{3})

Are there other ways of doing this? Yes! Absolutely! And it’s a good idea to try and play around with other ways too, but I think that this is a good general method for dealing with inequalities (and equations) involving absolute values. The steps are:

  • Write the absolute value parts in their piecewise form
  • Write out separate inequalities for the different pieces
  • Take the intersection of the solution with the interval on which the piece is defined
  • Take the union of all the solutions in the end

This procedure can be done for absolute value inequalities with any complicated combination of functions.

Let’s try one more example this time with a quadratic function inside an absolute value with an inequality.

Find all x for which |x^2-2x-3|<1

Now we have a quadratic function inside the absolute value sign. Let’s write everything on one side of the inequality and define a function f(x)=|x^2-2x-3|-1. So the problem we want to solve is f(x)<0.

Now, we can write this function as a piecewise defined function:

Screenshot 2019-02-22 15.06.59

We have to be a bit careful now with what the regions mean. In fact now we have to solve an inequality to understand what the regions correspond to.

Looking at the first one we have x^2-2x-3<0. This is a parabola and we want to know when it is less than zero. In fact we can do this by solving it for zero. This has zeros at x^2-2x-3=0\implies x=3 or $latex $x=-1$. Because it is a U-shaped parabola, we know that it will take values less than zero in the region between these two points, so x^2-2x-3<0 is true for the interval (-1,3). The other region is where x^2-2x-3\ge 0, which is x values in the interval (-\infty,-1]\cup[3,\infty). So we can actually write our piecewise defined function as:

Screenshot 2019-02-22 15.15.02

which can be simplified to:

Screenshot 2019-02-22 15.16.04

ok, good, now we have our three regions (it looks like two above, but really we can think of them as less than or equal to -1, from -1 to 3, greater than or equal to 3. Let’s look at the first inequality first.

  • In the region -1<x<3 (ie (-1,3)) we have the inequality -x^2+2x+2<0.

This is now a downward parabola. Finding the zeroes of -x^2+2x+2 gives us x=1-\sqrt{3} and x=1+\sqrt{3}. Because it is a downward parabola, the values of x for which the inequality holds (ie. the function is less than zero) is going to be (-\infty, 1-\sqrt{3})\cup(1+\sqrt{3},\infty). (plot the function to make sure that you understand this).

Now we need to ask what values of x in the region of interest ((-1,3)) are also in the solution to the inequality ((-\infty, 1-\sqrt{3})\cup(1+\sqrt{3},\infty)). ie we have to take the intersection of the two:

(-1,3)\cap\left((-\infty, 1-\sqrt{3})\cup(1+\sqrt{3},\infty)\right)

If you are confused by a statement like this, write out a number line.

Screenshot 2019-02-22 15.49.02

We see that the overlap between the regions is:

(-1,1-\sqrt{3})\cup(1+\sqrt{3},3)

ok, so we have the solution to the first region! Now let’s look at the second.

  • In the region x\le-1 \text{ or } x\ge 3 (ie (-\infty,-1]\cup[3,\infty)) we have the inequality x^2-2x-4<0.

Solving this inequality in the same as we before we find the solutions 1-\sqrt{5}<x<1+\sqrt{5} or (1-\sqrt{5},1+\sqrt{5}).

Now we have to take the intersection of the solution with the region that it’s valid in, which corresponds to:

((-\infty,-1]\cup[3,\infty))\cap (1-\sqrt{5},1+\sqrt{5})

Drawing the number line as before, we find that this is given by:

((-\infty,-1]\cup[3,\infty))\cap (1-\sqrt{5},1+\sqrt{5})=(1-\sqrt{5},-1]\cup[3,1+\sqrt{5})

Great! Now all we have to do is to take the union of the two solutions we’ve found:

(-1,1-\sqrt{3})\cup(1+\sqrt{3},3)\cup(1-\sqrt{5},-1)\cup[3,1+\sqrt{5})

with such an expression it’s best to order it so that the lower intervals come first followed by the higher intervals which in this case gives:

(1-\sqrt{5},-1]\cup(-1,1-\sqrt{3})\cup(1+\sqrt{3},3)\cup[3,1+\sqrt{5})

and we can combine the first two together and the last two together to give:

(1-\sqrt{5},1-\sqrt{3})\cup(1+\sqrt{3},1+\sqrt{5})

and that’s it. That is the solution to the question: Find all x for which |x^2-2x-3|<1. Again, there are most likely shorter ways of doing this, but we are able to use the same method in many different contexts and it should work every time.

How clear is this post?