2×2 system by substitution
For 2x + y equal to 5 and x − y equal to 1, isolating x gives 2.5 minus 0.5y, and substituting leads to the point (2, 1). The solver shows each step and says when the lines coincide or never meet. Free in your browser.
- Free
- Runs in your browser
- No sign-up
- Your data stays on your device
Run — free
Worked example
- A1
- 2
- B1
- 1
- C1
- 5
- A2
- 1
- B2
- -1
- C2
- 1
- Status
- unique
- Isolated variable
- x
- Isolated from equation
- 1
- Isolated in terms of
- y
A two-equation, two-unknown linear system is the backbone of introductory algebra and of many engineering checks that still reduce to a pair of lines in the plane. The substitution method isolates one variable from one equation, plugs that expression into the other equation, solves the resulting one-variable equation, then back-substitutes to recover the second value. This capability accepts the six coefficients of a1*x + b1*y = c1 and a2*x + b2*y = c2, shows which variable was isolated and from which equation, and returns either the unique solution pair or a clear dependent or inconsistent flag when the lines coincide or never meet.
What the substitution method does
Substitution is one of the three classical hand methods for a 2×2 linear system, alongside elimination and graphing. You choose an equation and a variable whose coefficient is nonzero, solve that equation for the chosen variable as a linear expression in the other variable, replace every occurrence of the chosen variable in the remaining equation, and solve the resulting single linear equation. Once that second variable is known, you plug it back into the isolation expression to obtain the first.
Algebraically the outcome matches Cramer’s rule and Gaussian elimination: when the determinant a1*b2 − a2*b1 is nonzero there is exactly one intersection point; when it is zero the two lines are parallel or identical. In the identical case every point on the line is a solution and textbooks call the system dependent; in the parallel but distinct case there is no solution and the system is inconsistent. Students often lose a sign when isolating, or substitute into the same equation they just solved, or misclassify a zero determinant.
Automating isolation choice, substitution, and classification against validated finite coefficients removes those slips while still exposing the pedagogical artifacts—the isolated variable, the equation it came from, and the isolation expression—so a solution write-up can mirror classroom steps without re-deriving the arithmetic by hand each time.
Where to use it and what it costs
Typical placements include verifying student answers that ask for substitution steps and the final pair, generating solution keys that show which variable was isolated first, teaching dependent versus inconsistent geometry of coincident or parallel lines, and feeding a unique (x, y) into a larger pipeline that already holds the six coefficients from a model or measurement. The browser path runs locally and needs no account.
Keep all six values finite, treat dependent as infinite solutions rather than an error, treat inconsistent as no solution rather than a crash, and prefer the server-computed x and y fields over re-solving with a different floating-point path in client code.
What you can do with it
Dependent vs inconsistent drills
Feed proportional or contradictory coefficient rows and assert status dependent or inconsistent plus the dependent flag for infinite solutions.
FAQ
What does the dependent flag mean?
dependent is true when the two equations represent the same line (infinite solutions). x and y are null; status is "dependent". Parallel distinct lines use status "inconsistent" with dependent false.
Which variable is isolated first?
The engine prefers equation 1 and x when a1 is nonzero, then y from equation 1, then x or y from equation 2.
How does the substitution method work?
Solve one equation for one variable, put that expression into the other equation, solve the single equation that remains, then substitute back. In the example x becomes 2.5 minus 0.5y, and the solution is (2, 1).
What does an inconsistent system mean?
The two lines are parallel and distinct, so they never meet and there is no solution. The solver reports this as a result, not as an error, just as it reports coinciding lines as infinitely many solutions.
Do substitution and elimination give the same answer?
Yes. Substitution, elimination and Cramer's rule always agree: when the determinant is nonzero there is exactly one intersection point, and when it is zero the lines are parallel or identical.
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/algebra/system-2x2-substitution \
-H "Authorization: Bearer $KIT_KEY" \
-H "Content-Type: application/json" \
-d '{"a1":2,"b1":1,"c1":5,"a2":1,"b2":-1,"c2":1}'const res = await fetch("https://api.kit.forhosting.com/algebra/system-2x2-substitution", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.KIT_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
"a1": 2,
"b1": 1,
"c1": 5,
"a2": 1,
"b2": -1,
"c2": 1
})
});
const { task_id } = await res.json();import os, requests
res = requests.post(
"https://api.kit.forhosting.com/algebra/system-2x2-substitution",
headers={"Authorization": f"Bearer {os.environ['KIT_KEY']}"},
json={
"a1": 2,
"b1": 1,
"c1": 5,
"a2": 1,
"b2": -1,
"c2": 1
},
)
task_id = res.json()["task_id"]<?php
$res = file_get_contents("https://api.kit.forhosting.com/algebra/system-2x2-substitution", false, stream_context_create([
"http" => [
"method" => "POST",
"header" => "Authorization: Bearer " . getenv("KIT_KEY") . "\r\nContent-Type: application/json",
"content" => '{"a1":2,"b1":1,"c1":5,"a2":1,"b2":-1,"c2":1}',
],
]));
$task = json_decode($res, true);body := bytes.NewBufferString(`{"a1":2,"b1":1,"c1":5,"a2":1,"b2":-1,"c2":1}`)
req, _ := http.NewRequest("POST", "https://api.kit.forhosting.com/algebra/system-2x2-substitution", body)
req.Header.Set("Authorization", "Bearer "+os.Getenv("KIT_KEY"))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)Example request
{
"a1": 2,
"b1": 1,
"c1": 5,
"a2": 1,
"b2": -1,
"c2": 1
}Example response
{
"task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
"type": "algebra.system_2x2_substitution",
"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
How this capability computes the answer
When status is unique it returns numeric x and y from the equivalent closed form (the substitution result). When status is dependent or inconsistent it still reports the isolation metadata when a nonzero coefficient exists, sets dependent true only for the infinite-solution case, and returns null for x and y. You send a JSON body with six required finite numbers: a1, b1, and c1 for the first equation a1*x + b1*y = c1, and a2, b2, and c2 for the second equation a2*x + b2*y = c2. The engine accepts JSON numbers or plain numeric strings, rejects missing fields, booleans, objects, and non-finite values with invalid_input, and never charges those validation failures. It classifies the system by the coefficient determinant and the consistency minors of the augmented matrix, yielding status unique, dependent, or inconsistent. For isolation it prefers equation 1 and variable x whenever the corresponding coefficient is nonzero, then equation 1 and y, then equation 2 and x, then equation 2 and y—so the same coefficients always produce the same isolated_variable, isolated_from_equation, isolated_in_terms_of, and isolated_expression fields. There is no randomness, no clock, and no network; identical inputs always yield identical JSON. The work is a handful of multiplications and divisions, which sits inside the analytic cost model for this tier-A parse capability priced at $0.002 per successful request.
Where to use it and what it costs
Use the free browser tool for a single homework check or classroom demo, or call the API when a gradebook, tutor script, worksheet generator, or engineering notebook must resolve many 2×2 systems the same way every time. API usage draws from prepaid KIT balance at the published $0.002 base price per successful request; failed validation does not consume balance.
Integration use cases
Homework and exam keys
Confirm a student’s unique solution and isolation choice for a1,b1,c1,a2,b2,c2 against one canonical (x, y) and isolated_expression.
Tutor and gradebook scripts
Batch many 2×2 systems through the API and store method, isolation metadata, and solution fields next to each item id.
Technical questions
How do I solve a 2×2 system by substitution with this API?
POST JSON with finite numbers a1, b1, c1, a2, b2, and c2 for a1*x+b1*y=c1 and a2*x+b2*y=c2. The response includes isolation fields and either unique x,y or a dependent/inconsistent status.
Is the 2×2 substitution calculator free?
The browser widget is free and runs locally. API calls use prepaid KIT balance at the published $0.002 base price; invalid input is not charged.
Is the result always the same for the same coefficients?
Yes. The algorithm is pure analytic math with no randomness or timestamps, so identical inputs produce identical JSON including isolation metadata.