{"success":true,"version":"v1","request":{"tool":"get_calculator_schema","calculator_id":"linear-system"},"result":{"entity_type":"calculator","id":"linear-system","calculator_id":"linear-system","canonical_url":"https://tttkmbb.com/math/linear-system","name":"System of Linear Equations Solver","title":"System of Linear Equations Solver – 2×2 and 3×3 Systems by Cramer's Rule and Gaussian Elimination","category":"math","category_name":"Math","tool_name":"solve_linear_system","featured_mcp_tool":false,"description":"Solves a system of 2 or 3 linear equations with as many unknowns from its coefficient matrix and constants using Cramer's rule, reports the determinants involved, and uses Gaussian elimination to tell a system with no solution from one with infinitely many.","use_when":"You have 2 or 3 linear equations in 2 or 3 unknowns (x, y, z) with numeric coefficients and need the unique solution or a diagnosis of why there is none.","do_not_use_when":"The system has more than 3 unknowns, is non-linear, or you only need the line through two points (use slope) or a determinant on its own (use matrix-determinant).","inputs":[{"name":"coefficients","label":"Coefficient matrix (row-major)","type":"number_list","required":true,"description":"Coefficients of x, y (and z) equation by equation, 4 values for a 2×2 system or 9 for a 3×3 system. For 2x + y − z = 8 the first row is 2, 1, −1.","example":[2,1,-1,-3,-1,2,-2,1,2]},{"name":"constants","label":"Constants (right-hand side)","type":"number_list","required":true,"description":"The constant term of each equation, in the same order.","example":[8,-11,-3]},{"name":"size","label":"Number of unknowns","type":"integer","required":false,"min":2,"max":3,"description":"2 or 3. Optional: inferred from the number of constants when omitted.","example":3}],"outputs":[{"name":"x","label":"x","type":"number","decimals":6,"description":"Value of the first unknown, D_x / D."},{"name":"y","label":"y","type":"number","decimals":6,"description":"Value of the second unknown, D_y / D."},{"name":"z","label":"z","type":"number","decimals":6,"description":"Value of the third unknown, D_z / D (3×3 systems only)."},{"name":"solution","label":"Solution vector","type":"number_list","decimals":6,"description":"[x, y] or [x, y, z]."},{"name":"solution_text","label":"Solution","type":"string","decimals":4,"description":"The solution written as 'x = …, y = …, z = …'."},{"name":"determinant","label":"Determinant D","type":"number","decimals":6,"description":"Determinant of the coefficient matrix; non-zero for a unique solution."},{"name":"cramer_determinants","label":"Cramer determinants","type":"number_list","decimals":6,"description":"[D_x, D_y, (D_z)]: determinants with the respective column replaced by the constants."}],"input_schema":{"type":"object","properties":{"coefficients":{"description":"Coefficients of x, y (and z) equation by equation, 4 values for a 2×2 system or 9 for a 3×3 system. For 2x + y − z = 8 the first row is 2, 1, −1.","type":"array","items":{"type":"number"},"minItems":4,"examples":[[2,1,-1,-3,-1,2,-2,1,2]]},"constants":{"description":"The constant term of each equation, in the same order.","type":"array","items":{"type":"number"},"minItems":2,"examples":[[8,-11,-3]]},"size":{"description":"2 or 3. Optional: inferred from the number of constants when omitted.","type":"integer","minimum":2,"maximum":3,"examples":[3]}},"additionalProperties":false,"required":["coefficients","constants"]},"output_schema":{"type":"object","properties":{"x":{"description":"Value of the first unknown, D_x / D.","type":"number"},"y":{"description":"Value of the second unknown, D_y / D.","type":"number"},"z":{"description":"Value of the third unknown, D_z / D (3×3 systems only).","type":"number"},"solution":{"description":"[x, y] or [x, y, z].","type":"array","items":{"type":"number"}},"solution_text":{"description":"The solution written as 'x = …, y = …, z = …'.","type":"string"},"determinant":{"description":"Determinant of the coefficient matrix; non-zero for a unique solution.","type":"number"},"cramer_determinants":{"description":"[D_x, D_y, (D_z)]: determinants with the respective column replaced by the constants.","type":"array","items":{"type":"number"}}}},"formula":"D = det(A); D_i = det(A with column i replaced by the constants b); x_i = D_i / D (Cramer's rule). D = 0: rank(A) < rank([A|b]) → no solution, rank(A) = rank([A|b]) < n → infinitely many solutions","sources":[{"name":"Wikipedia – Cramer's rule","url":"https://en.wikipedia.org/wiki/Cramer%27s_rule","type":"reference","retrieved_at":"2026-09-24"},{"name":"Wikipedia – Gaussian elimination","url":"https://en.wikipedia.org/wiki/Gaussian_elimination","type":"reference","retrieved_at":"2026-09-24"},{"name":"Wolfram MathWorld – Cramer's Rule","url":"https://mathworld.wolfram.com/CramersRule.html","type":"reference","retrieved_at":"2026-09-24"}],"freshness":{"type":"static","max_age_seconds":null,"note":"Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output."},"examples":[{"name":"2x + y − z = 8, −3x − y + 2z = −11, −2x + y + 2z = −3","inputs":{"coefficients":[2,1,-1,-3,-1,2,-2,1,2],"constants":[8,-11,-3],"size":3},"expected":{"x":2,"y":3,"z":-1,"solution":[2,3,-1],"solution_text":"x = 2, y = 3, z = -1","determinant":-1,"cramer_determinants":[-2,-3,1]},"url":"https://tttkmbb.com/api/v1/calculate/linear-system?coefficients=2%2C1%2C-1%2C-3%2C-1%2C2%2C-2%2C1%2C2&constants=8%2C-11%2C-3&size=3"},{"name":"x + y = 10, x − y = 2","inputs":{"coefficients":[1,1,1,-1],"constants":[10,2]},"expected":{"x":6,"y":4,"solution":[6,4],"solution_text":"x = 6, y = 4","determinant":-2,"cramer_determinants":[-12,-8]},"url":"https://tttkmbb.com/api/v1/calculate/linear-system?coefficients=1%2C1%2C1%2C-1&constants=10%2C2"}],"faq":[{"q":"How do I enter the equations?","a":"Write each equation as ax + by (+ cz) = k with every unknown present (use 0 for a missing one) and list the coefficients row by row, then the k values in the same order."},{"q":"What does 'no unique solution' mean?","a":"The determinant is 0, so the equations are dependent or contradictory; the error message says whether the system has no solution (inconsistent) or infinitely many."}],"tags":["system of equations","linear system","cramer's rule","gaussian elimination","simultaneous equations","3x3 system"],"related":[{"calculator_id":"matrix-determinant","reason":"The determinant that decides whether the solution is unique."},{"calculator_id":"matrix-inverse","reason":"Solve A·x = b as x = A⁻¹·b."},{"calculator_id":"slope","reason":"A single linear equation through two points."}],"links":{"html":"https://tttkmbb.com/math/linear-system","markdown":"https://tttkmbb.com/math/linear-system.md","json":"https://tttkmbb.com/math/linear-system.json","api":"https://tttkmbb.com/api/v1/calculate/linear-system","schema":"https://tttkmbb.com/api/v1/calculators/linear-system","openapi":"https://tttkmbb.com/openapi.json","mcp":"https://tttkmbb.com/mcp"},"version":"v1","updated_at":"2026-09-24"},"timestamp":"2026-09-24T01:51:38Z","next_actions":[{"tool":"run_calculator","calculator_id":"linear-system","reason":"Run System of Linear Equations Solver with the inputs above."}],"links":{"markdown":"https://tttkmbb.com/math/linear-system.md"}}