vector analysis: prove Cartesian gradient of invariant scale field is also invariant under rotation of axis I don't know how to explain where i'm stuck without explaining most of the exercise... so here it is:
BACKGROUND
Given two rectangular coordinate systems that having the same origin but the axes are rotated with respect to each other.  The first coordinate system is called (x,y,z) and the second coordinate system is called $(\bar{x}, \bar{y}, \bar{z})$.  
suppose $\phi(x,y,z)$ is a scalar invarient with respect to a rotation of axes.  By definition this means there exists a $\bar{\phi}(\bar{x}, \bar{y}, \bar{z})$  such that:
$\phi(x,y,z) = \bar{\phi}(\bar{x}, \bar{y}, \bar{z})$
that is $\phi$ and $\bar{\phi}$ are different scalar functions, but when coordinates (x,y,z) and $(\bar{x}, \bar{y}, \bar{y})$ reference the same point in space, then: $\phi(x,y,z) = \bar{\phi}(\bar{x}, \bar{y}, \bar{z})$
Problem
we want to further prove that the cartesian gradient of an invariant scalar field is also an invariant under an axes rotation.  that is:
$\begin{aligned}
\frac{\partial \phi}{\partial x}\hat{\text{i}}+ \frac{\partial \phi}{\partial y}\hat{\text{j}} + \frac{\partial \phi}{\partial z}\hat{\text{k}} &= \frac{\partial \bar{\phi}}{\partial \bar{x}}\bar{\hat{\text{i}}}+ \frac{\partial \bar{\phi}}{\partial \bar{y}}\bar{\hat{\text{j}}} + \frac{\partial \bar{\phi}}{\partial \bar{z}}\bar{\hat{\text{k}}}\\ \\ \nabla \phi &= \bar{\nabla} \bar{\phi}\end{aligned}$
$
Useful Properties already proven in prior problems
under an axis rotation:
$\bar{x} = l_{11} x + l_{12} y + l_{13} z$
$\bar{y} = l_{21} x + l_{22} y + l_{23} z$
$\bar{z} = l_{31} x + l_{32} y + l_{33} z$
further, the unit bases vectors between the two coordinates systems are related by the equations:
$\bar{\hat{\text{i}}} = l_{11} \hat{\text{i}} + l_{12}\hat{\text{j}} + l_{13}\hat{\text{j}}$
$\bar{\hat{\text{j}}} = l_{21} \hat{\text{i}} + l_{22}\hat{\text{j}} + l_{23}\hat{\text{j}}$
$\bar{\hat{\text{k}}} = l_{31} \hat{\text{i}} + l_{32}\hat{\text{j}} + l_{33}\hat{\text{j}}$
Here's where I start the exercise
since problem says $phi$ is invariant, we have:
$\phi(x,y,z) = \bar{\phi}(\bar{x}, \bar{y}, \bar{z})$
using the chain rule to take partial derivative with respect to x,y, and z, yielding three new equations:
$\frac{\partial \phi}{\partial x} = \frac{\partial \bar{\phi}}{\partial \bar{x}} \frac{\partial \bar{x}}{\partial x} + \frac{\partial \bar{\phi}}{\partial \bar{y}} \frac{\partial \bar{y}}{\partial x} + \frac{\partial \bar{\phi}}{\partial \bar{z}} \frac{\partial \bar{z}}{\partial x}$
$\frac{\partial \phi}{\partial y} = \frac{\partial \bar{\phi}}{\partial \bar{x}} \frac{\partial \bar{x}}{\partial y} + \frac{\partial \bar{\phi}}{\partial \bar{y}} \frac{\partial \bar{y}}{\partial y} + \frac{\partial \bar{\phi}}{\partial \bar{z}} \frac{\partial \bar{z}}{\partial y}$
$\frac{\partial \phi}{\partial z} = \frac{\partial \bar{\phi}}{\partial \bar{x}} \frac{\partial \bar{x}}{\partial z} + \frac{\partial \bar{\phi}}{\partial \bar{y}} \frac{\partial \bar{y}}{\partial z} + \frac{\partial \bar{\phi}}{\partial \bar{z}} \frac{\partial \bar{z}}{\partial z}$
now substituting the coordinates conversion equations shown in section "useful properties already proven" section above:
$\frac{\partial \phi}{\partial x} = \frac{\partial \bar{\phi}}{\partial \bar{x}} \frac{\partial }{\partial x}(l_{11}x + l_{12}y + l_{13}z) + \frac{\partial \bar{\phi}}{\partial \bar{y}} \frac{\partial}{\partial x}(l_{21}x + l_{22}y + l_{23}z) + \frac{\partial \bar{\phi}}{\partial \bar{z}} \frac{\partial}{\partial x}(l_{31}x + l_{32}y + l_{33}z))$
using this procedure, I get 3 new equations:
$\frac{\partial \phi}{\partial x} = \frac{\partial \bar{\phi}}{\partial \bar{x}}l_{11} + \frac{\partial \bar{\phi}}{\partial \bar{y}}l_{21} + \frac{\partial \bar{\phi}}{\partial \bar{z}}l_{31}$
$\frac{\partial \phi}{\partial y} = \frac{\partial \bar{\phi}}{\partial \bar{x}}l_{12} + \frac{\partial \bar{\phi}}{\partial \bar{y}}l_{22} + \frac{\partial \bar{\phi}}{\partial \bar{z}}l_{32}$
$\frac{\partial \phi}{\partial z} = \frac{\partial \bar{\phi}}{\partial \bar{x}}l_{13} + \frac{\partial \bar{\phi}}{\partial \bar{y}}l_{23} + \frac{\partial \bar{\phi}}{\partial \bar{z}}l_{33}$
now here's where i get stuck... the notes say i'm suppose to multiply the following equation by $\hat{\text{i}}$:
$\frac{\partial \phi}{\partial x} = \frac{\partial \bar{\phi}}{\partial \bar{x}}l_{11} + \frac{\partial \bar{\phi}}{\partial \bar{y}}l_{21} + \frac{\partial \bar{\phi}}{\partial \bar{z}}l_{31}$
and when i do that i'm suppose to get:
$\frac{\partial \phi}{\partial x} \hat{\text{i}} = \frac{\partial \bar{\phi}}{\partial \bar{x}} \bar{\hat{\text{i}}}$
Ok... so i attempt to do this:
$\frac{\partial \phi}{\partial i} \hat{\text{i}} = \bigg[\bigg( \frac{\partial \bar{\phi}}{\partial \bar{x}} \hat{\text{i}} + \frac{\partial  \bar{\phi}}{\partial \bar{y}} \hat{\text{j}} + \frac{\partial  \bar{\phi}}{\partial \bar{z}} \hat{\text{k}} \bigg) \cdot \bigg( l_{11} \hat{\text{i}} +  l_{21} \hat{\text{j}} +  l_{31} \hat{\text{k}}\bigg)\bigg]\hat{\text{i}}$
$\frac{\partial \phi}{\partial i} \hat{\text{i}} = \bigg[\bigg( \frac{\partial 
 \bar{\phi}}{\partial \bar{x}} \hat{\text{i}} + \frac{\partial \bar{\phi}}{\partial \bar{y}} \hat{\text{j}} + \frac{\partial \bar{\phi}}{\partial \bar{z}} \hat{\text{k}} \bigg) \cdot \bar{\hat{\text{i}}}\bigg]\hat{\text{i}}$
