{
  "id": "directional-derivative",
  "title": "Directional Derivative",
  "lang": "en",
  "source_lang": "en",
  "summary": "A directional derivative measures a function’s instantaneous rate of change at a point along a specified direction.",
  "category": "mathematics",
  "subcategory": "analysis",
  "type": "concept",
  "aliases": [
    "Derivative in a direction"
  ],
  "generated_at": "2026-10-04",
  "model": "pro/gpt-6.1-sol",
  "url": "https://aiwiki.page/en/directional-derivative/",
  "translations": {
    "zh-Hans": {
      "url": "https://aiwiki.page/zh/directional-derivative/",
      "json": "https://aiwiki.page/zh/directional-derivative.json"
    }
  },
  "sections": [
    {
      "heading": "",
      "text": "A directional derivative measures how a function changes at a particular point when its input moves along a specified direction. In multivariable calculus, it extends the ordinary derivative by restricting a function to a line through that point. For a real-valued function, the result is a scalar rate of change; when the direction vector has unit length, it measures change per unit distance. Coordinate-axis directions give the familiar partial derivatives. (ocw.mit.edu)"
    },
    {
      "heading": "Definition and conventions",
      "text": "Let \\(f:U\\to\\mathbb R\\), where \\(U\\) is an open subset of Euclidean space \\(\\mathbb R^n\\). At a point \\(a\\in U\\), the directional derivative along a vector \\(v\\) is the limit\n\n\\[D_vf(a)=\\lim_{t\\to0}\\frac{f(a+tv)-f(a)}{t},\\]\n\nprovided it exists as a finite number. Equivalently, defining \\(g(t)=f(a+tv)\\) reduces the question to whether the single-variable derivative \\(g'(0)\\) exists. Only values on this particular line enter the definition. (math.ucdavis.edu)\n\nTwo conventions are common. Elementary geometric treatments usually require a unit vector \\(u\\), so the parameter represents signed distance. More general treatments allow arbitrary vectors, with their lengths specifying the speed of the parametrization. For nonzero \\(v\\), writing \\(u=v/\\|v\\|\\) gives\n\n\\[D_vf(a)=\\|v\\|D_uf(a)\\]\n\nwhenever either derivative exists. Thus normalization changes the numerical rate, although not the direction of travel. Here \\(\\|v\\|\\) denotes the Euclidean norm. (ocw.mit.edu)"
    },
    {
      "heading": "Relation to differentiability and the gradient",
      "text": "If \\(f\\) is differentiable at \\(a\\), it has a first-order approximation\n\n\\[f(a+h)=f(a)+Df(a)[h]+o(\\|h\\|),\\]\n\nwhere \\(Df(a)\\) is a linear map. Substituting \\(h=tv\\) shows that \\(D_vf(a)=Df(a)[v]\\). For scalar-valued functions, the gradient represents this map through the Euclidean inner product:\n\n\\[D_vf(a)=\\nabla f(a)\\cdot v =\\sum_{i=1}^{n}\\frac{\\partial f}{\\partial x_i}(a)v_i.\\]\n\nIn particular, choosing a standard coordinate vector recovers the corresponding partial derivative. Differentiability is essential to this general formula: the mere existence of coordinate partial derivatives does not establish a linear approximation valid in all directions. (ocw.mit.edu)\n\nThe formula also follows from the chain rule. More generally, if a differentiable curve \\(\\gamma\\) satisfies \\(\\gamma(0)=a\\), then\n\n\\[\\frac{d}{dt}f(\\gamma(t))\\bigg|_{t=0} =\\nabla f(a)\\cdot\\gamma'(0).\\]\n\nThus the instantaneous change along a curved path depends on its velocity at the point, rather than its subsequent course. (ocw.mit.edu)"
    },
    {
      "heading": "Geometric interpretation and example",
      "text": "For a function of two variables, restricting its graph to a vertical plane in direction \\(u\\) produces a cross-sectional curve. The directional derivative is that curve’s tangent slope. When \\(\\nabla f(a)\\ne0\\), the largest directional derivative over unit vectors is \\(\\|\\nabla f(a)\\|\\), attained in the gradient’s direction; the smallest is its negative, attained in the opposite direction. Directions perpendicular to the gradient give zero first-order change. These directions are tangent to regular level curves or level surfaces. (ocw.mit.edu)\n\nFor example, consider the polynomial\n\n\\[f(x,y)=x^2+3y^2.\\]\n\nAt \\(a=(1,2)\\), its gradient is \\((2,12)\\). Along the unit vector \\(u=(3/5,4/5)\\), direct substitution into the gradient formula gives\n\n\\[D_uf(1,2)=2\\frac35+12\\frac45=\\frac{54}{5}.\\]\n\nAlong the unnormalized vector \\(v=(3,4)\\), the derivative is \\(54\\). The fivefold difference reflects the fivefold speed of \\(a+tv\\) compared with \\(a+tu\\). This calculation illustrates the distinction between rate per unit distance and rate per parameter increment. (ocw.mit.edu)"
    },
    {
      "heading": "Directional derivatives without differentiability",
      "text": "Existence of directional derivatives in every direction does not imply differentiability, or even continuity. A counterexample is\n\n\\[f(x,y)= \\begin{cases} \\dfrac{xy^3}{x^2+y^6},&(x,y)\\ne(0,0),\\\\ 0,&(x,y)=(0,0). \\end{cases}\\]\n\nFor a fixed direction \\(v=(p,q)\\) with \\(p\\ne0\\),\n\n\\[\\frac{f(tp,tq)}{t} =\\frac{tpq^3}{p^2+t^4q^6}\\longrightarrow0.\\]\n\nIf \\(p=0\\), the quotient is identically zero. Hence every directional derivative at the origin vanishes. Nevertheless, along the curved path \\((x,y)=(s^3,s)\\), the function equals \\(1/2\\) for \\(s\\ne0\\), so it is not a continuous function at the origin. Direction-by-direction limits therefore need not describe behavior throughout a neighborhood. (math.ucdavis.edu)"
    },
    {
      "heading": "Optimization and computation",
      "text": "In mathematical optimization, a negative directional derivative of a differentiable objective function guarantees decrease for sufficiently small positive steps along that vector. This underlies gradient descent: when the gradient is nonzero,\n\n\\[D_{-\\nabla f(a)}f(a)=-\\|\\nabla f(a)\\|^2<0.\\]\n\nA line search chooses the step length separately; local derivative information alone does not determine how far a step should go. (cs.cornell.edu)\n\nFor a differentiable vector-valued function \\(F:\\mathbb R^n\\to\\mathbb R^m\\), the corresponding derivative is\n\n\\[D_vF(a)=J_F(a)v,\\]\n\nwhere \\(J_F(a)\\) is its Jacobian matrix. Forward-mode automatic differentiation computes such Jacobian–vector products by propagating directional changes through successive operations. This permits evaluation of a specified directional response without explicitly constructing the entire Jacobian, including in calculations involving machine-learning models. (docs.jax.dev)"
    }
  ],
  "links": [
    "mathematical-function",
    "calculus",
    "derivative",
    "partial-derivative",
    "open-set",
    "euclidean-space",
    "limit",
    "norm-mathematics",
    "differentiable-function",
    "linear-map",
    "gradient",
    "inner-product",
    "chain-rule",
    "polynomial",
    "continuous-function",
    "mathematical-optimization",
    "objective-function",
    "gradient-descent",
    "line-search",
    "jacobian-matrix",
    "automatic-differentiation",
    "machine-learning"
  ],
  "sources": [
    {
      "title": "ocw.mit.edu/ans7870/18/18.013a/textbook/chapter06/section04.html",
      "url": "https://ocw.mit.edu/ans7870/18/18.013a/textbook/chapter06/section04.html"
    },
    {
      "title": "math.ucdavis.edu/~hunter/m207b_16/set1b_sol.pdf",
      "url": "https://www.math.ucdavis.edu/~hunter/m207b_16/set1b_sol.pdf"
    },
    {
      "title": "ocw.mit.edu/ans7870/18/18.013a/textbook/HTML/chapter06/section06.html",
      "url": "https://www.ocw.mit.edu/ans7870/18/18.013a/textbook/HTML/chapter06/section06.html"
    },
    {
      "title": "ocw.mit.edu/courses/18-02-multivariable-calculus-fall-2007/5628908f9b3f6cfe621f…",
      "url": "https://ocw.mit.edu/courses/18-02-multivariable-calculus-fall-2007/5628908f9b3f6cfe621f9ee38a65d199_18_022007L12.pdf"
    },
    {
      "title": "ocw.mit.edu/ans7870/textbooks/Strang/Edited/Calculus_Instruct_Manual/13.pdf",
      "url": "https://www.ocw.mit.edu/ans7870/textbooks/Strang/Edited/Calculus_Instruct_Manual/13.pdf"
    },
    {
      "title": "cs.cornell.edu/courses/cs4780/2022fa/lectures/Opt.html",
      "url": "https://www.cs.cornell.edu/courses/cs4780/2022fa/lectures/Opt.html"
    },
    {
      "title": "docs.jax.dev/en/latest/jacobian-vector-products.html",
      "url": "https://docs.jax.dev/en/latest/jacobian-vector-products.html"
    }
  ],
  "license": "https://creativecommons.org/licenses/by/4.0/"
}