# Help please, maximizing function w/respect to one x variable

#### BWells

##### New Member
OK, so I'm working on this hw assignment (I'm a grad student, and for this class this is for knowledge, not points). We were given a large data set to regress in Stata. I've got the regression and first several questions done.
Now, they want us to find the optimal x4 value (I have about 8 x variables here) to maximize the function. I know if I was doing this on paper, I'd be taking partial derivatives. I'm just lost on how to get started and then what to do in Stata. Can anyone tell me how to get this started? Please and thank you!

#### BWells

##### New Member
OK, I know that I'm supposed to use a partial derivative, but what does that look like in this case? My textbook is all theory so when I try to apply it to a problem I never know if it looks right or not? In this case, I have:

^cr= 8.82 -.194pf +7.2un -7.5asp + 2.66cls +.03cls^2 as my regression result from Stata

Maximizing the function with respect to cls, we set ∂cr/∂cls = 0
I think this part is correct?

Now I get lost
8.82 -2.66 -.03cls =0; Is this right? Do I keep the constant? Then subtract FOC from that?

#### BGM

##### TS Contributor
So now you want to maximize the quadratic function

$$f(x) = ax^2 + bx + c$$ where $$a < 0$$ ?

Then the maximum point, or the vertex of the parabola is $$x = -\frac {b} {2a}$$