Deriving a demand curve from a Cobb-Douglas utility Probably a daft question but I derived an equation for a demand curve from a general Cobb-Douglas utility function $$U(x,y)=\beta x^{\alpha}y^{1-\alpha}$$ given a budget constraint $$M=xP_x+yP_y$$ and found that the quantity of $x$ demanded would be $$x=\frac{\alpha M}{P_x}$$.

which surprised me in that this function is independent of the price of good $y$. I see some references on these pages which suggests that I didn't make any spectacular  errors but, my elementary understanding is that the demand curve is a functions of many thing, not least the price  of other related goods. Now surely goods $x$ and $y$ are substitutes to some extent?

Now, my question is this, is my understanding of this essentially correct and, what sort of utility functions would generate demand curves $x=f(P_x, P_y, M, etc)$?

Thank you
If you take the general class of CES utility functions, of which Cobb-Douglas is a special case, you do indeed get a demand function that depends on other prices. Specifically, the CES utility function (over $n$ goods, $x_1,\dots,x_n$) takes the form 
\begin{equation}
  u(x_1,\dots,x_n)=\bigl[\alpha_1x_1^\rho+\cdots+\alpha_nx_n^\rho\bigr]^{1/\rho},
\end{equation}
where $\rho\in(-\infty,1]\setminus\{0\}$, $\alpha_i\in[0,1]$ and $\sum_i\alpha_i=1$. We interpret $\alpha_i$ as the consumption share of good $i$ and $\sigma\equiv\frac{1}{1-\rho}$ as the constant elasticity of substitution. Note also that when $\sigma=1$ (or $\rho\to0$), we get the Cobb-Douglas utility form. 

Solving utility maximization subject to the usual budget constraint, we get the demand for good $i$ as 
\begin{equation}
  x_i(p_1,\dots,p_n,M)=\frac{M(\alpha_i/p_i)^\sigma}{\sum_{j=1}^n\alpha_j^\sigma p_j^{1-\sigma}},\quad i=1,\dots,n.
\end{equation}
Again, observe that when $\sigma=1$ we get the demand associated with Cobb-Douglas utility. 

The elasticity of substitution governs how relative expenditures on different goods change as relative prices change. Take a two-good example. An increase in the relative price $p_1/p_2$, i.e. good 1 becoming relatively more expensive, causes two effects simultaneously: 


per unit expenditure on good 1 rises, as good 1 now costs more in relative terms; and 
quantity demanded for good 1 decreases due to law of demand.


These are opposing effects on the expenditure on good 1 relative to that on good 2. It turns out that the elasticity of substitution determines which effect dominates. If $\sigma&gt;1$, the second effect dominates, and if $\sigma&lt;1$, the first effect dominates. When $\sigma=1$, which is the case of Cobb-Douglas, the two effects cancel each other exactly, so that relative expenditure is independent of the relative prices, and depends only on preference parameters (the $\alpha_i$'s). 



Of course, CES utility is not the only class of utility functions that generate demands dependent on prices of other goods. Another common form of utility function, the quasi-linear utility function, 
\begin{equation}
u(x_1,\dots,x_n)=x_1+v(x_2,\dots,x_n),
\end{equation}
where $v(\cdot)$ is strictly increasing and strictly concave, also generates demand functions that depend on other prices. A common example is $u(x_1,x_2)=x_1+2\sqrt{x_2}$. I trust that you can verify that both $x_1$ and $x_2$ depend on the two prices $p_1$ and $p_2$.