Math & ModelingBeginnerGraph simulation~15 min

Graphing Functions

Every graph you meet in science — a falling object, a growing population, a sound wave — is built from a handful of basic shapes that have been shifted, stretched or flipped. Learn the four transformations once and you can sketch hundreds of functions in your head.

Click the graph to read coordinates

y = a · f( b(x − h) ) + k

1

Negative a reflects the graph across the x-axis.

1

|b| > 1 squeezes the graph horizontally. Negative b reflects across the y-axis.

0

Positive h shifts right — opposite to the sign you see in (x − h).

0
2
Equation
—
Trace point
—
y-intercept
—
x-intercept(s)
—
Key feature
—
Domain / range
—

    How to use this simulator

    1. Choose a parent function from the menu. Its plain shape is shown dashed.
    2. Move the a, b, h and k sliders one at a time and watch how the solid curve changes compared with the dashed parent.
    3. Move the trace point to read y-values, or click the graph to read any coordinate.
    4. Read the key features in the boxes below: intercepts, vertex or asymptotes, domain and range.
    5. Press Keep this curve to save a graph for comparison, then change the sliders. Reset restores y = x².

    What is a function?

    A function is a rule that gives exactly one output for each input. We write it as y = f(x): put in an x-value, get out a y-value. Its graph is the set of all points (x, f(x)). Because each input has only one output, any vertical line crosses the graph of a function at most once — the vertical line test.

    Parent functions

    A parent function is the simplest member of a family:

    • Linear, f(x) = x — a straight line through the origin.
    • Quadratic, f(x) = x² — a U-shaped parabola with its vertex at the origin.
    • Absolute value, f(x) = |x| — a V shape.
    • Square root, f(x) = √x — starts at the origin and rises ever more slowly; defined only for x ≥ 0.
    • Sine, f(x) = sin x — a wave that repeats every 2π.
    • Exponential, f(x) = 2ˣ — doubles with every step to the right and approaches 0 on the left.
    • Reciprocal, f(x) = 1/x — two branches separated by asymptotes on both axes.

    The four transformations

    Every graph in the simulator has the form:

    y = a · f( b(x − h) ) + k
    ParameterEffectExample
    k (outside, added)Vertical shift: up if k > 0, down if k < 0x² + 3 moves up 3
    h (inside, subtracted)Horizontal shift: right if h > 0(x − 2)² moves right 2
    a (outside, multiplied)Vertical stretch by |a|; reflection across the x-axis if a < 03x² is steeper; −x² opens down
    b (inside, multiplied)Horizontal compression by |b|; reflection across the y-axis if b < 0sin(2x) has half the period

    A useful rule: changes outside the function act on y-values and behave as you expect. Changesinside act on x-values and behave the opposite way — subtracting moves right, and multiplying by 2 squeezes the graph to half its width.

    Reading key features

    • The y-intercept is f(0), where the graph crosses the y-axis.
    • x-intercepts (roots or zeros) are where f(x) = 0.
    • For quadratics and absolute value graphs, the vertex is at (h, k).
    • For exponential and reciprocal graphs, asymptotes are lines the graph approaches but never reaches.
    • The domain is all allowed inputs; the range is all possible outputs.

    Key terms

    Transformation
    A change to a graph’s position, size or orientation: translation (shift), stretch/compression, or reflection.
    Translation
    Sliding a graph without changing its shape.
    Period
    The horizontal length of one complete cycle of a repeating function such as sine.
    Asymptote
    A line that a graph approaches more and more closely.

    Real-world applications

    • Physics: the height of a thrown ball follows a downward-opening parabola; changing launch height is a vertical shift.
    • Biology: unlimited population growth and bacterial doubling are exponential.
    • Sound and electricity: sine waves describe musical notes and alternating current; amplitude is loudness or voltage and period sets pitch or frequency.
    • Chemistry and physics: pressure and volume of a gas at constant temperature follow a reciprocal relationship (Boyle’s law).
    • Data science: fitting a transformed function to measurements is the basis of many scientific models.

    Common misconceptions

    • “(x − 3) shifts left.” It shifts right by 3. Ask: what x makes the inside zero? x = 3.
    • “Multiplying by b = 2 stretches the graph wider.” It compresses it horizontally to half the width.
    • “The graph touches its asymptote eventually.” For 1/x and 2ˣ, it gets arbitrarily close but never reaches it.

    Key takeaways

    • y = a·f(b(x − h)) + k: a and k act vertically, b and h act horizontally.
    • Outside changes behave as expected; inside changes behave in reverse.
    • Negative a reflects across the x-axis; negative b reflects across the y-axis.
    • Key features — intercepts, vertex, asymptotes, period — move predictably with the transformations.

    Knowledge check

    Graphing Functions: test your understanding

    Answer each question to get instant feedback and an explanation. Use the simulator to check your thinking.

    7 questions3 basic3 intermediate1 advanced

    0 of 7 answered

    1. Q1BasicHow does the graph of y = x² + 3 compare with y = x²?
      Show answer

      Answer: B. Shifted 3 units up

      Adding a constant k outside the function moves every point up by k. Set k = 3 to see the vertex move to (0, 3).

    2. Q2BasicWhich equation shifts y = |x| five units to the right?
      Show answer

      Answer: C. y = |x − 5|

      Inside the function, x − h shifts the graph right by h. The minus sign is easy to misread: |x − 5| has its vertex at x = 5, whereas |x + 5| is shifted left.

    3. Q3BasicWhat does a negative value of a do to y = a·f(x)?
      Show answer

      Answer: A. Reflects the graph across the x-axis

      Multiplying every output by a negative number flips the graph upside down — a reflection across the x-axis. A negative b reflects across the y-axis instead.

    4. Q4IntermediateThe graph of y = 3x² compared with y = x² is…
      Show answer

      Answer: B. narrower (steeper)

      Each y-value is tripled, so the parabola rises three times as fast — it looks narrower. A value of a between 0 and 1 would make it wider.

    5. Q5IntermediateWhat is the period of y = sin(2x)?
      Show answer

      Answer: B. π

      A horizontal stretch factor b changes the period from 2π to 2π/|b|. With b = 2 the graph repeats twice as often, so the period is π.

    6. Q6IntermediateWhat is the vertex of y = −2(x + 1)² + 4?
      Show answer

      Answer: B. (−1, 4)

      Writing it as a(x − h)² + k gives h = −1 and k = 4, so the vertex is (−1, 4). Because a is negative, the parabola opens downward and the vertex is a maximum.

    7. Q7AdvancedWhere are the asymptotes of y = 1/(x − 2) + 3?
      Show answer

      Answer: B. x = 2 and y = 3

      The function is undefined where x − 2 = 0, giving a vertical asymptote at x = 2. As x grows very large, 1/(x − 2) approaches 0, so y approaches 3: a horizontal asymptote at y = 3.

    References and further reading

    1. Abramson, J. (2021). Precalculus 2e, Section 1.5: Transformation of Functions. OpenStax. openstax.org (opens in a new tab)
    2. Abramson, J. (2021). Algebra and Trigonometry 2e, Section 3.1: Functions and Function Notation. OpenStax. openstax.org (opens in a new tab)
    3. Abramson, J. (2021). Precalculus 2e, Section 6.1: Graphs of the Sine and Cosine Functions. OpenStax. openstax.org (opens in a new tab)

    This simulator is a simplified educational model. Found an error? Let us know. See our educational disclaimer.