How do I write this without modulus sign?
f(x) = |x-1| + |x+1|
f(x) = |x-1| + |x+1|
1 Answer
or more generally:
Explanation:
For real values of
#abs(t) = sqrt(t^2)#
So if
#f(x) = sqrt((x-1)^2)+sqrt((x+1)^2)#
For complex values of
#abs(t) = sqrt(tbar(t))#
So if
#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]}