{
  "aliases": null,
  "backlinks": null,
  "body": "\n## Proof\n\nWe write the directional derivative as a dot product with the gradient and compare it with its largest possible value.\n\n1. Let $U$, $f$ and $a$ be as in the statement. Put $g = \\nabla f(a)$, so $g \\ne 0$. Let $u \\in \\mathbb{R}^n$ with $\\|u\\| = 1$, and put $w = g / \\|g\\|$, a unit vector.\n2. Since [[the derivative gives the directional derivatives|0A6PMR20N4]], the [[directional derivative|0Y7PVW4Q44]] $D_u f(a)$ exists and equals $Df(a)(u)$.\n3. By the definition of the [[gradient|0NS2QYVC4Y]], $Df(a)(u) = g \\cdot u$. So $D_u f(a) = g \\cdot u$.\n4. By the [[Cauchy–Schwarz inequality|0RFWW56Y22]] in [[Euclidean space|0XPR1E85W0]], $|g \\cdot u| \\le \\|g\\| \\, \\|u\\| = \\|g\\|$. So $-\\|g\\| \\le D_u f(a) \\le \\|g\\|$.\n5. Expanding the dot product, $\\|u - w\\|^2 = \\|u\\|^2 - 2 \\, u \\cdot w + \\|w\\|^2 = 2 - 2 \\, \\dfrac{g \\cdot u}{\\|g\\|}$.\n6. In the same way, $\\|u + w\\|^2 = 2 + 2 \\, \\dfrac{g \\cdot u}{\\|g\\|}$.\n7. By steps 3 and 5, $D_u f(a) = \\|g\\|$ holds if and only if $\\|u - w\\| = 0$, that is, if and only if $u = g / \\|g\\|$.\n8. By steps 3 and 6, $D_u f(a) = -\\|g\\|$ holds if and only if $\\|u + w\\| = 0$, that is, if and only if $u = -g / \\|g\\|$.\n9. So the upper bound is attained exactly at $u = \\nabla f(a) / \\|\\nabla f(a)\\|$, and the lower bound exactly at $u = -\\nabla f(a) / \\|\\nabla f(a)\\|$.\n\n## Idea\n\nThe slope of $f$ in a unit direction $u$ is the dot product $\\nabla f(a) \\cdot u$. A dot product with a fixed vector is largest when $u$ points the same way as that vector, and smallest when it points the opposite way. The identity $\\|u - w\\|^2 = 2 - 2 u \\cdot w$ for unit vectors makes the cases of equality exact.\n",
  "commit": "4a3290d299c8b2cd6493fce2296920ba7f82d942",
  "front": {
    "kind": "proof",
    "msc": [
      "26B12"
    ],
    "name": "Proof that the gradient points in the direction of steepest ascent",
    "proves": "0ZC78099PA",
    "sources": [
      {
        "locator": "Section 8.3.3",
        "url": "https://www.jirka.org/ra/realanal2.pdf"
      },
      {
        "locator": "Gradient is direction of steepest ascent",
        "url": "https://en.wikipedia.org/wiki/Gradient"
      }
    ],
    "tag": "5BFC3R00AF",
    "uses": [
      "0A6PMR20N4",
      "0Y7PVW4Q44",
      "0NS2QYVC4Y",
      "0RFWW56Y22",
      "0XPR1E85W0"
    ]
  },
  "kind": "proof",
  "link": "https://math2.tamnd.com/node/5BFC3R00AF/",
  "links": [
    {
      "field": "proves",
      "target": "0ZC78099PA"
    },
    {
      "field": "uses",
      "target": "0A6PMR20N4"
    },
    {
      "field": "uses",
      "target": "0Y7PVW4Q44"
    },
    {
      "field": "uses",
      "target": "0NS2QYVC4Y"
    },
    {
      "field": "uses",
      "target": "0RFWW56Y22"
    },
    {
      "field": "uses",
      "target": "0XPR1E85W0"
    }
  ],
  "markdown": "https://math2.tamnd.com/node/5BFC3R00AF.md",
  "msc": [
    "26B12"
  ],
  "name": "Proof that the gradient points in the direction of steepest ascent",
  "prov": null,
  "role": "",
  "source": "https://github.com/tamnd/math2/blob/main/nodes/5BF/5BFC3R00AF.md",
  "status": null,
  "tag": "5BFC3R00AF",
  "uri": "m2://5BFC3R00AF",
  "url": "https://math2.tamnd.com/wiki/proof-that-the-gradient-points-in-the-direction-of-steepest-ascent/",
  "writing": {
    "tag": "5BFC3R00AF",
    "kind": "proof",
    "level": "W0",
    "next": [
      {
        "what": "an inventory row",
        "note": "the row of the inventory that the node accounts for",
        "have": 0,
        "want": 1
      }
    ]
  }
}
