# Partial Derivatives

1. Nov 4, 2008

### ritwik06

1. The problem statement, all variables and given/known data
The original problem:
$$z=\sqrt{(x1-x)^2+(y1-y)^2}+\sqrt{(x2-x)^2+(y2-y)^2}$$
Given that: ax+by+c=0, Find the minimum possible value of z.
x1,y1,x2,y2,a,b and c are constants.

3. The attempt at a solution

I think I need to apply the partial derivative. I would get a relation in x and y. I have a second relation in x and y which might simultaneously solve.
But my concepts of partial derivative seem shaky. I don't know how to find the least value of a function which is dependent on 2 variables. I tried going through the articles given in wikipedia and wolfram(Mathworld) but they dont talk about the minimum value of such a function. I would also like to draw your attention to my previous post:

I hope someone will help me understand this!!

2. Nov 4, 2008

### Office_Shredder

Staff Emeritus
You know that if you're at a minimum value of a function f(x), it must be that df/dx=0 right? The same concept applies... you have a function z(x,y). Hold x constant. Then if z is a minimum, it must be dz/dy = 0. (treating x as a constant in the derivative. This is a partial derivative). Now hold y constant instead. dz/dx=0 is necessary for it to be a minimum. So for z to be a minimum at a point, you have to have dz/dx=dz/dy=0 at the point

3. Nov 4, 2008

### gabbagabbahey

Hint: What do you know about the total derivative of a function, at a local minimum or maximum?

In this case the function your looking to find the minimum of is $z(x,y)$...Use that chain rule to find $dz$ in terms of the partial derivatives $$\frac{\partial z}{\partial x}$$, $$\frac{\partial z}{\partial y}$$ and $dx$ and $dy$

As for incorporating your constraint equation, have you studied Lagrange multipliers yet?

4. Nov 4, 2008

### tiny-tim

Hi ritwik06!

I don't know whether you're allowed to do it this way, but you can do it by ordinary geometry.

Call (x1,y1) and (x2,y2) A and B. Call ax+by+c=0 the line L, then you're looking for the point P = (x,y) on L with PA + PB = minimum.

Hint: do the case of L lying between A and B first.

5. Nov 4, 2008

### ritwik06

The total derivative should be 0.
whats the chain rule?

What are these? If you can give me some links I will definitely make my best efforts to go through them.

6. Nov 4, 2008

### ritwik06

I can easily see that this would be the case when what you call P lies on line connecting A and image of b in the given line. Right? But I want to do it this way!

7. Nov 4, 2008

### gabbagabbahey

Yes, $dz=0$ at a local max/min.

The chain rule for a function $z(x,y)$of two variables $x$ and $y$ is:

$$dz=\left| \frac{\partial z}{\partial x} \right| d x +\left| \frac{\partial z}{\partial y} \right| d y$$

Here is a link for lagrange multipliers: http://en.wikipedia.org/wiki/Lagrange_multipliers....feel free to ask me any questions you might have on them.

8. Nov 4, 2008

### ritwik06

Lagrange's Multipliers seem interesting! Though I don't think I may be able to grasp the proof with my current level of knowledge. But I think I can remember it as a law for the time being.
But when I applied this to my problem, it resulted in huge equations and I dont think I might be able to solve them
As directed i assume a function say $$\Delta(x,y,\lambda)$$

$$\Delta(x,y,\lambda)$$=z+$$\lambda(ax+by+c)$$

setting partial derivatives to 0;
$$\frac{\partial \Delta}{\partial x}=\frac{x-x1}{\sqrt{(x1-x)^{2}+(y1-y)^{2}}}+\frac{x-x2}{\sqrt{(x2-x)^{2}+(y2-y)^{2}}} + \lambda a=0$$

$$\frac{\partial \Delta}{\partial y}=\frac{y-y1}{\sqrt{(x1-x)^{2}+(y1-y)^{2}}}+\frac{y-y2}{\sqrt{(x2-x)^{2}+(y2-y)^{2}}} + \lambda b=0$$

$$\frac{\partial \Delta}{\partial \lambda}=ax+by+c=0$$

But how am I going to solve this now???? Arent these too huge?

9. Nov 4, 2008

### gabbagabbahey

If you put your first two equations over a common denominator, then you will only need to worry about where the numerator is zero....It's still a fair bit of algebra, but it's not too bad.

Alternatively, since you can probably already guess the answer from TinyTim's Geometrical method, it's probably good enough to just show that your guess satisfies all three of the above equations.