Direct Variation Calculator
Two quantities vary directly when one is always the same multiple of the other, so the whole relationship fits in one short equation: y = kx. This calculator solves that equation in every direction, finds the constant of variation k from a known pair, checks whether two data points really belong to the same variation, and solves proportions of the form a/b = c/d.
Pick a solve mode, enter what you know, and the tool returns the missing value with the full equation, the substitution steps, and a graph of the line through the origin.
The pre-filled values tell one story in every mode: a fare of $3 per mile. Find y gives the $18 cost of 6 miles, Find k recovers the $3 rate from the pair (6, 18), and the two point mode confirms (6, 18) and (10, 30) share the same ratio.
Quick Answer
Key takeaways
- Direct variation is one equation, y = kx, and one test: the ratio y/x is the same for every pair. If the ratio moves, the relationship is not a direct variation, whatever the graph looks like at a glance.
- Five modes cover the whole topic in one tool: find y, find x, find k, a two point check that confirms or rejects a dataset, and a proportion solver with a cross-product check.
- Every result shows its substitution steps and, outside proportion mode, a graph with your points plotted on the line, so a wrong mode or a mistyped value is visible immediately.
- Zero is handled honestly: the tool explains why k = y/x is undefined at x = 0 instead of printing infinity or crashing.
- Quick Answer
- How to use this calculator
- The direct variation formulas
- Worked example: one fare, five modes
- Checking whether data really varies directly
- Where direct variation shows up
- Direct variation or inverse variation?
- What competing calculators miss
- Frequently Asked Questions
- Add This Calculator to Your Website
- References
How to use this calculator
Pick the mode that matches your unknown. Find y when you know the rate k and an x. Find x when you know k and the y you want to reach. Find k when you have one matched pair and need the rate itself.
Enter the values the mode asks for. The form only shows the fields that mode uses, and each label carries a short help note. In two point mode, enter two matched pairs; in proportion mode, enter three terms and leave the unknown blank.
Click Calculate and read all three lines. The headline is the answer, the second line is the full equation, and the third shows the substitution that produced it, so you can copy the working into homework or a report as it stands.
Check the verdict and the graph. The badge under the result confirms a clean direct variation or warns that your points disagree. On the graph, your points should sit exactly on the line through the origin; a point off the line is the one to re-measure.
The direct variation formulas
The definition used here is the standard textbook one: as OpenStax Elementary Algebra puts it in its variation section, y varies directly with x when y = kx for a nonzero constant k, called the constant of variation. The same constant appears in middle school work under a second name, the constant of proportionality, and this site keeps a dedicated constant of proportionality calculator for problems stated in that language; the math is identical, only the label changes.
Two consequences of the formula do most of the diagnostic work. First, the graph is always a straight line through the origin, because x = 0 forces y = 0. Second, scaling behaves perfectly: double x and y doubles, halve x and y halves. A relationship that fails either test, such as a taxi fare with a fixed pickup charge added to a per mile rate, is linear but not a direct variation, because the fixed charge breaks the constant ratio.
Worked example: one fare, five modes
A rideshare charges a flat $3 per mile with no pickup fee, so cost varies directly with distance and k = 3. The calculator is pre-filled with this story, and every row below is a result the tool itself returns for these inputs.
| Mode | Inputs | Tool output | Working |
|---|---|---|---|
| Find k | x = 6, y = 18 | k = 3, equation y = 3x | k = y / x = 18 / 6 = 3 |
| Find y | k = 3, x = 6 | y = 18 | y = k × x = 3 × 6 = 18 |
| Find y (predict) | k = 3, x = 10 | y = 30 | y = 3 × 10 = 30, the 10 mile fare |
| Find x | k = 3, y = 30 | x = 10 | x = y / k = 30 / 3 = 10 |
| Two points | (6, 18) and (10, 30) | k = 3, points agree | k1 = 18 / 6 = 3; k2 = 30 / 10 = 3 |
| Proportion | 3/4 = c/20 | c = 15 | c = 3 × 20 / 4 = 15; check 3 × 20 = 60 and 4 × 15 = 60 |
Notice how the modes chain together in real work. One known trip (6 miles, $18) is enough to find k. That k then predicts any other trip in Find y mode, and Find x answers the budget question in reverse: a $30 budget buys exactly 10 miles. The two point mode exists for the moment a second receipt arrives and you want to know whether the rate really held.
Checking whether data really varies directly
Textbook problems hand you clean data. Measured data is rarely clean, so the useful skill is testing a dataset before trusting the equation. The test is mechanical: divide y by x for every row and compare.
| Items (x) | Price (y) | Ratio y/x | Verdict |
|---|---|---|---|
| 3 | $7.50 | 2.50 | Matches |
| 5 | $12.50 | 2.50 | Matches |
| 8 | $20.00 | 2.50 | Matches |
| 6 | $19.00 | 3.17 | Breaks the pattern |
The first three rows describe a clean direct variation at $2.50 per item. The fourth row does not belong to it: $19 for 6 items implies a rate of about $3.17, far outside rounding error. In the two point mode the tool says this plainly, with a warning badge, and shows both ratios so you can see which point disagrees. One honest disclosure about that mode: when the points disagree, the headline k it prints is the average of the two ratios, shown only as a rough midpoint. Treat a mismatch as a stop sign, not as a usable rate: re-check the odd row first, because averaging a typo into your equation just spreads the error.
Where direct variation shows up
The same y = kx shape hides inside a long list of named laws and everyday rates, which is why this one equation gets a full calculator. Unit pricing is the everyday case: total cost is the per unit price times quantity. Hooke's law in physics, F = kx, says spring force varies directly with stretch, with the spring constant as k. Ohm's law, V = IR, says voltage varies directly with current at a fixed resistance. Distance at a steady speed, d = vt, is direct variation with speed as the constant. Even density works this way at a fixed material: mass varies directly with volume, and the constant is the density itself, which the density calculator works with from the other direction. Percent problems belong to the family too: a discount is a proportion between the sale price and the original price, the territory of the discount percent calculator, and the proportion mode above solves the same equations in raw a/b = c/d form.
Direct variation or inverse variation?
Direct: y = kx
The values move together. Double x and y doubles. The constant k is a ratio, y per unit of x: $3 per mile, 2.50 dollars per item. Graph: a straight line through the origin, rising for positive k.
Inverse: y = k/x
The values move against each other. Double x and y halves. The constant k is a product, x × y, that stays fixed: more workers on a fixed job means fewer hours each. Graph: a curve that never touches either axis.
The fastest field test is the doubling question. If doubling one value doubles the other, you are looking at direct variation. If doubling one halves the other, it is inverse. If neither happens, the relationship may still be useful, but it is not a variation of either simple kind, and forcing it into y = kx will give you a k that quietly changes from row to row. Lesson videos such as Khan Academy's introduction to direct and inverse variation use the same doubling test, because it needs no algebra at all.
What competing calculators miss
The direct variation tools ranking for this term are mostly built around a single move: enter two values, get the third. Three gaps kept appearing across that set, and this page was built to close them.
Gap 1: no way to test a dataset. The large generalist tools solve for y from x and k and draw a nice graph, but they never ask whether your data actually varies directly. If your two receipts imply different rates, a solver that assumes the relationship will still hand you a confident answer. The two point mode here compares both ratios first and warns you when they disagree.
Gap 2: proportions treated as a different topic. Most ranking tools stop at three modes (find k, find x, find y) and leave the classic textbook form, a/b = c/d, to a separate page or to hand algebra. But a proportion is the same relationship wearing fractions, so the proportion solver lives in this tool, with the cross-product equality printed as a check rather than left as an exercise.
Gap 3: silent failures at zero. Simple tools tend to print Infinity, NaN, or a blank when x or k is zero. Those cases have real meanings: k = y/x is undefined at x = 0 because a true direct variation pins (0, 0) as a point, not a rate. This calculator names the specific problem in plain words for each zero case, which matters when a student is learning the concept rather than just harvesting an answer.
Frequently Asked Questions
Direct variation is a relationship where y is always the same multiple of x, written y = kx. The ratio y/x never changes, doubling x doubles y, and the graph is a straight line through the origin. The constant k is the multiplier that ties the two values together.
Divide y by x for any known pair: k = y/x. If y is 18 when x is 6, then k = 18/6 = 3 and the equation is y = 3x. Every other pair from the same relationship gives the same 3, which is the quickest check that the relationship really is a direct variation.
Negative, yes: y = -2x is a direct variation where y falls as x rises, and the line slopes downward through the origin. Zero is the edge case: k = 0 makes y = 0 for every x, and solving for x would divide by k, so the calculator blocks that case with an explanation instead of an error code.
Because y = kx gives y = 0 when x = 0, so the point (0, 0) is always on the line. A line such as y = 3x + 2 is straight and useful, but it is not a direct variation: its ratio y/x changes from point to point, and it crosses the y axis at 2 instead of at the origin.
Work out y/x for every row. If every row gives the same ratio, the data varies directly and that ratio is k. Prices of $7.50, $12.50, and $20.00 for 3, 5, and 8 items all give k = 2.50. One row that breaks the pattern, such as $19 for 6 items (a ratio of about 3.17), means a typo, a measurement error, or a relationship that is not proportional.
In direct variation, y = kx, the two values move together: doubling x doubles y. In inverse variation, y = k/x, they move against each other: doubling x halves y. The constant means something different in each: in direct variation k is a ratio (y per unit of x), while in inverse variation k is a product (x times y stays fixed).
Cross-multiply and divide: c = 3 x 20 / 4 = 15. Then check the cross-products: 3 x 20 = 60 and 4 x 15 = 60, so the proportion balances. The proportion solver mode does this for any one missing term in a/b = c/d; leave the unknown blank and enter the other three.
Add This Calculator to Your Website
References
- OpenStax, Rice University, Elementary Algebra, Section 8.9, "Use Direct and Inverse Variation" - the textbook definition of direct variation, the constant of variation, and the standard solve-from-one-pair method used by this calculator. OpenStax: Use Direct and Inverse Variation. Accessed October 2026.
- Khan Academy, "Intro to direct and inverse variation" - a worked lesson contrasting y = kx with y = k/x, including negative constants and the scaling behavior of each form. Khan Academy: Intro to Direct and Inverse Variation. Accessed October 2026.
- Khan Academy, "Constant of proportionality from equation" - how to read k out of an equation once it is written in y = kx form, the naming used in proportional relationships courses. Khan Academy: Constant of Proportionality from Equation. Accessed October 2026.
- Third Space Learning, "Direct Variation Equation: Math Steps, Examples and Questions" - a step-by-step school guide covering k from a graph, from a table, and from a single pair of values. Third Space Learning: Direct Variation Equation. Accessed October 2026.
