Some kind of trace inequality What is the trick, to prove 
$\| u\|_{L^2(\Gamma)} \leq k  \frac{1}{r}\| u\|_{L^2(\Omega)} + r \| \nabla u\|_{L^2(\Omega)} $ ?
$\Gamma$ is one side of $\Omega:= [0,r] \times [0,r] $.
I tried partial differentiation, but it doesnt work.

Let $r=1$ for simplicity; the general case follows by rescaling. Also, $\Gamma=[0,1]\times \{0\}$. We may assume $u$ is continuous, by the usual density argument. Let $v(x,y)=u(x,0)$; the goal is to bound the $L^2$ norm of $v$ on the square $Q=[0,1]\times [0,1]$.  To this end, if suffices to estimate $\|u-v\|_{L^2(Q)}$ by $\|\nabla u\|_{L^2(Q)}$. Well, 
for each $x\in [0,1]$ we have 
$$ \sup_{y\in[0,1]}|u(x,y)-v(x,y)|  \le  \int_0^1 |\nabla u(x,y)|\,dy \tag1$$
Square both sides and use Cauchy-Schwarz:
$$ \sup_{y\in[0,1]}|u(x,y)-v(x,y)|^2  \le  \int_0^1 |\nabla u(x,y)|^2\,dy \tag2$$
The supremum on the left majorizes the corresponding integral:
$$ \int_0^1  |u(x,y)-v(x,y)|^2 \,dy \le  \int_0^1 |\nabla u(x,y)|^2\,dy \tag3$$
Finally integrate in $x$ to get $\|u-v\|_{L^2(Q)}\le \|\nabla u\|_{L^2(Q)}$.
