4. Given the equation $|x-2 n|=k \sqrt{x}(n \in \mathbf{N})$ has two distinct real roots in the interval $(2 n-1,2 n+1]$, then the range of $k$ is
A. $k>0$
B. $0<k \leqslant \frac{1}{\sqrt{2 n+1}}$
C. $\frac{1}{2 n+1}<k \leqslant \frac{1}{\sqrt{2 n+1}}$
D. None of the above
Solution
As shown in the figure, when $y=k \sqrt{x}$ passes through the point $(2 n+1,1)$, we have $1=k \sqrt{2 n+1} \Rightarrow k=\frac{1}{\sqrt{2 n+1}}$. At this time, the equation $|x-2 n|=k \sqrt{x}$ has two distinct real roots in the interval $(2 n-1,2 n+1]$. Combining the graph, we can see that the range of $k$ is $0<k \leqslant \frac{1}{\sqrt{2 n+1}}$. Therefore, the correct choice is $B$.