Okay, that cleared some doubts..
Now, if y is a function of x, why not have everything as a function of x, just y(x)? Why do we need g(x,y), why not just g(y) since y is already a function of x?
Also, if it's all a function of one variable, why can we not just integrate it straight away to get...