but, i'm confused as to how the preceding expression becomes the following expression as the textbook says it should become:
$\frac{\partial \phi}{\partial x} \hat{\text{i}} = \frac{\partial \bar{\phi}}{\partial \bar{x}} \bar{\hat{\text{i}}}$

Its almost like I can switch the $\hat{\text{i}}$ and $\bar{\hat{\text{i}}}$ in the expression:
$\frac{\partial \phi}{\partial i} \hat{\text{i}} = \bigg[\bigg( \frac{\partial 
 \bar{\phi}}{\partial \bar{x}} \hat{\text{i}} + \frac{\partial \bar{\phi}}{\partial \bar{y}} \hat{\text{j}} + \frac{\partial \bar{\phi}}{\partial \bar{z}} \hat{\text{k}} \bigg) \cdot \bar{\hat{\text{i}}}\bigg]\hat{\text{i}}$
yielding:
$\frac{\partial \phi}{\partial i} \hat{\text{i}} = \bigg[\bigg( \frac{\partial 
 \bar{\phi}}{\partial \bar{x}} \hat{\text{i}} + \frac{\partial \bar{\phi}}{\partial \bar{y}} \hat{\text{j}} + \frac{\partial \bar{\phi}}{\partial \bar{z}} \hat{\text{k}} \bigg) \cdot \hat{\text{i}}\bigg]\bar{\hat{\text{i}}}$
which then reduces by orthogonality of the bases vectors to:
$\frac{\partial \phi}{\partial i} \hat{\text{i}} = \bigg[ \frac{\partial \bar{\phi}}{\partial \bar{x}}\bigg]\bar{\hat{\text{i}}}$
But, I don't know which algebraic law of vectors allows me to switch the $\hat{\text{i}}$ and $\bar{\hat{\text{i}}}$ in the expression...  is that a valid algebraic vector manipulation?  if so...why?
 A: I got your answer! I know I'm a bit too late, but since I happen to know the solution, here it goes:
