{
  "id": "derivative",
  "version": "e95787b970d9",
  "status": "published",
  "name": "Derivative Calculator",
  "question": "What is the derivative of a function?",
  "summary": "Finds the derivative of a function and its value at a point, checked numerically.",
  "category": "math",
  "subcategory": "calculus",
  "url": "https://www.acalculator.org/math/derivative-calculator",
  "markdown": "https://www.acalculator.org/math/derivative-calculator.md",
  "kind": "function",
  "method": "A computer algebra system differentiates f; the answer shows only when it matches a numeric difference quotient at 20 points.",
  "assumptions": [
    "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
      },
      "at": {
        "title": "Slope at (optional)",
        "description": "A point a for the slope of the tangent line.",
        "type": "string",
        "maxLength": 40
      }
    }
  },
  "outputs": {
    "derivative": {
      "label": "Derivative",
      "description": "The derivative with respect to the letter.",
      "format": "math"
    },
    "slope": {
      "label": "Value at a",
      "description": "The derivative at a.",
      "format": "number"
    }
  },
  "defaultAnswer": {
    "inputs": {
      "f": "(x^2 + 2)(3x^3 - 5x)"
    },
    "outputs": {
      "derivative": "15x^4 + 3x^2 - 10"
    },
    "text": "The derivative of (x^2 + 2)(3x^3 - 5x) is 15x^4 + 3x^2 - 10."
  },
  "examples": [
    {
      "given": {
        "f": "(x^2 + 2)(3x^3 - 5x)"
      },
      "expect": {
        "derivative": "15x^4 + 3x^2 - 10"
      },
      "source": "OpenStax Calculus Vol. 1, 3.3, Ex. 3.24. https://openstax.org/books/calculus-volume-1/pages/3-3-differentiation-rules"
    },
    {
      "given": {
        "f": "x^2 - 4x + 6",
        "at": "1"
      },
      "expect": {
        "derivative": "2x - 4",
        "slope": -2
      },
      "source": "OpenStax Calculus Vol. 1, 3.3, Ex. 3.22"
    },
    {
      "given": {
        "f": "6/x^2"
      },
      "expect": {
        "derivative": "-12/x^3"
      },
      "source": "OpenStax Calculus Vol. 1, 3.3, Ex. 3.27"
    }
  ],
  "sources": [
    "OpenStax, Calculus Volume 1, section 3.3 Differentiation Rules: https://openstax.org/books/calculus-volume-1/pages/3-3-differentiation-rules",
    "OpenStax, Calculus Volume 1, section 3.2 The Derivative as a Function: https://openstax.org/books/calculus-volume-1/pages/3-2-the-derivative-as-a-function"
  ],
  "related": [
    "integral",
    "limit",
    "calculus",
    "taylor-series",
    "slope"
  ],
  "changelog": []
}
