# how to solve absolute value for a and b where x is some value

I am beginner at this stage with absolute value, suppose i have |x+a|=|x-b| and where as one of the x solution is 6 and the other is 0. Now how am i supposed to find a and b.

• If |x- a|= |x- b| then either x- a= x- b or x- a= -(x- b). – user247327 Feb 10 at 13:03

Using that $$x=0$$ is a solution gives us $$|a| = |-b|$$, this means that $$a = \pm b$$. Now using that $$x=6$$ is a solution we get $$|6+a|=|6-b|$$. Then we squared both sides and get

$$36 + a^2 + 12a = 36 + b^2 - 12b$$

Using that $$a^2 = b^2$$ and cancelling we get

$$12a = -12b$$ so the solution is $$a = c , b=-c$$ with $$c \in R$$

Since you are just starting out, why don't you square both sides of the equation ?

You will end up getting $$|x+a|^2 = |x-b|^2$$ Since the square of a modulus is just the square (a modulus gives a positive value and squares in real numbers are always positive), you get $$(x+a)^2 = (x-b)^2$$

Taking the $$(x-b)^2$$ to the other side, you get something resembling $$a^2-b^2 = 0$$ Therefore, $$(x+a+x-b)(x+a-(x-b))=0$$ Therefore, $$(2x+a-b)(a+b)=0$$

Using the property that if $$ab=0$$, either $$a=0$$ or $$b=0$$, you end up getting simultaneous equations which can be solved easily.

I do realize that this is not the fastest way to arrive at the solution but it helps you develop some intuition when you start off using modulus operations.

While squaring both sides of an equation is a good approach, it can introduce extraneous solutions, so one must check whether this is the case. However, this problem can be solved without squaring both sides of the equation if we keep in mind what the absolute value of a number means: it is the non-negative distance of the number from $$0$$.

So if $$|x+a|=|x-b|$$ we know that $$x+a$$ and $$x-b$$ lie the same distance from $$0$$. So

$$\text{Either}\quad x+a=x-b\quad\text{or}\quad x+a=-(x-b).$$

So we conclude that

$$\text{Either}\quad a=-b\quad\text{or}\quad a=b-2x$$.

1. If $$x=0$$ then either $$a=-b$$ or $$a=b$$.
2. If $$x=6$$ then either $$a=-b$$ or $$a=b-12$$.