120. Gradient

The gradient 𝑓(𝑥,𝑦) is a vector of expressions (equations)

If

𝑓:𝑛

The gradient is always a vector in the same space as the input variables

𝑓(𝑥)=[𝜕𝑓𝜕𝑥1𝜕𝑓𝜕𝑥2𝜕𝑓𝜕𝑥𝑛]𝑛
Example
𝑓(𝑥,𝑦)=𝑥2+𝑥𝑦+𝑦2𝑓(𝑥,𝑦)=[𝜕𝑓𝜕𝑥𝜕𝑓𝜕𝑦]=[2𝑥+𝑦𝑥+2𝑦]

Evaluating at a point

If you plug in numbers for 𝑥 and 𝑦, each component becomes a scalar:

(𝑥,𝑦)=(1,2)𝑓(1,2)=[21+21+22]=[45]