Derivative of additively seperable function

I'd like to take the derivative w.r.t. y(x) of the following function:

where g(.), y(.) and phi(.) are all functions and x is a random variable.

The problem, I think, is that the function phi(.) is contained in the first y() of the expression. If I imposed a functional form to y(.) and phi(.) I could probably pull the effect of phi(.) outside of y(.) and thereby take the derivative w.r.t. y(x)--- but I don't want to do this.

Any suggestions?

Re: Derivative of additively seperable function

Do you just need to know how to use the chain rule?

You just take the derivative of the outer most function, and leave the inside alone. Then you multiply that by the derivative of the next to outer most function, then by the derivative of the next to next outer most function, and so on, until you can only multiply it by the derivative of x. Think of it like this:

Re: Derivative of additively seperable function

Thanks for the input, but I'm afraid this will only work if I am taking the derivative w.r.t. . Since I am taking the derivative w.r.t. , I need whatever is contained in the parentheses to be constant. What I am looking for is: