I have been messing around with the function $f(x_1,x_2)=(x_1-2)^4+(x_1-2x_2)^2$ for a while now in MatLab, and I'm starting to suspect I'm making some pretty basic error when it comes to differentiation, though I cannot figure out what I'm doing wrong.
Calculating the gradient of $f$ is fairly straightforward: $\nabla f(x_1,x_2)=\begin{pmatrix} 4(x_1-2)^3+2(x_1-2x_2)\\ -4(x_1-2x_2)\\ \end{pmatrix}$
Now I'm tasked with calculating the steepest descent direction from the initial point $x^0=(0,3)^t$. I'm thinking that the steepest descent direction is $$d=-\nabla f(0,3)=\begin{pmatrix} 44\\ -24\\ \end{pmatrix}$$
Let $\phi(t)=f(x^0+td)$. Then, according to my line of thinking, $\phi(t)$ should be smaller than $f(x^0)$ for small positive values of $t$, since $d=-\nabla f(x^0)$ is a descent direction. However, when testing in MatLab, I get the exact opposite result: $\phi(t)>f(x^0)$ for small $t>0$.
Am I confusing $\nabla f$ with $-\nabla f$ or something? At this point I have no idea what I'm doing wrong.
Edit: I'm still not entirely sure what was wrong, but after looking at the answer my guess is that I accidentally managed to put $d=\nabla f(x^0)$ somehow. But the matter is resolved now.