Careers360 Logo
Piecewise Function: Definition, Evaluation & Examples

Piecewise Function: Definition, Evaluation & Examples

Edited By Komal Miglani | Updated on Sep 22, 2024 10:10 PM IST

A piecewise function is a function that is defined by different expressions for different intervals of the domain. These functions are useful for modeling situations where a single formula cannot accurately describe the entire behavior of the function across its domain. Generally, the piecewise function is discontinuous in nature. Piecewise functions are used in real-world scenarios where a single rule does not apply to all domain values.

In this article, we will cover the concept of complex numbers. This concept falls under the broader category of complex numbers. It is not only essential for board exams but also for competitive exams like the Joint Entrance Examination (JEE Main), and other entrance exams such as SRMJEE, BITSAT, WBJEE, BCECE, and more. Over the last ten years of the JEE Main exam (from 2013 to 2023), a total of six questions have been asked on this concept, including one in 2014, two in 2020, and three in 2021.

Function-

A relation from a set A to a set B is said to be a function from A to B if every element of set A has one and only one image in set B.

OR

A and B are two non-empty sets, so a relation from A to B is said to be a function if each element x in A is assigned a unique element f(x) in B, and it is written as

f: A ➝ B and read as f is a mapping from A to B.

Function Function Not a function


Not a function

Third one is not a function because d is not related(mapped) to any element in B.

Fourth is not a function as element a in A is mapped to more than one element in B.

Signum function:

The function $\mathrm{f}: \mathrm{R} \rightarrow \mathrm{R}$ is defined by

$\operatorname{sgn}(\mathrm{x})=\left\{\begin{array}{cll}
1 & \text { if } & x>0 \\
-1 & \text { if } & x<0 \\
0 & \text { if } & x=0
\end{array}\right.$
is called the signum function. The domain of the signum function is R and the range is the set {-1,0,1}.

This function can also be written in another form:

$\operatorname{sgn}(x)=\left\{\begin{array}{c}\frac{|x|}{x}, x \neq 0 \\ 0, x=0\end{array}\right\}$

Graph:

Range $\in\{-1,0,1\}$


Greatest integer function (G.I.F.)

The function f: R \small \rightarrow R defined by f(x) = [x], x \small \in R assumes the value of the greatest integer which is equal to or less than x. Such a function is called the greatest integer function.

eg;

[1.75] = 1

[2.34] = 2

[-0.9] = -1

[-4.8] = -5

[4] = 4

[-1] = -1


Graph:

From the definition of [x], we

can see that

[x] = –1 for –1 \small \leq x < 0

[x] = 0 for 0 \small \leq x < 1

[x] = 1 for 1 \small \leq x < 2

[x] = 2 for 2 \small \leq x < 3 and so on.


Properties of greatest integer function:

i) [ a ] = a (If a is an integer)

ii) [[x]] = [x]

iii) x-1 < [x] ≤ x

iv) [ x + a ] = [ x ] + a (If a is an integer)

v) $[x-a]=[x]-a \quad$ (If $a$ is an integer)
vi) $[x]+[-x]=\left\{\begin{array}{rc}0, & \text { if } \\ -1, & \text { if } x \notin Z\end{array} \quad x \in Z\right.$

Fractional part function:

$\{x\}=x-[x]$
When [ x ] is the Greatest Integer Function

Eg

{2.2} = 2.2 - [2.2] = 2.2 - 2 = 0.2

{1.7} = 1.7 - [1.7] = 1.7 - 1 = 0.7

{2} = 2 - [2] = 2 - 2 = 0

{ - 2.2} = -2.2 - [-2.2] = 2.2 - (-3) = 0.8

{ - 1.7} = -1.7 - [ - 1.7] = 1.7 - (-2) = 0.3

{ - 2} = - 2 - [-2] = 2 - ( - 2) = 0

Clearly , 0 ≤ {x} < 1


Graph

Domain: R

\text{Range }\in [ 0,1 )


Properties of the fractional part of x

i) {x} = x if 0 ≤ x < 1

ii) {a} = 0, if a is an integer

iii) 0 ≤ {x} < 1

iv) { x + a } = {x} ( If a is an integer)

v) {x} + {-x} = 1, if x doesn’t belongs to integer

vi) {x} + {-x} = 0, if x belongs to integer

Summary

Piecewise functions are versatile and can model various scenarios where behavior changes across different segments of the domain. They are defined by multiple expressions, each valid over a specific interval, and can represent real-world situations more accurately than single-expression functions.

Recommended Video :

Solved Examples Based On the Piecewise Functions:

Example 1: What is the range of f(x) = 4[x]?

Solution:

Range of [x] is Z i.e {...-2,-1,0,1,2...}

so Range of 4[x] is {...-8,-4,0,4,8}

Example 2: What is the range of function f(x) = {x}+{-x}

1) [0,1)

2) (-1,1)

3) {0,1}

4) [0,1]

Solution:

f(x) = {x}+{-x}

If x \epsilon Z, then f(x) = 0

If x is not an integer, then let x= Z+k

f(x) = {Z+k}+ {-Z-k}

= k + 1 - k = 1

Hence, the answer is the option 3.

Example 3: Let [t] denote the greatest integer. Then the equation in $\mathrm{x},[x]^2+2[x+2]-7=0$ has.
1) exactly two solutions
2) exactly four integral solution
3) no integral solution
4) infinitely many solutions

Solution:

$\begin{aligned}
& {[\mathrm{x}]^2+2[\mathrm{x}+2]-7=0} \\
& \Rightarrow[\mathrm{x}]^2+2[\mathrm{x}]+4-7=0 \\
& \Rightarrow[\mathrm{x}]=1,-3 \\
& \Rightarrow \mathrm{x} \in[1,2) \cup[-3,-2)
\end{aligned}$
Hence, the answer is option (4).

Example 4: The real-valued function $f(x)=\frac{\operatorname{cosec}^{-1} x}{\sqrt{x-[x]}}$, where $[x]$ denotes the greatest integer less than or equal to x , is defined for all $x$ belonging to :
1) all non-integers except the interval $[-1,1]$
2) all real except integers
3) all integers except $0,-1,1$
4) all real except the interval $[-1,1]$

Solution:

$f(x)=\frac{\operatorname{cosec}^{-1} x}{\sqrt{\{x\}}}$

Domain of $\operatorname{cosec}^{-1} x$ is $|x| \geq 1$

and $x-[x]>0 \Rightarrow x \in R-\{I\}$

So $x \in R-I-[-1,1]$

Hence, the answer is the option 1.

Example 5: If $f(x)=3 \operatorname{sgn}(x)$. Then what is the range of $\mathrm{f}(\mathrm{x})$ ?1) {-1,0,1}

2) {-1/3,0,1/3}

3) {-3,0,3}

4) {-1,1}

Solution:

As sgn(x) can take only three values -1,0 and 1

So 3sgn(x) can take only three values -3, 0, 3

So, the range of this function is {-3,0,3}

Hence, the answer is the option 3.

Frequently Asked Questions (FAQs)

1. What is a function?

A relation from a set A to a set B is a function from A to B if every element of set A has one and only one image in set B.

2. What is a piecewise function?

A piecewise function is a function that is defined by different expressions for different intervals of the domain.

3. What is the domain and range of signum function?

The domain of the signum function is R and the range is the set {-1,0,1}.

4. What is the greatest integer function?

The value of the greatest integer which is equal to or less than x. Such a function is called the greatest integer function.

5. What is the domain and range of fractional part function?

The domain of the signum function is R and the range belongs to [0,1).

Articles

Back to top