# How to maximize when two variables depend on each others

1. Apr 27, 2012

### Kolmin

Hi all.

I was thinking on how we can maximize a function with the following form:

F(y, x1, x2,..., xn) with y=f(x1)

I know that I should use the total derivative to find out the effective rate of y, but I don't see how gradient and Hessian should be organized in this context.

For example, if we have F(y, x1, x2) with y=f(x1), how should we set gradient and Hessian?
Should the gradient be $\nabla$F= (F1, F2)?
Or $\nabla$F= (Fy, F1, F2)

Sorry for the question (maybe not exactly challenging...), but this problem is not explicitly mentioned in any book.

Thanks.

2. Apr 27, 2012

### Kolmin

Just to put me on the right path, is the question completely meaningless or there is some sort of amazing mistake in it that I cannot see that makes the answer trivial?

3. Apr 27, 2012

### Office_Shredder

Staff Emeritus
F is really only a function of x1,...,xn so you would only calculate derivatives with respect to these variables

To calculate the gradients and hessians you may have to use the chain rule and knowledge of $\frac{\partial F}{\partial y}$ depending on the problem.

It would probably be clearer if you tried to choose specific functions F and f which you think are confusing and we can work through it

4. Apr 27, 2012

### Kolmin

First of all, thanks.

Let's put that F(y,x,z) is a Utility function and y=f(x) is an endogenous probability functions that depends on whatever you want (the important thing is that it is endogenous).
The decision maker has to choose the variables in order to maximize is problem (without constraints).
This is not the typical Von Neumann-Morgenstern Utility function, so how do we maximize it?

Do we set gradient $\nabla$F= ( $\frac{\partial F}{\partial y}$, $\frac{\partial F}{\partial x}$, $\frac{\partial F}{\partial z}$ ) or do we set it $\nabla$F= ($\frac{\partial F}{\partial x}$, $\frac{\partial F}{\partial z}$ ), which honestly doesn't make much sense to me?

Hessian is the next step, so gradient is the main problem I guess.

5. Apr 27, 2012

### Office_Shredder

Staff Emeritus
If we re-write this as F(f(x),x,z) then it's clear that F is a function of two variables. To calculate the gradient we need to know what $\frac{\partial F}{\partial x}$ is (hopefully it's clear what dF/dz is). Unfortunately the notation is a bit unclear so I am going to re-define things. We will assume z is a constant and what we want to calculate is
$$\frac{dF(y(x),x,z)}{dx}$$
where this is the derivative of F as a function of x (which is what you normally think of as the partial derivative. The reason for this is that I will use $\frac{\partial F(y,x,z)}{\partial x}$ to denote the partial derivative of F with respect to the second variable, treating y as a constant value independent of x. Then the chain rule for multivariable calculus says that
$$\frac{dF}{dx} = \frac{\partial F}{\partial y} \frac{ dy}{dx} + \frac{\partial F}{\partial x}$$

So if you just have a function F(y,x,z) whose partial derivatives (as a function of 3 variables) are known, you can calculate the derivative of F with respect to x even when y is a function of x.

6. Apr 27, 2012

### Kolmin

Great!
Thanks a lot and sorry for the (now I see why...) trivial question.

7. Apr 28, 2012

### Kolmin

Another trivial question on this topic after that I started to play around a bit with it (assuming that hopefully I got the point after the last answer…).

Following the notation introduced by the fourth post I guess the gradient should look like

$\nabla$F = ( $\frac{dF}{dx}$,$\frac{\partial F}{\partial z}$)

right? Then set it equal zero and it should work. But still I find some problems in my understanding of the situation.

What I realize lately is that the way in which I previously stated the question is really bad and doesn't emphasize one thing that is probably the most important to me. The fact is that in my problem not only s influences p, but at the same time s stands in itself in the hypothetical formula (with which I mean that you cannot simply decompose y(x) and that's it). Hopefully an example will make my terms of my problem more clear.

$F(y(x),x,z)=(1-y)(x+z)+y(x-z)$

[This is what I mean with my peculiar - and probably wrong - jargon "not only s influences p, but at the same time s stands in itself"]

How do we maximize something like this?
Still with the gradient I wrote few lines above?

And then, if the gradient is that one, how the heck does the Hessian look like???

Many thanks to the one who will help this soul in the reign of shadows.