How to Implement First and Second Derivatives w.r.t. Specific Directions in FEniCS

One doesn’t use the strong form of a PDE in the finite element method. One of the key aspects of FEM is that you set up a weak formulation (variational form), where you lessen the requirement of the function spaces used for your unknown). This has for instance been discussed in

referring to pde - What is the purpose of using integration by parts in deriving a weak form for FEM discretization? - Computational Science Stack Exchange