You're supposed to multiply the equations
$$\frac{\partial \phi}{\partial x} = \frac{\partial \bar{\phi}}{\partial \bar{x}}l_{11} + \frac{\partial \bar{\phi}}{\partial \bar{y}}l_{21} + \frac{\partial \bar{\phi}}{\partial \bar{z}}l_{31}$$
$$\frac{\partial \phi}{\partial y} = \frac{\partial \bar{\phi}}{\partial \bar{x}}l_{12} + \frac{\partial \bar{\phi}}{\partial \bar{y}}l_{22} + \frac{\partial \bar{\phi}}{\partial \bar{z}}l_{32}$$
$$\frac{\partial \phi}{\partial z} = \frac{\partial \bar{\phi}}{\partial \bar{x}}l_{13} + \frac{\partial \bar{\phi}}{\partial \bar{y}}l_{23} + \frac{\partial \bar{\phi}}{\partial \bar{z}}l_{33}$$
by $\hat{i}$, $\hat{j}$ and $\hat{k}$ respectively, to get
$$\frac{\partial \phi}{\partial x}\hat{i} = \frac{\partial \bar{\phi}}{\partial \bar{x}}l_{11}\hat{i} + \frac{\partial \bar{\phi}}{\partial \bar{y}}l_{21}\hat{i} + \frac{\partial \bar{\phi}}{\partial \bar{z}}l_{31}\hat{i}$$
$$\frac{\partial \phi}{\partial y}\hat{j} = \frac{\partial \bar{\phi}}{\partial \bar{x}}l_{12}\hat{j} + \frac{\partial \bar{\phi}}{\partial \bar{y}}l_{22}\hat{j} + \frac{\partial \bar{\phi}}{\partial \bar{z}}l_{32}\hat{j}$$
$$\frac{\partial \phi}{\partial z}\hat{k} = \frac{\partial \bar{\phi}}{\partial \bar{x}}l_{13}\hat{k} + \frac{\partial \bar{\phi}}{\partial \bar{y}}l_{23}\hat{k} + \frac{\partial \bar{\phi}}{\partial \bar{z}}l_{33}\hat{k}$$
Then, you sum the three equations up, to get
$$\frac{\partial \phi}{\partial x}\hat{i} + \frac{\partial \phi}{\partial y}\hat{j} + \frac{\partial \phi}{\partial z}\hat{k} =\left(\frac{\partial \bar{\phi}}{\partial \bar{x}}l_{11}\hat{i} + \frac{\partial \bar{\phi}}{\partial \bar{y}}l_{21}\hat{i} + \frac{\partial \bar{\phi}}{\partial \bar{z}}l_{31}\hat{i}\right) + \left(\frac{\partial \bar{\phi}}{\partial \bar{x}}l_{12}\hat{j} + \frac{\partial \bar{\phi}}{\partial \bar{y}}l_{22}\hat{j} + \frac{\partial \bar{\phi}}{\partial \bar{z}}l_{32}\hat{j}\right) + \left(\frac{\partial \bar{\phi}}{\partial \bar{x}}l_{13}\hat{k} + \frac{\partial \bar{\phi}}{\partial \bar{y}}l_{23}\hat{k} + \frac{\partial \bar{\phi}}{\partial \bar{z}}l_{33}\hat{k}\right) = \frac{\partial \bar{\phi}}{\partial \bar{x}}\left(l_{11}\hat{i} + l_{12}\hat{j} + l_{13}\hat{k}\right) + \frac{\partial \bar{\phi}}{\partial \bar{y}}\left(l_{21}\hat{i} + l_{22}\hat{j} + l_{23}\hat{k}\right) + \frac{\partial \bar{\phi}}{\partial \bar{z}}\left(l_{31}\hat{i} + l_{32}\hat{j} + l_{33}\hat{k}\right) = \frac{\partial \bar{\phi}}{\partial \bar{x}}\bar{\hat{i}} + \frac{\partial \bar{\phi}}{\partial \bar{y}}\bar{\hat{j}} + \frac{\partial \bar{\phi}}{\partial \bar{y}}\bar{\hat{k}}$$
And there you go!
$$\frac{\partial \phi}{\partial x}\hat{i} + \frac{\partial \phi}{\partial y}\hat{j} + \frac{\partial \phi}{\partial z}\hat{k} = \frac{\partial \bar{\phi}}{\partial \bar{x}}\bar{\hat{i}} + \frac{\partial \bar{\phi}}{\partial \bar{y}}\bar{\hat{j}} + \frac{\partial \bar{\phi}}{\partial \bar{y}}\bar{\hat{k}}$$
