8
$\begingroup$

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$?

$\endgroup$
1
  • 1
    $\begingroup$ A one dimensional vector is just a real number. The gradient of $f$ would just be its derivative, $2x$. In fact, you should really view the derivative as a special case of the gradient, and if you know some linear algebra, you should view the gradient as a special case of the Jacobian matrix. $\endgroup$ Jun 6, 2015 at 5:36

3 Answers 3

6
$\begingroup$

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).$$

$\endgroup$
4
  • $\begingroup$ great answer. thanks! $\endgroup$
    – bernie2436
    Jun 6, 2015 at 14:11
  • $\begingroup$ There's a formality that seems off to me. When writing the gradient as a vector, aren't there implied unit vectors with each of the components? Thus, when reducing to one dimension, shouldn't it be $\hat{i}d/dx$, not $d/dx$? That is to say, $(d/dx) \neq d/dx$, but rather $(d/dx) = \hat{i}d/dx$, just as $(\partial/\partial x+\partial/\partial y) = \hat{i}\partial/\partial x+\hat{j}\partial/\partial y$. Otherwise we would have a vector equal to a scalar. $\endgroup$ Nov 15, 2020 at 3:28
  • $\begingroup$ Yes. The real line $\Bbb R$ is a smooth manifold and for every $x \in \Bbb R$ one has $T_x\Bbb R \cong \Bbb R$. But of course I wouldn't say this in the answer, given OP's background (at the time). $\endgroup$
    – Ivo Terek
    Nov 15, 2020 at 3:30
  • $\begingroup$ Or, you can say that including $\hat{i}$ or not is explicitly describing the identification between numbers and $1\times 1$ matrices, as in the original answer. $\endgroup$
    – Ivo Terek
    Nov 15, 2020 at 3:32
1
$\begingroup$

As other answers suggest, the gradient is a generalization of the ordinary derivative.

$\endgroup$
0
$\begingroup$

Well, you do have a one dimensional vector since if you think about it that would really just be a scalar. In particular $\frac{\partial f}{\partial x}$ is just $\frac{\text{d}f}{\text{d}x}$ in the one-variable case, so your gradient is just a derivative! So then $$\nabla x^2 = \frac{\text{d}}{\text{d}x}x^2 = 2x.$$

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .