The goal is to find the stationary points of the function $$f(x)=\frac{y}{x-4\times10^{-5}}-\frac{1}{x^2}$$ for $y=7000$ using Mathematica. The input used was
f[x_] := (y)/(x - 4*^-5) - 1/x^2
y = 7000
Solve[D[f[x]] == 0, x]
Plot[f[x], {x, 8*^-5, 20*^-5}]
For $1<y<3500$, Solve outputs two real solutions as expected. For larger values of say $y>7000$ then Solve outputs complex-valued solutions, indicating that D[f[x]]=0 has no real solutions. However, the plot shows that there are two real solutions, although only a precise level of zooming will show this.
Is the code incorrect for this purpose? Or is Mathematica just not able to solve the equation?

f[x_] := (y)/(x - k) - 1/x^2 y = 7000 Solve[D[f[x]] == 0, x]You get two roots(1 - Sqrt[1 - 28000 k])/14000and(1 + Sqrt[1 - 28000 k])/14000but if 28000 * k is bigger than 1 so the square roots have negative numbers under them, hence if k is 410^-5 we get Sqrt[1 - 280004*10^-5] which is Sqrt[-(3/25)], and you get complex values. – flinty May 14 '23 at 10:37{{x -> 1/12500}, {x -> 1/12500}}which are exactly the same. – flinty May 14 '23 at 10:48D[f[x]]doesn't do anything. If you want a derivative with respect to $x$, you need to specify it:D[f[x], x]. – Roman May 14 '23 at 11:14