A man wants to walk from point $A$ to point $B$. It is given that Point $A$ will always be in Quadrant II, and point $B$ will always be in Quadrant I. When walking in Quadrant II, the man's speed is $v_1$ miles per hour, but when walking in Quadrant I, his speed is $v_2$ miles per hour. Given Point $A$ and Point $B$, and the speeds in both Quadrants, what is the shortest possible travel time to reach Point $B$?
What I have tried:
If we let Point $A$ be $(x_1, y_1)$ and Point $B$ be $(x_2, y_2)$, we can write a function in terms of the intercept when the path crosses the y-axis. Let the intercept be x.
The distance from Point $A$ to the intercept is the distance from $(x_1, y_1)$ to $(0, x)$, or $\sqrt{x_1^2+(y_1-x)^2}$.
Since the speed in Quadrant II is $v_1$, the time spent there will be $\dfrac{\sqrt{x_1^2+(y_1-x)^2}}{v_1}$.
The same approach can be used in the Quadrant I, yielding $\dfrac{\sqrt{x_2^2+(y_2-x)^2}}{v_2}$.
The total time then, in terms of the intercept, would be $f(x)=\dfrac{\sqrt{x_1^2+(y_1-x)^2}}{v_1}+\dfrac{\sqrt{x_2^2+(y_2-x)^2}}{v_2}$.
The optimal solution occurs at the minimum of this function, or when the derivative is $0$.
I am clueless on how to move forwards, so any guidance would be appreciated.