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 a piecewise function?

Answer
VerifiedVerified
563.4k+ views
Hint: To find the value of the piecewise function, we have to consider three cases.
Case 1: For absolute value.
Case 2: For negative value.
Case 3: For positive value.
Combining these three cases, we can find the piecewise function.

Complete step-by-step solution:
It is given that; the function is \[y = \left| {x + 2} \right|\].
We have to write the given function as a piecewise function.
We will consider three values.
For the absolute value:
Let us consider, the value of the function is zero, that is \[y = 0\]
So, we have, \[\left| {x + 2} \right| = 0\]
Simplifying we get,
\[x + 2 = 0\]
Simplifying again we get,
\[x = - 2\] …………… (1)
For the negative values:
Let us consider, the value of the function is negative, that is \[y < 0\]
So, we have, \[\left| {x + 2} \right| < 0 \Rightarrow - x - 2 < 0\]
Simplifying we get,
\[x < - 2\] …………… (2)
For the positive values:
Let us consider, the value of the function is negative, that is \[y > 0\]
So, we have, \[\left| {x + 2} \right| > 0\]
Simplifying we get,
\[x > - 2\] …………… (3)
Now, combining (1), (2) and (3) we get,
\[ \Rightarrow y = - x - 2;x < - 2\]
\[ \Rightarrow x + 2;x \geqslant - 2\]

Hence, the piecewise function is \[y = - x - 2;x < - 2\]
\[ \Rightarrow x + 2;x \geqslant - 2\]


Note: In mathematics, a piecewise-defined function (also called a piecewise function, a hybrid function, or definition by cases) is a function defined by multiple sub-functions, where each sub-function applies to a different interval in the domain.
Piecewise is actually a way of expressing the function, rather than a characteristic of the function itself, but with additional qualification, it can describe the nature of the function.
A distinct, but related notion is that of a property holding piecewise for a function, used when the domain can be divided into intervals on which the property holds. Unlike for the notion above, this is actually a property of the function itself.