Euler's theorem and Cobb-Douglas
You are probably talking about Euler's homogeneous function theorem http://mathworld.wolfram.com/EulersHomogeneousFunctionTheorem.html , which shows that you can decompose a function into its partial derivatives based on its homogeneity. 

So a typical Cobb Douglass $U(x,y)=x^ay^{1-a}$

This function is homogeneous of degree 1 because when we multply each argument by a scalar:

$U(cx,cy)=(cx)^a(cy)^{1-a}=cx^ay^{1-a}=cU(x,y)$

So if we apply the theorem to this function we get:

$U(x,y)=xU_x+yU_y=xax^{a-1}y^{1-a}+x^ay(1-a)y^{-a}=x^ay^{1-a}$

So the result that we get back the original utility is expected.