# Help with making a function

## Homework Statement:

Ann is in point ##(2,0)## and walks to KFC in ##(-2,0)##.On her way there’s a pond within the curve ##\big|x \big|+\big|y \big|=1##.She walks 5 km/h outside the pond and ##\frac{5\sqrt{5}}{2\sqrt{2}}## km/h in the pond. In which point does she enter the pond, or should she walk around?

## Relevant Equations:

The derivative.
Ok. So if i sketch the curve I can see that this pound has a shape of a square. Ann and KFC has the same distance from the pond. I'm able to calculate the time for Ann to walk around the pond, and if she walks in a straight line from where she stands to KFC.
If she walks around it will take about 0,96 hours and if she walks in straight line (enter pond in 1,0), it will take her 0,90. I did this using some simple geometry. But I don't know if Ann should rather enter the pond somewhere else to save time. So this must be an extreme value problem where I should make some sort of a function and find the derivative. I might be wrong about this, but that's the only assumption I have for now. How do I make such a function?

## Answers and Replies

Related Calculus and Beyond Homework Help News on Phys.org
Orodruin
Staff Emeritus
Homework Helper
Gold Member
Assume that she enters the pond at some y value (by symmetry, she must stay at that y value within the pond) and compute the corresponding total time. Minimize wrt y.

Assume that she enters the pond at some y value (by symmetry, she must stay at that y value within the pond) and compute the corresponding total time. Minimize wrt y.
Hmm, I'm not sure If I understand correctly. So if she enters at point (0.8, 0.2) she will leave the pond at point (-0.8, 0.2)? I don't understand the symmetry. Why will she stay at that y value within the pond?

Orodruin
Staff Emeritus
Homework Helper
Gold Member
So if she enters at point (0.8, 0.2) she will leave the pond at point (-0.8, 0.2)?
Yes.

I don't understand the symmetry. Why will
Because the solution must be symmetric to be optimal. The argument is fairly simple. Consider the point where you cross x = 0. Minimizing time given that y(0) on both sides will give you the minimum total given that y(0). Both sides look exactly the same (just mirrored), so the solution must be symmetric. You can extend this argument to conclude that y is constant in the pond (try to do that yourself).

Edit: Note that if you had a non-symmetric path, then one of the sides would give a shorter time and the time could be made shorter by replacing the other side of the path by the mirror image of the shorter time side.

