In maths, a piecewise function is a function that is defined by different expressions for different intervals of the domain. These functions are useful for modeling and analyzing situations where a single formula cannot precisely describe the entire behavior of the function across its domain. Generally, the piecewise function is discontinuous in nature. They are used in real-world scenarios where a single rule does not apply to all domain values.
JEE Main 2025: Sample Papers | Mock Tests | PYQs | Study Plan 100 Days
JEE Main 2025: Maths Formulas | Study Materials
JEE Main 2025: Syllabus | Preparation Guide | High Scoring Topics
In this article, we will cover the concept of piecewise functions. This concept falls under the broader category of relations and functions. 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.
$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$.
A piecewise function is a type of function defined by different expressions for different intervals of the domain. Now, let us look in detail about what is a peicewise function.
It is a function with more than one pieces of curves in its graph. It means that its output value changes according to different input values being inserted or other way round , a piecewise function behaves according to the input value and is dependend on it.
A piecewise function is a function $f(x)$ which has different definitions in different intervals of $x$. The graph of a piecewise function has different pieces corresponding to each of its definitions. For example, the absolute value function. We know that an absolute value function is $f(x)=|x|$ or $f(x)=\{x$, if $x \geq 0-x$, if $x<0 f(x)=\{x$, if $x \geq 0-x$, if $x<0$. We define it as:
The examples of piecewise functions includes any function defined with more than one piece of curves in its graph. Some examples of piecewise function are $f(x)= \begin{cases}x+2 & \text { if } x<0 \\ x^2 & \text { if } x \geq 0\end{cases}$, $f(x)= \begin{cases}x & \text { if } x \geq 0 \\ -x & \text { if } x<0\end{cases}$, $f(x)= \begin{cases}1 & \text { if } 0 \leq x<1, \\ 2 & \text { if } 1 \leq x<2, \\ 3 & \text { if } 2 \leq x<3\end{cases}$, $f(x)= \begin{cases}5 & \text { if } x<-2, \\ 0 & \text { if }-2 \leq x \leq 2, \\ -5 & \text { if } x>2\end{cases}$ etc. as each of these include the functions defined with different curves.
The graph of piecewise functions represents the different curves of the piecewise function give.
Example: Graph the piecewise defined function $
f(x) =
\begin{cases}
-2x & \text{if } x < -2 \\
-|x| & \text{if } -2 \leq x \leq 0 \\
2 - x^2 & \text{if } x > 0
\end{cases}
$.
Solution:
$f(x)$ has $ 3$ definitions:
Let us write the intervals and their corresponding definitions. Also, let us frame tables that include the endpoints of the intervals and also several other random numbers from each interval. We will calculate the value of y in each case using the corresponding definition.
Now, we plot these points on the graph. Note that we have to put open dots at $(-2, -0.25)$ (first table) and $(0, 2)$ (last table) as their corresponding x coordinates are excluded from the interval.
We note that the left most (light orange colored) curve is extended to the left side as it corresponds to the interval $x<-2$. Also, the right-most (blue-colored) curve is extended in the interval $x>0$. The middle (dark orange colored) curve is NOT extended on either side as it belongs to the interval $-2 \leq x \leq 0$.
It is enough to look at the definition of function to find out the domain and range of the function. For doing so, we take the union of all intervals with $x$ and that will give us the domain. In the above example, the domain of $f(x)$ is, $\{x \mid x<-2\} \cup\{x \mid-2 \leq x \leq 0\} \cup\{x \mid x>$ $0\}$. The union of all these sets is just the set of all reals. So the domain of $f(x)$ (in the above example) is $R$.
The range of the function can be simply found out by graphing the function and looking at the $y$ axis. In the above example, all $y$-values less than 2 (exclude 2 as there is an open dot at $(0,2)$ ) are covered by the graph. So its range is $\{y \mid y<2\}$ (or) $(-\infty, 2)$.
It simply reflects the continuous nature of the function and means that the graph can be drawn by without lifting the pencil even once. This is the simplest and most convenient way to check the continuity of any kind of function.
$f(x) =
\begin{cases}
x - 1 & \text{if } x < -2 \\
-3 & \text{if } x \geq -2
\end{cases}
$
The properties of piecewise functions are,
Example 1: What is the range of $f(x)=4[x]$ ?
Solution:
Range of $[x]$ is Z i.e $\{\ldots-2,-1,0,1,2 \ldots\}$
so Range of $4[x]$ is $\{\ldots-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 \in Z$, then $f(x)=0$
If $x$ is not an integer, then let $x=Z+k$
$
\begin{aligned}
& f(x)=\{Z+k\}+\{-Z-k\} \\
& =k+1-k=1
\end{aligned}
$
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) $\{\frac{-1}{3},0,\frac{1}{3}\}$
3) $\{-3,0,3\}$
4) $\{-1,1\}$
Solution:
As $\operatorname{sgn}(x)$ can take only three values $-1,0$ and 1
So $3 \operatorname{sgn}(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.
A piecewise function is a function that is built from pieces of different functions over different intervals. For example, we can make a piecewise function $f(x)$ where $f(x)=-9$ when $-9<x \leq-5, f(x)=6$ when $-5<x \leq-1$, and $f(x)=-7$ when $-1$.
An example of a piecewise function is the absolute value function. The absolute value function can be written as $f(x)=| x |$. This function has three different pieces, $x$ for all values less than $1, x^2$ for all values between 1 and 3 (including 1 and 3 ) and finally, $x+3$ for all values greater than three.
In mathematics, a piecewise function (also called a piecewise-defined function, a hybrid function, or a function defined by cases) is a function whose domain is partitioned into several intervals ("subdomains") on which the function may be defined differently.
Some examples include linear, quadratic, cubic, rational, square root, absolute value, exponential, logarithmic, trigonometric, inverse trigonometric, etc.
In Mathematics, a step function (also called as staircase function) is defined as a piecewise constant function, that has only a finite number of pieces. In other words, a function on the real numbers can be described as a finite linear combination of indicator functions of given intervals.
18 Dec'24 02:25 AM
18 Dec'24 01:28 AM
26 Nov'24 11:39 AM
26 Nov'24 11:07 AM
26 Nov'24 11:04 AM
24 Nov'24 03:17 AM
23 Nov'24 10:42 AM
15 Oct'24 01:44 PM
12 Oct'24 12:12 PM
12 Oct'24 12:06 PM