Vertical shift of a function calculator
The vertical shift of a function calculator adds a constant to a function rule and shows exactly what happens to its graph.
Run — free
Runs in your browser. Free, unlimited — your data never leaves this page.
Enter a rule such as f(x) = x^2, choose a positive, negative, or zero shift, and receive the transformed rule in standard notation. The result identifies the direction and distance of the movement, explains how every output changes, and can also move supplied key points. It is useful for checking homework, preparing examples, or applying the same transformation reliably in software.
How to write and apply a vertical shift
A vertical shift changes the output of a function while leaving its input untouched. If the original function is written as f(x), adding a constant k produces the new function g(x) = f(x) + k. Enter the original rule in the function field and put the signed constant in the shift field. A positive value moves the graph upward, while a negative value moves it downward. For example, shifting f(x) = x^2 by 5 gives g(x) = (x^2) + 5. Shifting it by -3 gives g(x) = (x^2) - 3. The calculator keeps the original expression inside parentheses so the added constant clearly applies to the entire output, even when the rule contains several terms. You may enter a bare expression, y followed by an equals sign, or a named rule such as h(x) = sin(x). The returned rule uses g(x) to distinguish the transformed function from the original one and also states the transformation in the familiar form g(x) = f(x) + k.
Why the graph moves up or down
Every point on the graph of a function has coordinates (x, f(x)). After a vertical shift by k, the corresponding point is (x, f(x) + k). The x-coordinate stays exactly the same because the input has not changed. Only the y-coordinate changes, and it changes by the same amount at every point. That uniform change is why the graph keeps its shape: peaks, valleys, intercept patterns, and curvature remain arranged in the same way, but the entire picture occupies a higher or lower position. When k is positive, every output is larger and the graph moves up by k units. When k is negative, every output is smaller and the graph moves down by the absolute value of k. A shift of zero causes no movement. If you provide key points, the calculator applies this coordinate rule directly, returning each original point and its new location so the symbolic rule and the geometric movement can be checked together.
Reading the result and avoiding common mistakes
The result separates the signed shift from the nonnegative distance. This matters because a shift of -4 means down 4 units, not down -4 units. It also reports a direction and a sentence describing the movement, making the sign convention visible instead of leaving it implicit. One common mistake is to alter x inside the formula, such as replacing x with x + 4. That creates a horizontal transformation and follows a different direction convention. For a vertical transformation, the constant belongs outside the original function: f(x) + k. Another mistake is to distribute the shift through individual terms. There is no need to modify each term because the constant changes the final output as a whole. This calculator intentionally preserves the entered expression rather than expanding or simplifying it, which keeps the operation transparent and suitable for functions involving powers, absolute values, trigonometric names, or several terms. Use the optional point mapping when you want a numerical cross-check of the new graph position.
What you can do with it
Check an algebra transformation
Confirm the new function rule and graph direction after adding a positive or negative constant.
Move graphing key points
Transform intercepts, vertices, or sample points with the same vertical coordinate rule.
Generate consistent practice answers
Apply vertical shifts to varied function rules without silently changing the input variable or graph shape.
FAQ
What is a vertical shift of a function?
It is the transformation g(x) = f(x) + k, which changes every output by the same constant k.
Does a positive constant move the graph up or down?
A positive constant moves the graph up by that many units. A negative constant moves it down by its absolute value.
Does a vertical shift change x-coordinates?
No. A point (x, y) becomes (x, y + k), so its x-coordinate remains unchanged.
Will the calculator simplify the transformed expression?
No. It preserves and safely groups the original expression, then adds the shift outside it so the transformation remains explicit.
What happens when the shift is zero?
The function rule and graph position remain unchanged, and the result identifies the direction as unchanged.
What does it cost?
It is free to run in your browser on this page, or $0.002 per API request.
For developers — API access
Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.
API endpoint
Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.
Call it from your stack
curl -X POST https://api.kit.forhosting.com/algebra/function-vertical-shift \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"function":"f(x) = x^2 - 4x + 3","shift":5}'const res = await fetch("https://api.kit.forhosting.com/algebra/function-vertical-shift", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"function": "f(x) = x^2 - 4x + 3",
"shift": 5
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/algebra/function-vertical-shift",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"function": "f(x) = x^2 - 4x + 3",
"shift": 5
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/algebra/function-vertical-shift", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"function":"f(x) = x^2 - 4x + 3","shift":5}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"function":"f(x) = x^2 - 4x + 3","shift":5}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/algebra/function-vertical-shift", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"function": "f(x) = x^2 - 4x + 3",
"shift": 5
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "algebra.function_vertical_shift",
"status": "queued",
"_links": {
"result": "/tasks/tsk_…/result"
}
}The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.
Pricing
Published price — no tokens, no invented credits. A failed task is never charged.
Limits
max_rule_chars | 500 |
max_points | 100 |
Errors
| HTTP | Code | Meaning |
|---|---|---|
401 | unauthorized | Missing or invalid API key. |
402 | insufficient_balance | Your balance doesn't cover the task price. |
404 | unknown_type | That task type doesn't exist. |
429 | rate_limited | Too many requests. Use the webhook instead of polling. |