I trying to wrap my head of derivation of the analytic FEM Jacobian for the Newton method. Say we have a nonlinear Poisson problem of the (weak) form
$$ \int a(u)\nabla\ u\cdot \nabla v = \int f v $$
where $a(u)$ is a coefficient. From the derivation of the Newton method the Jacobian matrix (in the Newton update $\Delta u = -J(u_k)R(u_k) $ will be
$$ J(u) = \int a(u)\nabla\ \phi_i\cdot \nabla \phi_j + \int \frac{\partial a(u)}{\partial u}\phi_i\nabla\ u\cdot \nabla \phi_j $$
which essentially is the original stiffness matrix plus a contribution due to the derivative of $a(u)$. Now if for example $a(u)=u^2$ then the 2nd Jacobian term will be $J_2=\int 2u\ \phi_i\nabla\ u\cdot \nabla \phi_j$ which is ok. But if now $a(u)=(\frac{\partial u}{\partial x})^2$ or even $a(u)=\frac{\partial u}{\partial x}\frac{\partial u}{\partial y}$, how does this work as the problem is still nonlinear but $\frac{\partial a(u)}{\partial u}$ is essentially zero?
EDIT: Could someone verify that these Jacobian forms are indeed correct so that I have understood it correctly.
$$ a(u) = u\frac{\partial u}{\partial x} \Rightarrow J_2 = \int (u\frac{\partial \phi_i}{\partial x} + \frac{\partial u}{\partial x}\phi_i)(\nabla\ u\cdot \nabla \phi_j) $$
$$ a(u) = (\frac{\partial u}{\partial x})^2 \Rightarrow J_2 = \int 2\frac{\partial u}{\partial x}\frac{\partial \phi_i}{\partial x}(\nabla\ u\cdot \nabla \phi_j) $$
$$ a(u) = \frac{\partial u}{\partial x}\frac{\partial u}{\partial y} \Rightarrow J_2 = \int (\frac{\partial u}{\partial x}\frac{\partial \phi_i}{\partial y} + \frac{\partial u}{\partial y}\frac{\partial \phi_i}{\partial x})(\nabla\ u\cdot \nabla \phi_j) $$
where $u$ and $\nabla u$ are evaluated explicitly with the current solution in the assembly.