We have the voltage divider and the upper resistor changes his resistance value from Rmin to Rmax.

And I want to find the lower resistor value (R2) that gives me the larges output voltage "swing".

\[ V_{DIFF} = V_{CC} * \frac{R_2}{R_2 + R_{min}} - V_{CC} * \frac{R_2}{R_2 + R_{max}} \]

\[ V_{DIFF} = V_{CC} *\left( \frac{R_2}{R_2 + R_{min}} - \frac{R_2}{R_2 + R_{max}}\right) \]

\[ \frac{V_{DIFF}}{V_{CC}} = \frac{R_2}{R_2 + R_{min}} - \frac{R_2}{R_2 + R_{max}} \]

And I think the question is how to find the derivative of this function?