For this machine it is very easy to calculate regular expression just calculate longest path to final state from two sides.
Regular Expression RE = aa*b + ba*a
Notice here regular expression is a sum of two regular expressions though there is only one final state but it is one case where we can get final from distinct from path.