# Rationalize number

I must calculate the critical point on the function

f[x_] := (x^2 - Abs[x - 10])/(x - 5)


After plotting, I looked for the minimum where it looked to be (around 10)

FindMinimum[f[x], {x, 6}]


Got output:

{19.9443, {x -> 9.47214}}

and then tried to rationalize x:

Rationalize[9.472135911356355]

How can I get an exact value?

• The answer by @MariusLadegardMeyer is, in my opinion, the "right" way to go about this. But one can also use the approach in this post, with RootApproximant replacing Rationalize. In[269]:= RootApproximant[NArgMin[{f[x], x >= 5}, x]] Out[269]= 5 + 2 Sqrt[5] – Daniel Lichtblau Jun 20 '18 at 14:06

Use Minimize with a condition that avoids the divergence to $-\infty$:

Minimize[{f[x], x > 5}, x]


{(-5 + 2 Sqrt[5] + (5 + 2 Sqrt[5])^2)/( 2 Sqrt[5]), {x -> 5 + 2 Sqrt[5]}}

It's the same minimum:

N[5 + 2 Sqrt[5]]
`

9.47214

• Thank you Majin Boo, you're best! – Dovendyr Jun 20 '18 at 12:05