Piecewise Functions

Piecewise functions are defined by different expressions, each applying to a specific range of values for the independent variable.

    A practical example

    One of the simplest examples of a piecewise function is the absolute value function.

    $$ y = |x| $$

    This function is defined by two distinct expressions.

    The first expression, $x$, applies when $x$ is non-negative, while the second expression, $-x$, applies when $x$ is negative.

    $$ y = |x| = \begin{cases} x \ \ \ \ \text{if} \ x \ge 0 \\ \\ -x \ \ \ \ \text{if} \ x \lt 0 \end{cases} $$

    The graph of the function is shown below:

    Graph of the absolute value function

    For all non-negative values of $x$, the function increases.

    For all negative values of $x$, the function decreases.

    And so on.

     

     
     

    Please feel free to point out any errors or typos, or share suggestions to improve these notes. English isn't my first language, so if you notice any mistakes, let me know, and I'll be sure to fix them.

    FacebookTwitterLinkedinLinkedin
    knowledge base

    Functions

    Mathematical Analysis

    More Topics

    Functions of Two Variables