{
  "id": "algebra",
  "version": "382a0b249e23",
  "status": "published",
  "name": "Algebra Calculator",
  "question": "How do you solve an algebra equation?",
  "summary": "Solves an algebra equation in one variable and checks every solution.",
  "category": "math",
  "subcategory": "algebra",
  "url": "https://www.acalculator.org/math/algebra-calculator",
  "markdown": "https://www.acalculator.org/math/algebra-calculator.md",
  "kind": "function",
  "method": "A computer algebra system; each root is checked, and a numeric scan finds any missed.",
  "assumptions": [
    "Only real solutions; no answer for sin, cos or tan of the variable."
  ],
  "inputs": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "eq": {
        "title": "Equation",
        "description": "The equation, in one letter.",
        "type": "string",
        "maxLength": 200
      }
    }
  },
  "outputs": {
    "solutions": {
      "label": "Solutions",
      "description": "Every real solution.",
      "format": "text"
    },
    "decimals": {
      "label": "As decimals",
      "description": "Each solution as a decimal.",
      "format": "text"
    },
    "count": {
      "label": "Number of real solutions",
      "description": "How many there are.",
      "format": "integer"
    }
  },
  "defaultAnswer": {
    "inputs": {
      "eq": "4(x - 3) + 12 = 15 - 5(x + 6)"
    },
    "outputs": {
      "solutions": "x = -5/3",
      "decimals": "x ≈ -1.666666667",
      "count": 1
    },
    "text": "Solving 4(x - 3) + 12 = 15 - 5(x + 6) gives x = -5/3."
  },
  "examples": [
    {
      "given": {
        "eq": "4(x - 3) + 12 = 15 - 5(x + 6)"
      },
      "expect": {
        "solutions": "x = -5/3",
        "decimals": "x ≈ -1.666666667",
        "count": 1
      },
      "source": "OpenStax College Algebra 2e, 2.2, Ex. 2. https://openstax.org/books/college-algebra-2e/pages/2-2-linear-equations-in-one-variable"
    },
    {
      "given": {
        "eq": "3/(x - 6) = 5/x"
      },
      "expect": {
        "solutions": "x = 15",
        "count": 1
      },
      "source": "OpenStax College Algebra 2e, 2.2, Ex. 6(a)"
    }
  ],
  "sources": [
    "OpenStax, College Algebra 2e, section 2.2 Linear Equations in One Variable: https://openstax.org/books/college-algebra-2e/pages/2-2-linear-equations-in-one-variable",
    "OpenStax, College Algebra 2e, section 2.5 Quadratic Equations: https://openstax.org/books/college-algebra-2e/pages/2-5-quadratic-equations"
  ],
  "related": [
    "equation-solver",
    "solve-for-x",
    "simplify",
    "factoring",
    "quadratic-formula"
  ],
  "changelog": []
}
