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

**URL:** https://fenicsproject.discourse.group/t/how-to-implement-first-and-second-derivatives-w-r-t-specific-directions-in-fenics/16536
**Category:** General
**Tags:** dolfinx
**Created:** [December 17, 2024, 4:49pm UTC](https://fenicsproject.discourse.group/t/how-to-implement-first-and-second-derivatives-w-r-t-specific-directions-in-fenics/16536 "2024-12-17T16:49:05Z")
**Posts on this page:** 1
**Showing post:** 4

<div class="post-metadata">

### Author: ![dokken](https://yyz2.discourse-cdn.com/free1/user_avatar/fenicsproject.discourse.group/dokken/32/1560_2.png) [@dokken](https://fenicsproject.discourse.group/u/dokken)
#### Post date: [December 23, 2024, 10:30pm UTC](https://fenicsproject.discourse.group/t/how-to-implement-first-and-second-derivatives-w-r-t-specific-directions-in-fenics/16536/4 "2024-12-23T22:30:16Z")

</div>

> [@Great\_Mammuth](#):
>
> When using the terms inner and grad, the solution is similar to the one obtained from Mathematica. However, when I use the terms f.dx(0).dx(0)

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

> [@Is it possible to solve original or weak formulations of the boundary value problems in DOLFINx?](https://fenicsproject.discourse.group/t/is-it-possible-to-solve-original-or-weak-formulations-of-the-boundary-value-problems-in-dolfinx/16282/4):
>
> Biharmonic equation: [Biharmonic equation — DOLFINx 0.10.0.0 documentation](https://docs.fenicsproject.org/dolfinx/main/python/demos/demo_biharmonic.html) Honestly, I can’t give you a full review of Galerkin based finite element methods. I think a good source of information is: [pde - What is the purpose of using integration by parts in deriving a weak form for FEM discretization? - Computational Science Stack Exchange](https://scicomp.stackexchange.com/questions/7845/what-is-the-purpose-of-using-integration-by-parts-in-deriving-a-weak-form-for-fe#:~:text=bearing%20the%20same%20spirit%20with,not%20require%20integration%20by%20parts). Yes, if you want higher order regularity, you would need to use hermitian elements or splines. You say that it is «as easy as». Sure, if someone has tim…

referring to [pde - What is the purpose of using integration by parts in deriving a weak form for FEM discretization? - Computational Science Stack Exchange](https://scicomp.stackexchange.com/questions/7845/what-is-the-purpose-of-using-integration-by-parts-in-deriving-a-weak-form-for-fe#:~:text=bearing%20the%20same%20spirit%20with,not%20require%20integration%20by%20parts)

---

_[View the full topic](https://fenicsproject.discourse.group/t/how-to-implement-first-and-second-derivatives-w-r-t-specific-directions-in-fenics/16536)._
