Skip to main content
MBA Compass Logo
MBA Compassby B School Buzz
functions

Piecewise Function

cat
High weightage
CAT
XAT
NMAT
SNAP
CMAT
IIFT
MAT
f(x) = \begin{cases} x^2 & \text{if } x < 0 \\ 2x + 1 & \text{if } x \geq 0 \end{cases}
In this formula, f(x) is defined as a piecewise function, which means it is defined in segments based on the value of x (unitless). The first segment, applies when x is less than 0, producing a quadratic curve. The second segment, 2x + 1, applies when x is greater than or equal to 0, creating a linear function. Piecewise functions compute different outputs based on the input's interval. Geometrically, the graph consists of two distinct segments; one segment is a parabola for negative x values, and the other is a straight line for non-negative x values. Edge cases arise at the boundary x = 0, where the function value transitions from one expression to another, and continuity must be evaluated at this point.

FAQs

What is a piecewise function?
A piecewise function is a function defined by different expressions based on the input value.
How do I evaluate a piecewise function?
To evaluate a piecewise function, determine which condition applies to the given input and use the corresponding expression.

Related formulas