I'm trying to calculate $\vec\nabla(\vec k.\vec r)$ where $\vec k =k_x \hat{i}+k_y\hat{j}+k_z\hat{k}$ is a constant vector and $\vec r=x\hat{i}+y\hat{j}+z\hat{k}$ is the position vector.
I tried doing this in the following two ways:
First, I used the known formula for Gradient of the dot product between two vectors:$$\vec \nabla(\vec k.\vec r)=\vec k \times(\vec \nabla\times\vec r)\space+\vec r \times(\vec \nabla\times\vec k)\space+(\vec\nabla.\vec k)\vec r+\space(\vec\nabla.\vec r)\vec k \space$$ The first term of this expression is $\vec0$ since the curl of the position vector ($\vec \nabla\times\vec r$) is $\vec 0$.The second and third terms are also both $\vec 0$ since they are respectively the Divergence and the Curl of a constant vector. This leaves me with the fourth term which evaluates to $3\vec k$ since the divergece of the position vector ($\vec\nabla\times\vec r$) is $3$. So using the formula the answer comes out to be $3\vec k$.
Then, I did it "manually":
$\vec\nabla(\vec k.\vec r) = \frac {\partial (\vec k.\vec r)}{\partial x} \hat {i} +\frac {\partial (\vec k.\vec r)}{\partial y} \hat {j}+\frac {\partial (\vec k.\vec r)}{\partial z} \hat {k}$
and $(\vec k.\vec r)=k_xx+k_yy+k_zz$
So, $\vec\nabla(\vec k.\vec r)=\frac {\partial (k_xx+k_yy+k_zz)}{\partial x} \hat {i} +\frac {\partial (k_xx+k_yy+k_zz)}{\partial y} \hat {j}+\frac {\partial (k_xx+k_yy+k_zz)}{\partial z} \hat {k}=k_x \hat{i}+k_y\hat{j}+k_z\hat{k}=\vec k$
To summarize, the first method gives me $3\vec k$ and the second gives me $\vec k$. Please tell me which one is right and which one is wrong.