勾配の計算方法

スカラー関数の勾配(偏導関数のベクトル、∇f)を計算します。手順:各変数について偏微分を取り、それらをベクトルとしてまとめ、特定の点で評価します。例:f(x,y)=x^2 y + 3y → ∇f=(2xy, x^2+3); (1,2) では (4,4)。

勾配の計算方法

概要:スカラー関数の勾配は各変数に対する偏導のベクトルで、最も急な上昇方向を示します。使い方:多変数関数を入力し、各偏導を計算して勾配ベクトルを作り、指定点で評価します。用途例:最適化、方向微分、物理場の解析。

Steps

  1. Take the partial derivative of the function with respect to each variable: $partial f/partial x_i$.
  2. Assemble these partial derivatives into the gradient vector: $ abla f = (partial f/partial x_1, partial f/partial x_2, ...)$.
  3. Evaluate the gradient at the desired point by substituting coordinates.

Example

f(x,y) = x^2 y + 3y
∂f/∂x = 2xy
∂f/∂y = x^2 + 3
∇f = (2xy, x^2 + 3)
At (1,2): ∇f = (4,4)

Use this approach for scalar fields in physics, optimization, and directional derivative calculations.