${\varepsilon}$. It can be replaced by $1+\kappa_1{\varepsilon}^2$, for ${\varepsilon}{\leqslant}1$. To see this we slightly translate the function  to the left by an amount $-{\varepsilon}b$ and introduce $$\begin{gathered}
\eta_{{\varepsilon},b}(t)=\frac{3}{2{\varepsilon}^3}(t-1+{\varepsilon}b)^2{{\ensuremath {\mathds 1} }}(1-{\varepsilon}b{\leqslant}t{\leqslant}1+(1-b){\varepsilon})\\+\frac{3}{2{\varepsilon}^3}(1+(2-b){\varepsilon}-t)^2{{\ensuremath {\mathds 1} }}(1-{\varepsilon}b+{\varepsilon}{\leqslant}t{\leqslant}1+(2-b){\varepsilon}).
\label{eq:choice_eta_2}\end{gathered}$$ Then we have $$\begin{gathered}
\int_0^{\infty}\eta_{{\varepsilon},b}(t)\frac{dt}{t}=1 + (b-1 ){\varepsilon}+ \left(\frac{11}{10} - 2 b + b^2\right) {\varepsilon}^2\\
+ \left(-\frac{13}{10} + \frac{33}{10}{\varepsilon}- 3 b^2 + b^3\right) {\varepsilon}^3+O({\varepsilon}^4) \end{gathered}$$ and $$\begin{gathered}
\int_0^{\infty}\eta_{{\varepsilon},b}(t)t^{\frac2d}\,dt=1 - \frac2d (b-1) {\varepsilon}\\ + \frac{1}{10d^2}\big(22 - 40 b + 20 b^2 - 11 d + 20 b d - 10 b^2 d\big) {\varepsilon}^2+O({\varepsilon}^3). \end{gathered}$$ The unique $b_{\varepsilon}$ such that $\int_0^{\infty}\eta_{{\varepsilon},b_{\varepsilon}}(t)\frac{dt}{t}=1$ satisfies $$b_{\varepsilon}=1-\frac{{\varepsilon}}{10}-\frac{3}{350}{\varepsilon}^3+O({\varepsilon}^4)$$ and for this $b_{\varepsilon}$ we have $$\int_0^{\infty}\eta_{{\varepsilon},b_{\varepsilon}}(t)t^{\frac2d}\,dt=1 +\frac{2+d}{10d^2}{\varepsilon}^2+O({\varepsilon}^4),$$ $$\int_0^{\infty}\frac{t^2\eta_{{\varepsilon},b_{\varepsilon}}'(t)^2}{\eta_{{\varepsilon},b_{\varepsilon}}(t)}\,dt=\frac{12}{{\varepsilon}^2}+O(1).$$ This is how we can get  for ${\varepsilon}$ small enough (after replacing ${\varepsilon}^2$ by ${\varepsilon}$).

In the 3D case we can take for instance $b=1-{\varepsilon}/10-4{\varepsilon}^3/350$. One can then verify that $$\int_0^{\infty}\eta_{{\varepsilon},b}(t)\frac{dt}{t}{\leqslant}1,\quad \int_0^{\infty}\eta_{{\varepsilon},b}(t)t^{\frac23}\,dt{\leqslant}1+\frac{{\varepsilon}^2}{15}$$ and $$\int_0^{\infty}\frac{t^2\eta_{{\varepsilon},b_{\varepsilon}}'(t)^2}{\eta_{{\varepsilon},b_{\varepsilon}}(t)}\,dt{\leqslant}\frac{19}{{\varepsilon}^2}$$ for all ${\varepsilon}{\leqslant}1$. Hence $$T(\rho){\leqslant}c_{\rm TF}\left(1+\frac{{\varepsilon}^2}{15}\right)\int_{{\mathbb{R}}^3}\rho(x)^{\frac53}dx
 +\frac{19}{{\varepsilon}^2}\int_{{\mathbb{R}}^3}|\nabla\sqrt{\rho}(x)|^2\,dx,\qquad\forall {\varepsilon}{\leqslant}1.
 \label{eq:upper_bound_T_1}$$ Combining with , we find the estimate  for $\kappa_1=1$ and $\kappa_2=48$.

Upper bound on $E(\rho)$
------------------------

It is well known that any fermionic one-particle density matrix $\gamma$ (i.e., an operator satisfying $0{\leqslant}\gamma=\gamma^*{\leqslant}1$) is representable by a quasi-free state $\Gamma_\gamma$ in Fock space [@BacLieSol-94]. The two-particle density matrix of such a state is 