I suggest having a look at the following papers:
- Implementation of shape derivatives in ufl
- Automatic shape derivatives for transient PDEs in dolfin/firedrake-adjoint
As you can see here, to get the shape derivative of a function, you need to solve the corresponding adjoint equation. This can be done by hand (as in the first paper) or by using dolfin-adjoint (as implemented in the second paper). You cannot use Expressions in either case, and you need to use SpatialCoordinate for purely geometrical dependencies