# Euler lagrange equations for the following $E(u;f)$

suppose we have the functional

$$E(u;f) = \int_{\Omega} \left[ \left(u - f \right)^2 + g(\lVert \nabla u \rVert^2)\lVert \nabla u \rVert^2\right] dxdy = \int_{\Omega} \mathcal{L}(x,y,u,u_x,u_y) dxdy$$

Assume all the functions involved are smooth enough, I want to get the euler lagrange equations for the expression above, here $u,f$ are bivariate functions and $g$ is a real function of real variable$EL equations are given by $$\frac{dE}{du} = \left(\frac{\partial}{\partial u} - \frac{d} {dx}\frac{\partial}{\partial u_x} - \frac{d}{dy}\frac{\partial}{\partial u_y}\right)\mathcal{L}$$ I'll write this more compactly as $$\frac{dE}{du} = \left(\frac{\partial}{\partial u} - \nabla^T \cdot A\right)\mathcal{L}$$ Where$A\$ is defined as the operator

$$A = \begin{pmatrix} \frac{\partial}{\partial u_x} \\ \frac{\partial}{\partial u_y} \end{pmatrix} = 2 \begin{pmatrix} u_x \\ u_y \end{pmatrix} \frac{d}{d\lVert \nabla u\rVert^2} = 2 \nabla u \frac{d}{d\lVert \nabla u\rVert^2}.$$

Let's observe

$$\frac{d}{d\lVert \nabla u\rVert^2} \mathcal{L} = \frac{d}{d\lVert \nabla u\rVert^2} \left[g\left(\lVert \nabla u \rVert^2 \right) \lVert \nabla u \rVert^2 \right]$$

Therefore we can evaluate

$$\nabla^T \cdot A \mathcal{L} = 2 \nabla^T \cdot \left( \nabla u \frac{d}{d\lVert \nabla u\rVert^2} \mathcal{L} \right) = 2\nabla^T \cdot \left[ \left(\frac{d}{d\lVert \nabla u\rVert^2} \left(g\left(\lVert \nabla u \rVert^2 \right) \lVert \nabla u \rVert^2 \right) \right) \nabla u\right]$$

Therefore the Euler-Lgrange equations can be written as

$$\frac{dE}{du} = 2(u - f) - 2\nabla^T \cdot \left[ \left(\frac{d}{d\lVert \nabla u\rVert^2} \left(g\left(\lVert \nabla u \rVert^2 \right) \lVert \nabla u \rVert^2 \right) \right) \nabla u\right]$$

I cannot spot further simplifications, but single quantities should be easily discretized by finite differences.

Is this correct?