A line passes through the point (1, 1/8) and intersects the positive x-axis at the point A and the positive y-axis at the point B. What is the shortest distance between A and B?

Now, I know that a line going through both A and B has the equation:

y = mx + b

where b is the y-intercept, B

and m is the slope of (0,B) and (A,0): -B/A

Does isolating for A or B and then putting it into the distance formula R^2 = A^2 + B^2 and finding the zeros for dR/dB or dR/dA the only method? I seem to get a quartic when I try to do this, so maybe I’m doing the math wrong somewhere?