Courses
Courses for Kids
Free study material
Offline Centres
More
Store Icon
Store
seo-qna
SearchIcon
banner

How do you write $y = \left| {x - 2} \right|$ as piecewise functions?

Answer
VerifiedVerified
562.8k+ views
Hint: In this question, we are given a function of x, but the function is a modulus function, such types of functions are a combination of multiple subfunctions, that is, they are formed by a combination of two or more functions so we can write them as piecewise functions by splitting them into the subfunctions where each sub function has a different domain. A modulus function gives the absolute value of a function, that is, it converts the negative values into positive values. Using this information, we can find out the correct answer.

Complete step-by-step answer:
We know that –
$\left| x \right| = x$ if x is positive.
$\left| x \right| = - x$ if x is negative.
We have a modulus function as $\left| {x - 2} \right|$ , first we find the value of x which divides the modulus function into positive and negative parts as follows –
$
  x - 2 = 0 \\
   \Rightarrow x = 2 \;
 $
Thus, x is the breaking point.
Now, $y = \left| {x - 2} \right|$
When $x > 2$ , $y = x - 2$ and when $x < 2$ , $y = - (x - 2) = 2 - x$
Hence, the function $y = \left| {x - 2} \right|$ is written as a piecewise functions as –
$y = \{ - x + 2\,for\,x < 2;\,x - 2\,for\,x \geqslant 2\} $
So, the correct answer is “$y = \{ - x + 2\,for\,x < 2;\,x - 2\,for\,x \geqslant 2\} $”.

Note: Functions are used to define the relationship between two variables, where one of them is the independent variable, that is, its value doesn’t depend on the value of the other variable and the other one is the dependent variable, that is, its value changes with the change in the value of another variable. For example, $y = x - 9$ is a function of x, where x is the independent variable and y is the dependent variable. Now, a function is defined by the domain, codomain and range. The set of all the values that the independent variable can have is called the codomain of the function, the set of values that the independent variable actually occupies is called the domain and on putting all the values of the domain in the function, the set of values that y comes out to be is called the range of the function. So, when we divide a function into piecewise form, the domain of the function splits but the range and the codomain remain the same.