I have the following exercise:

Do a rotation of $2 \cdot 72 ^\circ$.
Then do a reflection of the axis $d4$.
Then do a reflection of the axis $d3$.
Then do a rotation of $2 \cdot 72 ^\circ$.
Then do a reflection of the axis $d2$.
With which symmetry of the pentagon iss equal this succession of symmetries?
$$$$
In my notes I have the following:
$$\sigma =\begin{pmatrix} 1 & 2 & 3 & 4 & 5 \\ 2 & 3 & 4 & 5 & 1 \end{pmatrix}, \tau =\begin{pmatrix} 1 & 2 & 3 & 4 & 5 \\ 1 & 5 & 4 & 3 & 2 \end{pmatrix}, $$
$$\sigma \tau = \text{ Reflection of the axis } d4$$ $$\sigma^2 \tau = \text{ Reflection of the axis } d2$$ $$\sigma^3 \tau = \text{ Reflection of the axis } d5$$ $$\sigma^4 \tau = \text{ Reflection of the axis } d3$$
So the succession of symmetries is: $$(\sigma^2 \tau) \sigma^2 (\sigma^4 \tau) (\sigma \tau ) \sigma^2$$
$$$$
I haven't understood why it is like that...
Do a rotation of $2 \cdot 72 ^\circ$: $\sigma^2$
Then do a reflection of the axis $d4$: $\sigma \tau$
Then do a reflection of the axis $d3$: $\sigma^4 \tau$
Then do a rotation of $2 \cdot 72 ^\circ$: $\sigma^2$
Then do a reflection of the axis $d2$: $\sigma^2 \tau$
Why isn't it: $$\sigma^2 (\sigma \tau) (\sigma^4 \tau) \sigma^2 (\sigma^2 \tau)$$??
When you write it as $(\sigma^2 \tau) \sigma^2 (\sigma^4 \tau) (\sigma \tau ) \sigma^2$, this is assuming right-to-left function composition, where the functions further on the right are the ones that happen first. That is "$fg$" means "first $g$ then $f$.
It is also possible to write it as $\sigma^2 (\sigma \tau) (\sigma^4 \tau) \sigma^2 (\sigma^2 \tau)$, but you would have to mention that you are using left-to-right composition, meaning that the functions on the left are the ones that are happening first.
This is just a matter of notation. The former one is the one used most often, but the latter one exists too. You might want to consult with your teacher to confirm what notation they intend to use and what they want you to use. From the context, they appear to be using the former notation.