Is the process of variable substitution the same as function composition ? And if yes how do you write it in the case of multivariable functions ? For example a typical variable substitution is $$ x=r\cos(\theta), \ y=r\sin(\theta).$$ Given is $$f(x,y)=x^2 + y$$ Which is no turned into $$f(x(r,\theta),y(r,\theta))=g(r,\theta)=r^2\cos^2(\theta)+r\sin(\theta)$$ This looks to me like a composition of the function $$ f:\mathbb R^2 \rightarrow \mathbb R $$ and the function $$ p:\mathbb R^2 \rightarrow \mathbb R^2 $$ but i am unable to properly define $$p$$ which takes care of turning $(x,y)$ to $(r\cos(\theta), r\sin(\theta))$.
I seem to have a misconception some where but iam not able to make sense of it. Are changes of coordinate systems more than simple substitutions/function compositions or not ?