{
  "id": "difference-quotient",
  "version": "63dfcfe2f893",
  "status": "published",
  "name": "Difference Quotient Calculator",
  "question": "What is the difference quotient of f?",
  "summary": "Finds and simplifies the difference quotient (f(x + h) − f(x))/h of a function, and its limit f′(x) as h → 0.",
  "category": "math",
  "subcategory": "calculus",
  "url": "https://www.acalculator.org/math/difference-quotient-calculator",
  "markdown": "https://www.acalculator.org/math/difference-quotient-calculator.md",
  "kind": "function",
  "method": "(f(x + h) − f(x))/h, with f(x + h) − f(x) written as one fraction and its top expanded so the h cancels.",
  "assumptions": [
    "h ≠ 0. The variable is x; angles in radians.",
    "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 of x.",
        "type": "string",
        "maxLength": 150
      }
    }
  },
  "outputs": {
    "quotient": {
      "label": "(f(x + h) − f(x))/h =",
      "description": "The difference quotient, simplified where the h in the bottom cancels.",
      "format": "text"
    },
    "expanded": {
      "label": "f(x + h) =",
      "description": "f with x replaced by x + h.",
      "format": "math"
    },
    "derivative": {
      "label": "f′(x) =",
      "description": "The limit of the quotient as h → 0.",
      "format": "math"
    }
  },
  "defaultAnswer": {
    "inputs": {
      "f": "x^2 + 3x - 4"
    },
    "outputs": {
      "quotient": "h + 2x + 3",
      "expanded": "(x + h)^2 + 3 (x + h) - 4",
      "derivative": "2x + 3"
    },
    "text": "The difference quotient of x^2 + 3x - 4 is h + 2x + 3."
  },
  "examples": [
    {
      "given": {
        "f": "x^2 + 3x - 4"
      },
      "expect": {
        "quotient": "h + 2x + 3",
        "derivative": "2x + 3"
      },
      "source": "OpenStax, College Algebra 2e, section 3.1 Functions and Function Notation, Example 6(d): 2a + h + 3 (with a for x); https://openstax.org/books/college-algebra-2e/pages/3-1-functions-and-function-notation"
    },
    {
      "given": {
        "f": "1/x"
      },
      "expect": {
        "quotient": "-1/(x (h + x))",
        "derivative": "-1/x^2"
      },
      "source": "OpenStax, Calculus Volume 1, section 3.1 Defining the Derivative, Example 3.3 (f(x) = 1/x)"
    },
    {
      "given": {
        "f": "3x^2 - 4x + 1"
      },
      "expect": {
        "quotient": "3h + 6x - 4",
        "derivative": "6x - 4"
      },
      "source": "OpenStax, Calculus Volume 1, section 3.1, Examples 3.5 and 3.6 (f′(2) = 8); by hand in content.mdx"
    }
  ],
  "sources": [
    "OpenStax, College Algebra 2e, section 3.1 Functions and Function Notation (retrieved 2026-10-03): https://openstax.org/books/college-algebra-2e/pages/3-1-functions-and-function-notation",
    "OpenStax, Calculus Volume 1, section 3.1 Defining the Derivative (retrieved 2026-10-03): https://openstax.org/books/calculus-volume-1/pages/3-1-defining-the-derivative"
  ],
  "related": [
    "derivative",
    "average-rate-of-change",
    "limit",
    "tangent-line"
  ],
  "changelog": []
}
