I need help making this types of diagrams
I tried to use \frac but it doesn't work because I need the equal symbol to be on top, also I tried to use \underline but I don't know if there is some way to put text below.
I've been thinking I could do it with \tikz, but I wanted to see if there's an easier way.


