Conventionally, I have the sum of an infinite number of harmonic oscillators with the free Hamiltonian $H_{0}$ to be $$ \begin{equation} H_{0} = \sum_{k}\hbar\omega_{k}\left(a_{k}^{\dagger}a_{k} + \frac{1}{2}\right) \tag{1} \end{equation} $$ where $a_{k}$ represents the annihilation operator in the $k$-space. I wish to obtain a field theoretic representation of $a_{k}$ and transforming it to a field operator, namely, $a(x)$. In particular my transformation should lead to $$ H_{0} = \int dx\left\{a^{\dagger}(x)(-i\hbar v\frac{\partial}{\partial x})a(x)\right\}\,\,\,\,\,\,\,(2) $$ where $v$ is the phase velocity of the the oscillator. Here are my initial steps: I have the definition of the FT of $a_{k}$ to be $$ a_{k} = \frac{1}{\sqrt{L}}\int dx e^{-ikx}a(x)\,\,\,\,\,\,\,(3) \\ a_{k}^{\dagger} = \frac{1}{\sqrt{L}}\int dx e^{-ikx}a^{\dagger}(x)\,\,\,\,\,\,\,(4) $$ where $L$ is the normalization length (1 dimensional). I know that going from summation in $k$ to an integral is given as $$ \sum_{k} \longrightarrow \frac{L}{2\pi}\int dk\,\,\,\,\,\,\,(5) $$ Using Eqs. (3)-(5) and substituting into Eq. (1), I have $$ H_{0} = \frac{L}{2\pi}\int dk\,\hbar\omega_{k}\left(\frac{1}{\sqrt{L}}\int dx\,e^{-ikx}a^{\dagger}(x)\right)\left(\frac{1}{\sqrt{L}}\int dx^{\prime}\,e^{-ikx^{\prime}}a^{\dagger}(x^{\prime})\right) \\ = \frac{\hbar}{2\pi}\int dk\,\omega_{k}\int\int dx\,dx^{\prime}\left(e^{-ik(x+x^{\prime})}a^{\dagger}(x)a(x^{\prime})\right)\,\,\,\,\,\,\,(6) $$ At this point, I know that I could use the definition of dirac delta. Since $$ \delta(x+x^{\prime}) = \frac{1}{2\pi}\int dk\,e^{ik(x+x^{\prime})} \,\,\,\,\,\,\,(7) $$ but what of $\omega_{k}$? If I blindly substitute my definition for the dirac delta, I have $$ H_{0}=\hbar\int\int\omega_{k}a^{\dagger}(x)a(x^{\prime})\delta(-x-x^{\prime})dx\,dx^{\prime} \\ = \hbar\omega_{k}\int dx\,a^{\dagger}(x)a(-x) \,\,\,\,\,\,\,(8) $$ which I absolutely do not believe, since $\omega_k$ should have been absorbed into the $dk$ integral. How should I proceed in general?
Edit: Looking at Eq.(2), it contains $-i\hbar\partial_{x}$ which suggests that the momentum operator is at play somehow. I know that $\omega_{k} = vk$, so if $k$ is an operator, I would be able to act on $a^{\dagger}(x)a(x^{\prime})$ somehow to give me the form of Eq.(2), but $\omega_k$ is scalar in this case so I'm not sure how to proceed.
Edit 2: As suggested by @Heidar, I should start with the IFT of Eq.(3). As such I have that $$ a(x) = \frac{1}{\sqrt{L}}\int dk\,e^{ikx}a_{k} $$ Taking $\partial_{x}$ $$ \partial_{x}a(x) = \frac{i}{\sqrt{L}}\int dk\,ke^{ikx}a_{k} \\ -i\partial_{x}a(x) = \frac{1}{\sqrt{L}}\int dk\,ke^{ikx}a_{k} $$ at this point, I'm not sure of how i should get rid of the $k$ so that I have something like $-i\partial_{x}a(x) = ka_{k}$. Any help is appreciated.
Edit: Looking at this problem again after several months. I noticed that there was a mistake in @Heidar 's answer. In particular, the equality $$ [\partial_x a^\dagger(x)]^\dagger=\partial_{x}a(-x) $$ is not correct. If $$ a(x)\propto \int dk \exp(ikx)a_k \\ a^\dagger(x)\propto \int dk \exp(ikx)a_k^\dagger $$ then $$ \partial_x a(x)\propto \int dk \exp(ikx)ik a_k \\ \partial_x a^\dagger(x)\propto \int dk \exp(ikx)ik a_k^\dagger $$ But $$ [\partial_x a^\dagger(x)]^{\dagger}\propto \int dk \exp(ikx)(-ika_k) $$ and $$ \partial_x a(-x)\propto \int dk \exp(-ikx)ik a_k $$ and the right hand side of the last two equations are not equivalent. How should one correct for this? Or am I missing something here?