{
  "id": "solve-for-x",
  "version": "a3ab6bec4866",
  "status": "published",
  "name": "Solve for X Calculator",
  "question": "How do you solve for x?",
  "summary": "Finds every real x that makes an equation true, and checks each one.",
  "category": "math",
  "subcategory": "algebra",
  "url": "https://www.acalculator.org/math/solve-for-x-calculator",
  "markdown": "https://www.acalculator.org/math/solve-for-x-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": "2x + 7 = 19"
    },
    "outputs": {
      "solutions": "x = 6",
      "count": 1
    },
    "text": "Solving 2x + 7 = 19 gives x = 6."
  },
  "examples": [
    {
      "given": {
        "eq": "2x + 7 = 19"
      },
      "expect": {
        "solutions": "x = 6",
        "count": 1
      },
      "source": "OpenStax College Algebra 2e, 2.2, Ex. 1. https://openstax.org/books/college-algebra-2e/pages/2-2-linear-equations-in-one-variable"
    },
    {
      "given": {
        "eq": "7/(2x) - 5/(3x) = 22/3"
      },
      "expect": {
        "solutions": "x = 1/4",
        "decimals": "x ≈ 0.25",
        "count": 1
      },
      "source": "OpenStax College Algebra 2e, 2.2, Ex. 3"
    }
  ],
  "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": [
    "algebra",
    "equation-solver",
    "quadratic-formula",
    "math"
  ],
  "changelog": []
}