HallsofIvy
Homework Helper
Yes, she needs to cross the pond but, since she walks slower in the pond, she wants to make that part as small as possible. She can do that by walking directly from (x, y) to (-x, y). Now the portion of the boundary of the pond in the first quadrant is given by |x|+ |y|= x+ y= 1 or y= 1- x. So she first walks from (2, 0) to (x, 1- x), a distance of $\sqrt{(x-2)^2+ (1- x)^2}$ km. She walks that at 5 km/h so the time required to walk that is $\left(\sqrt{(x-2)^2+ (1- x)^2}\right)/5$ hours. (You don't say what units x and y are in but since you give her speed in "km/h" I will assume they are in km.). In the second quadrant, the edge of the pond is given by |x|+ |y|= -x+ y= 1 so y= x+ 1. She walks, in the pond, at $\frac{5\sqrt{5}}{2\sqrt{2}}$ from x to -x, a distance of 2x, which requires $\frac{5\sqrt{5}}{\sqrt{2}}x$ hours. Finally the last leg of the trip is, again by symmetry, the same as the first so also takes $\left(\sqrt{(x-2)^2+ (1- x)^2}\right)/5$ hours. The entire journey takes $\left(2\sqrt{(x-2)^2+ (1- x)^2}\right)/5+ \frac{5\sqrt{5}}{\sqrt{2}}x$. Set the derivative of that equal to 0 and solve for x.

Yes, she needs to cross the pond but, since she walks slower in the pond, she wants to make that part as small as possible. She can do that by walking directly from (x, y) to (-x, y). Now the portion of the boundary of the pond in the first quadrant is given by |x|+ |y|= x+ y= 1 or y= 1- x. So she first walks from (2, 0) to (x, 1- x), a distance of $\sqrt{(x-2)^2+ (1- x)^2}$ km. She walks that at 5 km/h so the time required to walk that is $\left(\sqrt{(x-2)^2+ (1- x)^2}\right)/5$ hours. (You don't say what units x and y are in but since you give her speed in "km/h" I will assume they are in km.). In the second quadrant, the edge of the pond is given by |x|+ |y|= -x+ y= 1 so y= x+ 1. She walks, in the pond, at $\frac{5\sqrt{5}}{2\sqrt{2}}$ from x to -x, a distance of 2x, which requires $\frac{5\sqrt{5}}{\sqrt{2}}x$ hours. Finally the last leg of the trip is, again by symmetry, the same as the first so also takes $\left(\sqrt{(x-2)^2+ (1- x)^2}\right)/5$ hours. The entire journey takes $\left(2\sqrt{(x-2)^2+ (1- x)^2}\right)/5+ \frac{5\sqrt{5}}{\sqrt{2}}x$. Set the derivative of that equal to 0 and solve for x.
Thank you so much! It was a really good explanation. The only thing I'm wondering about. You write ##\frac{5\sqrt{5}}{\sqrt{2}}x##, but time is equal to distance/speed. So won't it be ##2x*\frac{2\sqrt{2}}{5\sqrt{5}}##??

Yes, she needs to cross the pond but, since she walks slower in the pond, she wants to make that part as small as possible. She can do that by walking directly from (x, y) to (-x, y). Now the portion of the boundary of the pond in the first quadrant is given by |x|+ |y|= x+ y= 1 or y= 1- x. So she first walks from (2, 0) to (x, 1- x), a distance of $\sqrt{(x-2)^2+ (1- x)^2}$ km. She walks that at 5 km/h so the time required to walk that is $\left(\sqrt{(x-2)^2+ (1- x)^2}\right)/5$ hours. (You don't say what units x and y are in but since you give her speed in "km/h" I will assume they are in km.). In the second quadrant, the edge of the pond is given by |x|+ |y|= -x+ y= 1 so y= x+ 1. She walks, in the pond, at $\frac{5\sqrt{5}}{2\sqrt{2}}$ from x to -x, a distance of 2x, which requires $\frac{5\sqrt{5}}{\sqrt{2}}x$ hours. Finally the last leg of the trip is, again by symmetry, the same as the first so also takes $\left(\sqrt{(x-2)^2+ (1- x)^2}\right)/5$ hours. The entire journey takes $\left(2\sqrt{(x-2)^2+ (1- x)^2}\right)/5+ \frac{5\sqrt{5}}{\sqrt{2}}x$. Set the derivative of that equal to 0 and solve for x.
Yes.

Because the solution must be symmetric to be optimal. The argument is fairly simple. Consider the point where you cross x = 0. Minimizing time given that y(0) on both sides will give you the minimum total given that y(0). Both sides look exactly the same (just mirrored), so the solution must be symmetric. You can extend this argument to conclude that y is constant in the pond (try to do that yourself).

Edit: Note that if you had a non-symmetric path, then one of the sides would give a shorter time and the time could be made shorter by replacing the other side of the path by the mirror image of the shorter time side.
Thank you so much for your help (both of you). You really saved my day! :) The answer I got was that Ann will enter the pond at (0.5, 0.5) or (0.5, -0.5) given the symmetry. I hope this is right!

LCKurtz
Homework Helper
Gold Member
Yes, that is correct. But you have to wonder if less than a minute savings is worth the time to take your shoes off and put them back on.

HallsofIvy
Homework Helper
Why are you assuming Amy is wearing shoes?

LCKurtz
Homework Helper
Gold Member
Why are you assuming Amy is wearing shoes?
Good point. She could have been at Burning Man and wearing nothing at all.

HallsofIvy