{
  "id": "simplify",
  "version": "02ed42f3894e",
  "status": "published",
  "name": "Simplify Calculator",
  "question": "How do you simplify an expression?",
  "summary": "Simplifies an expression, checking the result equals it at 20 points.",
  "category": "math",
  "subcategory": "algebra",
  "url": "https://www.acalculator.org/math/simplify-calculator",
  "markdown": "https://www.acalculator.org/math/simplify-calculator.md",
  "kind": "function",
  "method": "A computer algebra system rewrites the expression; the result shows only when it equals the expression at 20 points.",
  "assumptions": [
    "The result equals the expression wherever both are defined.",
    "An answer that fails its check is not shown."
  ],
  "inputs": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "expr": {
        "title": "Expression",
        "description": "The expression, in one letter.",
        "type": "string",
        "maxLength": 200
      }
    }
  },
  "outputs": {
    "simplified": {
      "label": "Simplified",
      "description": "An equal, simpler expression.",
      "format": "math"
    }
  },
  "defaultAnswer": {
    "inputs": {
      "expr": "(x^2 - 9)/(x^2 + 4x + 3)"
    },
    "outputs": {
      "simplified": "(x - 3)/(x + 1)"
    },
    "text": "(x^2 - 9)/(x^2 + 4x + 3) simplifies to (x - 3)/(x + 1)."
  },
  "examples": [
    {
      "given": {
        "expr": "(x^2 - 9)/(x^2 + 4x + 3)"
      },
      "expect": {
        "simplified": "(x - 3)/(x + 1)"
      },
      "source": "OpenStax College Algebra 2e, 1.6, Ex. 1. https://openstax.org/books/college-algebra-2e/pages/1-6-rational-expressions"
    },
    {
      "given": {
        "expr": "6/(x^2 + 4x + 4) - 2/(x^2 - 4)"
      },
      "expect": {
        "simplified": "4 (x - 4)/((x - 2) (x + 2)^2)"
      },
      "source": "OpenStax College Algebra 2e, 1.6, Ex. 5"
    },
    {
      "given": {
        "expr": "sin(x)^2 + cos(x)^2"
      },
      "expect": {
        "simplified": "1"
      },
      "source": "the Pythagorean identity sin²x + cos²x = 1, OpenStax, Precalculus 2e, section 7.1"
    }
  ],
  "sources": [
    "OpenStax, College Algebra 2e, section 1.6 Rational Expressions: https://openstax.org/books/college-algebra-2e/pages/1-6-rational-expressions",
    "OpenStax, Precalculus 2e, section 7.1 Solving Trigonometric Equations with Identities: https://openstax.org/books/precalculus-2e/pages/7-1-solving-trigonometric-equations-with-identities"
  ],
  "related": [
    "factoring",
    "math",
    "algebra",
    "partial-fraction",
    "fraction"
  ],
  "changelog": []
}
