Elimination method
2x + 3y = 7 and 4x − 5y = 1 meet at x ≈ 1.7272727273 and y ≈ 1.1818181818. Enter the six coefficients of two linear equations and get the solution with every elimination step written out. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- A11
- 2
- A12
- 3
- A21
- 4
- A22
- -5
- B1
- 7
- B2
- 1
- X
- 1.7272727273
- Y
- 1.1818181818
You send the six coefficients, and you get back the x and y solution together with every elimination step, so the result is not just an answer but a worked solution. Systems with no unique solution are reported honestly instead of returning a misleading number.
What the elimination method does
A system of two linear equations describes two straight lines, and solving it means finding the single point where they cross. The elimination method reaches that point by combining the two equations so that one variable disappears. You scale the first equation by the ratio of the x coefficients and subtract it from the second, which leaves a one-variable equation in y alone.
Solving that gives y, and substituting y back into either original equation gives x. Because the computation is fully deterministic, the same coefficients always produce the same answer, which makes it safe to embed in homework checkers, tutoring tools, and validation pipelines that need reproducible results rather than approximations that drift between runs.
Steps, not just an answer
Anyone can check a final answer, but learning — and auditing — needs the working. Alongside x and y, the response includes a steps array that narrates the elimination in plain language: the system as given, any row swap needed when the leading x coefficient is zero, the scaling factor used to eliminate x, the reduced one-variable equation, and the back-substitution that recovers x. Each step is generated from the actual arithmetic, never templated from the inputs alone, so the narrative always matches the numbers.
The response also echoes both equations in normalized form, which lets a caller confirm that the coefficients were interpreted in the intended order before trusting the solution.
When there is no unique solution
Not every pair of equations crosses at a single point. If the two lines are parallel, there is no solution at all; if they are the same line written twice, there are infinitely many. Both cases share one fingerprint: the determinant of the coefficient matrix, a11·a22 − a12·a21, is zero.
Invalid calls are never billed, so probing edge cases costs nothing.
What you can do with it
Homework and tutoring tools
Return a full worked solution with each elimination step, so students see the procedure and not just the answer.
Answer keys and automated grading
Generate a deterministic reference solution and intermediate steps to compare a student's work against.
FAQ
What input does it expect?
Six numbers: a11, a12 and b1 for the first equation a11·x + a12·y = b1, and a21, a22 and b2 for the second.
Does it show the working?
Yes. The response includes a steps array describing each elimination operation, the reduced equation in y, and the back-substitution for x.
Is the result deterministic?
Yes. The same six coefficients always produce the same output, byte for byte, with no randomness, clock or network involved.
Which method variant is used?
Row scaling and subtraction — multiply the first equation by the ratio of the x coefficients, subtract it from the second, solve for y, then back-substitute. Rows are swapped automatically if the leading x coefficient is zero.
What if the two equations have no single solution?
Then the determinant of the coefficients is zero: the lines are parallel and never meet, or they are the same line written twice. You get a plain message saying so instead of a misleading number.
Related tools
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/math/elimination-method \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"a11":2,"a12":3,"a21":4,"a22":-5,"b1":7,"b2":1}'const res = await fetch("https://api.kit.forhosting.com/math/elimination-method", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"a11": 2,
"a12": 3,
"a21": 4,
"a22": -5,
"b1": 7,
"b2": 1
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/math/elimination-method",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"a11": 2,
"a12": 3,
"a21": 4,
"a22": -5,
"b1": 7,
"b2": 1
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/math/elimination-method", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"a11":2,"a12":3,"a21":4,"a22":-5,"b1":7,"b2":1}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"a11":2,"a12":3,"a21":4,"a22":-5,"b1":7,"b2":1}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/math/elimination-method", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"a11": 2,
"a12": 3,
"a21": 4,
"a22": -5,
"b1": 7,
"b2": 1
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "math.elimination_method",
"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.
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. |
Technical notes
The elimination method API solves a system of two linear equations in two variables — the classic a11·x + a12·y = b1 and a21·x + a22·y = b2 — by eliminating one variable and back-substituting to find the other.
What the elimination method does
This endpoint performs exactly that procedure on the six coefficients you provide — a11, a12, b1 for the first equation and a21, a22, b2 for the second — and returns the solution as JSON.
Steps, not just an answer
For classroom software this means you can show a complete worked example from a single API call; for automated grading it means you can compare a student's intermediate work against a reference procedure instead of only checking the final values.
When there is no unique solution
This endpoint computes that determinant first and, when it vanishes, rejects the request with an invalid_input error that says plainly there is no unique solution, instead of dividing by zero and returning infinity or NaN. That behaviour matters downstream: a tutoring app can branch to a proper explanation of dependent and inconsistent systems, and a pipeline can fail fast rather than propagate a meaningless number into a report. The same code runs free in your browser on this page, and the API costs $0.002 per request when you automate it.
Integration use cases
Input validation in pipelines
Detect singular or dependent systems up front through a clear invalid_input error instead of silent NaN values.
Technical questions
What does it cost?
$0.002 per request. It is also free to run in your browser on this page, and calls that fail validation are never billed.
What happens if the system has no unique solution?
The request is rejected with an invalid_input error explaining that the system is singular or dependent. No x or y values are returned.