[Math] Intuition for gradient when you only have one variable

calculus

I am learning about gradient. I understand how gradient is a vector that represents the sum of the rates of change for each component variable of a function. I am able to follow the Khan Academy video showing the gradient of f(x,y). I am also able to imagine (if not visualize) what gradient would be if you had more variables. But what if you only have one variable? Like for the function $f(x) = x^2$ Do you just have a one dimensional vector? What would it look like in the case of $f(x) = x^2$?

Best Answer

In $n$ dimensions, $\nabla$ is the operator $$\nabla = \left(\frac{\partial}{\partial x_1},\cdots,\frac{\partial}{\partial x_n}\right)$$that acts on a differentiable function $f: \Bbb R^n \to \Bbb R$ producing: $$\nabla f = \left(\frac{\partial f}{\partial x_1},\cdots,\frac{\partial f}{\partial x_n}\right).$$Make $n= 1$. So: $$\nabla = \left( \frac{\partial}{\partial x}\right) = \left( \frac{\rm d}{{\rm d}x}\right) = \frac{\rm d}{{\rm d}x},$$ since we identify $1 \times 1$ matrices with numbers. If $f(x) = x^2$, we have: $$\nabla f = 2x = f'(x).$$

Related Question