# Math Help - Calculus Optimization Problem

1. ## Calculus Optimization Problem

This is really tricky

2. ## Re: Calculus Optimization Problem

Let's generalize a bit to say we want to find the quickest path across two media:

We are traveling from point A to point B then to point C by the quickest path possible. The question is, where should point B be placed?

I have set up xy coordinate axes such that:

$O=(0,0)$

$A=(0,-W_1)$

$B=(B,0)$

$C=(L,W_2)$

The distance from A to B is:

$AB=\sqrt{(B-0)^2+(0-(-W_1))^2}=\sqrt{B^2+W_1^2}$

The distance from B to C is:

$BC=\sqrt{(L-B)^2+(W_2-0)^2}=\sqrt{(L-B)^2+W_2^2}$

The speed through medium 1 is $v_1$ and the speed through medium 2 is $v_2$. We assume both velocities are positive values. Thus, using the relationship between distance, constant velocity and time, we find the total time as a function of B is:

$t$$B$$=\frac{\sqrt{B^2+W_1^2}}{v_1}+\frac{\sqrt{(L-B)^2+W_2^2}}{v_2}$

Differentiating with respect to B, we find:

$t'(B)=\frac{B}{v_1\sqrt{B^2+W_1^2}}+\frac{(B-L)}{v_2\sqrt{(L-B)^2+W_2^2}}=\frac{Bv_2\sqrt{(L-B)^2+W_2^2}+(B-L)v_1\sqrt{B^2+W_1^2}}{v_1v_2\sqrt{B^2+W_1^2}\sqrt {(L-B)^2+W_2^2}}$

The denominator will always be positive, so we need only consider:

$Bv_2\sqrt{(L-B)^2+W_2^2}+(B-L)v_1\sqrt{B^2+W_1^2}=0$

$Bv_2\sqrt{(L-B)^2+W_2^2}=(L-B)v_1\sqrt{B^2+W_1^2}$

Let's take a moment to rewrite this:

$\frac{B}{\sqrt{B^2+W_1^2}}\cdot\frac{\sqrt{(L-B)^2+W_2^2}}{L-B}=\frac{v_1}{v_2}$

$\frac{\frac{B}{\sqrt{B^2+W_1^2}}}{\frac{L-B}{\sqrt{(L-B)^2+W_2^2}}}=\frac{v_1}{v_2}$

$\frac{\sin\theta_1}{\sin\theta_2}=\frac{v_1}{v_2}$

Thus, we have shown that Snell's law (or Descartes' law) is satisfied when $t'(B)=0$.