How do I write this without modulus sign?

f(x) = |x-1| + |x+1|

1 Answer
Oct 7, 2017

#f(x) = sqrt((x-1)^2)+sqrt((x+1)^2)#

or more generally:

#f(x) = sqrt((x-1)bar((x-1)))+sqrt((x+1)bar((x+1)))#

Explanation:

For real values of #t# we have:

#abs(t) = sqrt(t^2)#

So if #x# is real valued then we can write:

#f(x) = sqrt((x-1)^2)+sqrt((x+1)^2)#

For complex values of #t# we have:

#abs(t) = sqrt(tbar(t))#

So if #x# can be complex valued, then we can write:

#f(x) = sqrt((x-1)bar((x-1)))+sqrt((x+1)bar((x+1)))#

Alternatively, we can write it as a piecewise function.

Note that in general:

#abs(t) = { (t " if " t >= 0), (-t " if " t < 0) :}#

So:

  • If #x < -1# then #abs(x-1)+abs(x+1) = -(x-1)-(x+1) = -2x#

  • If #-1 <= x < 1# then #abs(x-1)+abs(x+1) = -(x-1)+(x+1) = 2#

  • If #1 <= x# then #abs(x-1)+abs(x+1) = (x-1)+(x+1) = 2x#

So:

#f(x) = { (color(black)(-)2x " if " x < -1), (color(white)(-)2color(white)(x)" if " -1 <= x < 1), (color(white)(-)2x " if " 1 <= x) :}#

graph{sqrt((x-1)^2)+sqrt((x+1)^2) [-5.003, 4.997, -0.56, 4.44]}