Maximizing the value of a two variable function along any curve

infinitesimalsmaxima-minimamultivariable-calculusvector analysis

I read that, of all the points on an origin-centered circle in the x-y plane, the function $z=ax+by$ is maximum (or minimum) at the point where $\frac{x}{y}=\frac{a}{b}$

I think this is too specific. I thought of maximizing any function $z(x,y)$ along any (well behaved: continuous, differentiable, etc) curve $y=f(x)$.

What I thought of is:

Suppose we're currently at a point $(x_1,f(x_1))$. Now, what direction we'd have to take to get to this point's nearest neighbour point along the curve $y=f(x_1)$? Suppose we change $x_1$ by an infinitesimally small amount $dx$. Then change in $y$ would be $f'(x_1)dx$.

So, we'd have to change by the vector $dx \hat{i}+ f'(x_1)dx \hat{j}$ to go to a neighbouring point along the curve.

The change in $z(x,y)$ as we move from $(x_1, f(x_1))$ to this neighbour point on the curve is given by its gradient dotted with the change vector ($dx \hat{i}+ f'(x_1)dx \hat{j}$)

So, change in $z$ is:

$$\left( \frac{\partial z}{\partial x} \hat{i} + \frac{\partial z}{ \partial y} \hat{j}\right)\cdot \left(dx \hat{i}+ f'(x_1)dx \hat{j}\right) $$

$$=\frac{ \partial z}{\partial x} dx + \frac{\partial z}{\partial y} f'(x_1)dx$$

If the function is maximum (or minimum) at $(x_1, f(x_1))$, then this change should be 0.

So, $$\frac{ \partial z}{\partial x} dx + \frac{\partial z}{\partial y} f'(x_1)dx=0$$

which gives

$$\frac{ \partial z}{\partial x} + \frac{\partial z}{\partial y} f'(x_1)=0$$

Have I got this condition right? The condition for the function to be maximum (or minimum) along the curve? In the special case that $y=f(x)$ is a circle and $z=ax+by$, my equation gives us the familiar condition $\frac{x_1}{f(x_1)}=\frac{a}{b}$.

Best Answer

If I understand correctly, your equation for the infinitesimal change in $z$ is essentially a differential taken for infinitesimal change in the direction $\langle 1, f'(x_1) \rangle$. And when you divide out the $dx$, the equation becomes something like a directional derivative of $z(x, y)$, only the "direction" $\langle 1, f'(x_1) \rangle$ may not be a unit vector. The magnitude of the direction does not matter though, if we are only considering points where the derivative is 0.

This sounds right to me. If a point were a maximum or minimum, the directional derivative cannot be nonzero, because that would imply the function increases immediately in some direction. So it must be 0 at the candidate extrema. Keep in mind that just because the derivative is 0 doesn't guarantee an actual minimum or maximum point; it could also be a saddle/inflection point.

As a side note, the original problem you're considering, maximizing/minimizing a function of two variables given a constraint that $y = f(x)$, sounds awfully like a Lagrange multipliers question, with the constraint being $0 = g(x, y) = f(x) - y$. That is another, more mainstream way of approaching the problem.