Using the Desmos website calculator, sketch a graph of a piecewise function

Using the Desmos website calculator, sketch a graph of a piecewise function. Write the domain in interval notation. y = x^2, -1 ≤ x ≤ 1 and y = 3x – 2, 1 ≤ x ≤ 3 Then choose your own functions and show them on the Desmos website calculator graph.

The Correct Answer and Explanation is:

Piecewise Function Sketch

You can graph the following on the Desmos calculator:

plaintext

f(x) = {
  x^2    for -1 ≤ x ≤ 1
  3x - 2 for 1 ≤ x ≤ 3
}

This defines two distinct behaviors:

  • A quadratic segment from x = -1 to x = 1
  • A linear segment from x = 1 to x = 3

🎯 Domain in Interval Notation

The domain includes all x-values from -1 to 3:

Domain: [-1, 3]

🌟 Original Piecewise Function for Desmos

Here’s a custom function of my own choosing:

plaintext

g(x) = {
  -2x + 1    for -2 ≤ x < 0
  sin(x)     for 0 ≤ x ≤ π
}

This creates:

  • A decreasing linear segment from x = -2 to just before x = 0
  • A sinusoidal curve (half wave) from x = 0 to x = π

Domain of g(x) is:

Domain: [-2, π]

🧠 Explanation

Piecewise functions consist of multiple expressions, each defined over specific intervals. The function behaves differently depending on the input value. In this example, the function f(x) is split into two parts:

  1. On the interval from -1 to 1, the function follows the rule y = x². This is a symmetrical parabola opening upwards, centered at the origin. It smoothly rises from 1 at x = -1 down to 0 at x = 0, then back up to 1 at x = 1.
  2. On the interval from 1 to 3, the function follows y = 3x – 2. This is a straight line with slope 3, intersecting the y-axis at -2. It begins right where the parabola ends, ensuring the graph remains continuous.

The domain is simply the union of both intervals: from -1 through 3, inclusive.

The custom function g(x) demonstrates contrast. Its first part, -2x + 1, defines a descending line from x = -2 to x = 0. The second part introduces curvature with the sine function, capturing a natural periodic behavior. Since sin(x) transitions smoothly and is bounded between -1 and 1, it provides an elegant shift from linearity to trigonometric motion.

These examples illustrate how piecewise functions model real-world scenarios that involve abrupt changes, such as switching gears, tax brackets, or biological growth. Desmos simplifies visualization, allowing you to understand each segment’s contribution within its defined interval.

Scroll to Top