{
  "id": "limit",
  "version": "84661ce56949",
  "status": "published",
  "name": "Limit Calculator",
  "question": "What is the limit of a function?",
  "summary": "Finds the limit of a function at a number or infinity, checked from both sides.",
  "category": "math",
  "subcategory": "calculus",
  "url": "https://www.acalculator.org/math/limit-calculator",
  "markdown": "https://www.acalculator.org/math/limit-calculator.md",
  "kind": "function",
  "method": "A computer algebra system finds the limit; it shows only after f is checked near the point on each side.",
  "assumptions": [
    "The limit is two-sided and finite.",
    "One variable letter (x if none); radians; ln is the natural logarithm.",
    "An answer that fails its check is not shown."
  ],
  "inputs": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "f": {
        "title": "Function f(x)",
        "description": "The function, in one letter.",
        "type": "string",
        "maxLength": 200
      },
      "a": {
        "title": "x approaches",
        "description": "A number, or inf or -inf.",
        "type": "string",
        "maxLength": 40
      }
    }
  },
  "outputs": {
    "limit": {
      "label": "Limit",
      "description": "The limit, written exactly.",
      "format": "math"
    },
    "value": {
      "label": "As a decimal",
      "description": "The limit to 10 significant figures.",
      "format": "number"
    }
  },
  "defaultAnswer": {
    "inputs": {
      "f": "(x^2 - 3x)/(2x^2 - 5x - 3)",
      "a": "3"
    },
    "outputs": {
      "limit": "3/7",
      "value": 0.42857142857142855
    },
    "text": "The limit of (x^2 - 3x)/(2x^2 - 5x - 3) as the variable approaches 3 is 3/7."
  },
  "examples": [
    {
      "given": {
        "f": "(x^2 - 3x)/(2x^2 - 5x - 3)",
        "a": "3"
      },
      "expect": {
        "limit": "3/7",
        "value": 0.42857142857142855
      },
      "source": "OpenStax Calculus Vol. 1, 2.3, Ex. 2.17. https://openstax.org/books/calculus-volume-1/pages/2-3-the-limit-laws"
    },
    {
      "given": {
        "f": "1/x + 5/(x (x - 5))",
        "a": "0"
      },
      "expect": {
        "limit": "-1/5",
        "value": -0.2
      },
      "source": "OpenStax Calculus Vol. 1, 2.3, Ex. 2.20"
    },
    {
      "given": {
        "f": "(3x - 1)/(2x + 5)",
        "a": "inf"
      },
      "expect": {
        "limit": "3/2",
        "value": 1.5
      },
      "source": "OpenStax Calculus Vol. 1, 4.6, Ex. 4.25(a)"
    },
    {
      "given": {
        "f": "(sqrt(x + 2) - 1)/(x + 1)",
        "a": "-1"
      },
      "expect": {
        "limit": "1/2",
        "value": 0.5
      },
      "source": "OpenStax Calculus Vol. 1, 2.3, Ex. 2.18"
    }
  ],
  "sources": [
    "OpenStax, Calculus Volume 1, section 2.3 The Limit Laws: https://openstax.org/books/calculus-volume-1/pages/2-3-the-limit-laws",
    "OpenStax, Calculus Volume 1, section 4.6 Limits at Infinity and Asymptotes: https://openstax.org/books/calculus-volume-1/pages/4-6-limits-at-infinity-and-asymptotes"
  ],
  "related": [
    "derivative",
    "calculus",
    "integral",
    "taylor-series"
  ],
  "changelog": []
}
