{
  "id": "asymptote",
  "version": "4a9c49a2c12c",
  "status": "published",
  "name": "Asymptote Calculator",
  "question": "What are the asymptotes of f(x)?",
  "summary": "Finds the asymptotes and holes of a rational function.",
  "category": "math",
  "subcategory": "algebra",
  "url": "https://www.acalculator.org/math/asymptote-calculator",
  "markdown": "https://www.acalculator.org/math/asymptote-calculator.md",
  "kind": "function",
  "method": "Vertical: zeros of the denominator where f grows without bound.",
  "assumptions": [
    "Zeros searched for in ±10^6."
  ],
  "inputs": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "f": {
        "title": "Function f(x)",
        "description": "A rational function of x.",
        "type": "string",
        "maxLength": 200
      }
    }
  },
  "outputs": {
    "vertical": {
      "label": "Vertical asymptotes x =",
      "description": "Where f → ±∞.",
      "format": "text"
    },
    "other": {
      "label": "Horizontal or slant asymptote y =",
      "description": "The line f nears at ±∞.",
      "format": "text"
    },
    "holes": {
      "label": "Holes at x =",
      "description": "Where f is undefined.",
      "format": "text"
    }
  },
  "defaultAnswer": {
    "inputs": {
      "f": "(x^2 - 4x + 1)/(x + 2)"
    },
    "outputs": {
      "vertical": "-2",
      "other": "x - 6 (slant)",
      "holes": "none"
    },
    "text": "The vertical asymptotes of (x^2 - 4x + 1)/(x + 2) are x = -2."
  },
  "examples": [
    {
      "given": {
        "f": "(x^2 - 4x + 1)/(x + 2)"
      },
      "expect": {
        "vertical": "-2",
        "other": "x - 6 (slant)",
        "holes": "none"
      },
      "source": "OpenStax (Abramson, 2021), College Algebra 2e, section 5.6 Rational Functions, Example 7(b)"
    },
    {
      "given": {
        "f": "(x - 2)/(x^2 - 4)"
      },
      "expect": {
        "vertical": "-2",
        "other": "0 (horizontal)",
        "holes": "2"
      },
      "source": "OpenStax (Abramson, 2021), College Algebra 2e, section 5.6 Rational Functions, Example 6"
    }
  ],
  "sources": [
    "OpenStax, College Algebra 2e, section 5.6 Rational Functions: https://openstax.org/books/college-algebra-2e/pages/5-6-rational-functions"
  ],
  "related": [
    "end-behavior",
    "lhopitals-rule",
    "quadratic-formula"
  ],
  "changelog": []
}
