I encountered an example in lambda calculus:
$$(\lambda x.(\lambda y.(xy))x)(\lambda z.w)$$
Now, can I apply the second parenthesis to $\lambda x$? Then
$$(\lambda x.(\lambda y.(xy))x)(\lambda z.w) \rightarrow^{\beta} (\lambda y.(xy))(\lambda z.w)$$ But should I also change the $x$ in the other expression? It's free in this expression and I don't know if this is completely different $x$ and I should rename it or it's the $x$ from the first one.
If I do this the other way:
$$(\lambda x.(\lambda y.(xy))x)(\lambda z.w) \rightarrow^{\beta} (\lambda x.(xx))(\lambda z.w) \rightarrow^{\beta} ...$$
Still don't know about the $x$.