Find all $x\in\mathbb R$ that satisfy the equation $|x| − |x − 1| = 1/2$ . Sketch the graph of the equation $y = |x| − |x − 1|$

741 Views Asked by At

So I understand that given $|x|$, it will be in the form $|x|= \{-x: \text{if } x<0\}$ or $|x|= \{x: \text{if } x >= 0\}$. Also, I know that $|x-1| = \{-(x-1): \text{if } x-1 <0 \text{ or } x<1\}$ and $|x-1|= \{(x-1):\text{if } x >= 0 \text{ or } x >= 1\}$.

From here I have no idea how to combine these two equations to a function that could be plotted as a piecewise function, and I do not understand how to combine the boundaries since I am also confused about the negative sign in front of $|x − 1|$ and if it has an effect on the boundary.

2

There are 2 best solutions below

6
On

Guide:

Consider cases:

Figure out the expression of $|x|-|x-1|$ when

  • case $1$: $x < 0$, find expression $f_1$

  • case $2$: $0 \le x < 1$, find expression $f_2$.

  • case $3$: $x \ge 1$, find expression $f_3$.

For each case, consider whether it can be equal to $\frac12$.

$$|x|-|x-1|=\begin{cases} f_1(x) , & x<0 \\ f_2(x) & 0 \le x < 1 \\ f_3(x) &, x \ge 1\end{cases}$$

0
On

Using Mathematica

Reduce[Abs[x] - Abs[x - 1] == 1/2, x, Reals]

(* x == 3/4 *)

With ContourPlot (http://reference.wolfram.com/language/ref/ContourPlot.html)

ContourPlot[Abs[x] - Abs[x - 1] == y,
 {x, -5, 5}, {y, -3/2, 3/2},
 MaxRecursion -> 5,
 FrameLabel -> Automatic,
 Epilog -> {Red, Dashed,
   Line[{{-5, 1/2}, {3/4, 1/2}, {3/4, -3/2}}]},
 AspectRatio -> 1/GoldenRatio]

enter image description here

With Piecewise (http://reference.wolfram.com/language/ref/Piecewise.html)

Reduce[Abs[x] - Abs[x - 1] == y, x, Reals]

enter image description here

y[x_] = Piecewise[{{-1, x <= 0}, {2 x - 1, 0 < x < 1}, {1, x >= 1}}]

enter image description here

Plot[y[x], {x, -5, 5},
 PlotRange -> {-3/2, 3/2},
 Frame -> True, Axes -> False,
 FrameLabel -> Automatic,
 Epilog -> {Red, Dashed,
   Line[{{-5, 1/2}, {3/4, 1/2}, {3/4, -3/2}}]}]

enter image description here