Let $I\_1$ and $I\_2$ be two closed bounded intervals. 
Suppose $W(x,y)$ is a smooth function whose support is contained inside $I\_1 \times I\_2$. 


Suppose I have $\Phi= (\Phi\_1(x,y), \Phi\_2(x,y)) : \mathbb{R}^2 \rightarrow \mathbb{R}^2$
which is a diffeomorphism restricted to $B$, where $B$ is an open bounded box such that 
$I\_1 \times I\_2 \subseteq B$. 


I want to define $\widetilde{W} (u,v) = W \circ \Phi^{-1} (u,v)$ which is well defined on $\Phi(B)$. I would like to extend it to be a function on all of $\mathbb{R}^2$ by defining it to be $0$ outside $\Phi(B)$. 


My question is, from this does it follow that $\widetilde{W} (u,v)$ differnetiable everywhere? or do I need extra assumptions?
(I guess my concern is what happens near the boundaries, does everything work out nicely so that this is the case?) Thank you very much. 



Differentiablity of certain composite function
The function $\widetilde W$ is a smooth function on the open set $\Phi(B)$ and is supported in the compact set$\Phi(I\_1\times I\_2)$. As a result it can be extended by 0 as you wish and this is simply due to the continuous canonical injection
$$
C\_{comp}^\infty(\Omega)\subset C\_{comp}^\infty(\mathbb R^n),
$$
for $\Omega$ open subset of $\mathbb R^n$.


