The answer here will depend on whether you mean .5sqrt(x) or sqrt(.5x)...but the method will be the same.
Write the expression for the distance function between (4,0) and (x,y). Notice here y is shorthand for which ever expression you meant.
Then differentiate that expression which will have a sqrt function in the denominator which can be ignored when you set the derivative to 0. Solve that equation for x and calculate y for that x.
If you are still stuck, please clarify your question (as above) and I will work it through specifically for you.
Nick M.
I’m using sqrt(x/2)03/30/20