# Application rules in Mathematica functions

**URL:** <https://community.wolfram.com/t/application-rules-in-mathematica-functions/17950>\
**Category:** Questions\
**Created:** [April 10, 2021, 1:21am UTC](https://community.wolfram.com/t/application-rules-in-mathematica-functions/17950 "2021-04-10T01:21:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![orjuelajavier](https://avatars.discourse-cdn.com/v4/letter/o/5e9695/32.png) [@orjuelajavier](https://community.wolfram.com/u/orjuelajavier)\
**Post date:** [April 10, 2021, 1:21am UTC](https://community.wolfram.com/t/application-rules-in-mathematica-functions/17950/1 "2021-04-10T01:21:53Z")

</div>

Hello everybody,  
I have a question related with the application rules in a defined function in Mathematica. The following script provides the use of Wick theorem, so, after defining the function ‘fourfields’ corresponding to the application of the Wick theorem for four fields, I applied some rules (deffnitionsff and rules). However as you can see there, the rules do not work. But, if I defined a new function fourfieldscopy which is just the copy-paste of the fourfield’s output, it works!!  
I really appreciate if anyone can suggest me how to rewrite the code such that ‘fourfields’ function accepts the rules and make the process automatically.  
Thanks.

[Open in Wolfram Cloud ↗](https://www.wolframcloud.com/obj/97b744b5-a7d2-49f1-a4a9-117c7d09447f)

---

<div class="post-metadata">

**Author:** ![rohitnamjoshi](https://avatars.discourse-cdn.com/v4/letter/r/f1d935/32.png) [@rohitnamjoshi](https://community.wolfram.com/u/rohitnamjoshi)\
**Post date:** [April 10, 2021, 1:43am UTC](https://community.wolfram.com/t/application-rules-in-mathematica-functions/17950/2 "2021-04-10T01:43:18Z")

</div>

Compare `FullForm@fourfields` and `FullForm@fourfieldscopy`.

---

<div class="post-metadata">

**Author:** ![orjuelajavier](https://avatars.discourse-cdn.com/v4/letter/o/5e9695/32.png) [@orjuelajavier](https://community.wolfram.com/u/orjuelajavier)\
**Post date:** [April 10, 2021, 8:55pm UTC](https://community.wolfram.com/t/application-rules-in-mathematica-functions/17950/3 "2021-04-10T20:55:05Z")

</div>

Thanks a lot Rohit. Yes, there is a quite difference between both definitions. Now, the problem is solved by just rewriting the expression such that they get the same format.
