[step:Replace the formula by a Boolean combination of parameter comparisons]By [quantifier elimination for dense linear orders](/theorems/4305) without endpoints (citing a result not yet in the wiki: Quantifier Elimination for Dense Linear Orders without Endpoints), the formula $\varphi(x,a_1,\dots,a_n)$ is equivalent in $\mathcal{M}$ to a quantifier-free $\mathcal{L}_{<}$-formula $\psi(x,a_1,\dots,a_n)$.
Since $\mathcal{L}_{<}$ has only the binary relation symbol $<$ and equality, every atomic formula appearing in $\psi$ is one of the forms
\begin{align*}
x<a_i, \qquad a_i<x, \qquad x=a_i, \qquad a_i<a_j, \qquad a_i=a_j, \qquad x=x, \qquad x<x
\end{align*}
for indices $i,j \in \{1,\dots,n\}$. The formulas involving no genuine comparison between $x$ and a parameter, namely $a_i<a_j$, $a_i=a_j$, $x=x$, and $x<x$, have fixed truth values in $\mathcal{M}$: the first two because the parameters are fixed, $x=x$ because equality is reflexive, and $x<x$ because $<$ is irreflexive. Hence $\psi(x,a_1,\dots,a_n)$ determines the same subset of $M$ as a Boolean combination of formulas of the forms
\begin{align*}
x<a_i, \qquad a_i<x, \qquad x=a_i.
\end{align*}[/step]