{
  "id": "factoring",
  "version": "191af2d945e1",
  "status": "published",
  "name": "Factoring Calculator",
  "question": "What does factoring a polynomial give?",
  "summary": "Factors a polynomial over the rational numbers, checking the product of the factors.",
  "category": "math",
  "subcategory": "algebra",
  "url": "https://www.acalculator.org/math/factoring-calculator",
  "markdown": "https://www.acalculator.org/math/factoring-calculator.md",
  "kind": "function",
  "method": "A computer algebra system factors over the rationals; the factors show only when their product equals the polynomial at 20 points.",
  "assumptions": [
    "Factors have rational coefficients.",
    "An answer that fails its check is not shown."
  ],
  "inputs": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "p": {
        "title": "Polynomial",
        "description": "The polynomial, in one letter.",
        "type": "string",
        "maxLength": 200
      }
    }
  },
  "outputs": {
    "factored": {
      "label": "Factored form",
      "description": "The polynomial as a product of factors.",
      "format": "math"
    }
  },
  "defaultAnswer": {
    "inputs": {
      "p": "x^2 + 2x - 15"
    },
    "outputs": {
      "factored": "(x - 3) (x + 5)"
    },
    "text": "Factoring x^2 + 2x - 15 gives (x - 3) (x + 5)."
  },
  "examples": [
    {
      "given": {
        "p": "x^2 + 2x - 15"
      },
      "expect": {
        "factored": "(x - 3) (x + 5)"
      },
      "source": "OpenStax College Algebra 2e, 1.5, Ex. 2. https://openstax.org/books/college-algebra-2e/pages/1-5-factoring-polynomials"
    },
    {
      "given": {
        "p": "5x^2 + 7x - 6"
      },
      "expect": {
        "factored": "(5x - 3) (x + 2)"
      },
      "source": "OpenStax College Algebra 2e, 1.5, Ex. 3"
    },
    {
      "given": {
        "p": "8x^3 - 125"
      },
      "expect": {
        "factored": "(2x - 5) (4x^2 + 10x + 25)"
      },
      "source": "OpenStax College Algebra 2e, 1.5, Ex. 7"
    }
  ],
  "sources": [
    "OpenStax, College Algebra 2e, section 1.5 Factoring Polynomials: https://openstax.org/books/college-algebra-2e/pages/1-5-factoring-polynomials",
    "OpenStax, Intermediate Algebra 2e, section 6.4 General Strategy for Factoring Polynomials: https://openstax.org/books/intermediate-algebra-2e/pages/6-4-general-strategy-for-factoring-polynomials"
  ],
  "related": [
    "simplify",
    "equation-solver",
    "factor",
    "partial-fraction",
    "quadratic-formula"
  ],
  "changelog": []
}
