How Can I Find The Commutator of this of these $2$ operators (quantum)? I am a little confused about this. So take this operator here:
$$\hat a = \frac{m\omega \hat x + i\hat p_x}{\sqrt{m\omega \hbar}}$$
Where $\hat x$ is the position operator which is just $x$.
And $\hat p_x$ is the momentum in the x-direction operator, which is $-i\hbar \frac{\partial}{\partial x}$.
And $m,\omega$ are respectively the mass of a particle in a harmonic potential, and its oscillation frequency.
I need to workout what the commutator $[\hat a,\hat a^\dagger]$ would be equal to.
I know the commutator of $[a,b]=ab - ba$
But I don't know how to complex transpose $\hat a$ in this situation, also it has a partial derivative - which makes me even more confused.
Could anyone shed some light on how I can approach this question and what steps I should take to get the commutator value?
I look forward to hearing your responses.
 A: Note that $-i\hbar\, \partial_x$ is not the momentum operator, but the momentum operator evaluated in the position-representation, i.e. we have that $\langle x|\hat{p} = -i\hbar\,\partial_x \langle x|$. So you do not have to replace $\hat{p}_x$ with the partial derivative at all; just leave it as $\hat{p}_x$.
Also note that both the position and the momentum operator are hermitian such that $\hat{x}^\dagger = \hat{x}$ and $\hat{p}^\dagger = \hat{p}$.
Regarding your first question: You need basic properties of the adjoint of an operator. For example, you could use the fact that for two operators, $\hat{A}$ and $\hat{B}$, the adjoint of their sum is given as the sum of their adjoints:
$\left(\hat{A}+ \hat{B}\right)^\dagger = \hat{A}^\dagger + \hat{B}^\dagger$. Additionally, you can make use of the following property: $\left(\lambda\, \hat{A}\right)^\dagger = \bar{\lambda}\, \hat{A}^\dagger$, where $\lambda \in \mathbb{C}$.
You can apply these rules to find $\hat{a}^\dagger$. To evaluate the commutator between $\hat{a}$ and $\hat{a}^\dagger$, you further need the canonical commutation relation $[\hat{x},\hat{p}] = i\hbar$, which was derived in the answer by J. Murray above.
I hope this helps.
A: The trick here is always to supply a test function $f$ for the operators to act on.  From there,
$$[\hat a,\hat a^\dagger] f = \hat a\big( \hat a^\dagger f) - \hat a^\dagger\big( \hat a f)$$
As an example for the position and momentum operators,
$$[\hat x,\hat p]f = \hat x\big(\hat p f) - \hat p(\hat x f) = x\big(-i\hbar f'(x)\big) +i\hbar \frac{d}{dx}\big(x f(x)\big)$$
$$ = -i\hbar xf'(x) + i\hbar f(x) + i\hbar xf'(x) = i\hbar f(x)$$
$$\implies [\hat x,\hat p] = i\hbar \mathbb I$$
where $\mathbb I$ is the identity operator.
A: $\newcommand\dag\dagger$
You can proceed as follows (as my professor did when he explained the topic), defining two ausiliar operators:
$ \hat{x}'= \sqrt{\frac{m \omega}{\hbar}} \hat{x}$,
$ \hat{p}'= \frac{1}{\sqrt{m \omega \hbar}} \hat{p}$
So rewriting both $a$ and $a^\dag$ in function of $\hat{x}', \hat{p}'$ they are
$a=\frac{\hat{x}'+i\hat{p}'}{\sqrt 2}$, $a^\dag=\frac{\hat{x}'-i\hat{p}'}{\sqrt 2}$
Then $$[a,a^\dag]=\frac{1}{2}[\hat{x}'+i\hat{p}',\hat{x}'-i\hat{p}']
\\=\frac{1}{2}\bigl([\hat{x}',\hat{x}']-[\hat{x}',i\hat{p}']+[i\hat{p}',\hat{x}']-[i\hat{p}',i\hat{p}']\bigr)\\ =\frac{1}{2}\bigl(-i[\hat{x}',\hat{p}']+i[\hat{p}',\hat{x}']\bigr) $$
Where the following were used: $[A,A]=0$ and $[iA,B]=i[A,B]=[A,iB]$ (the latest: $[iA,B]=iAB-BiA=iAB-iBA=i[A,B]$).
Now considering that since $[\hat{x},\hat{p}]=i \hbar$ then $$[\hat{x}',\hat{p}']=\sqrt{\frac{m \omega}{\hbar}}\cdot \frac{1}{\sqrt{m \omega \hbar}}[\hat{x},\hat{p}]=\frac{1}{\hbar}i \hbar=i$$ sobstituing in the previouses and remembering that $[A,B]=-[B,A]$,:
$$=\frac{1}{2}\bigl( -i^2+i(-i)\bigr)=\frac{1}{2}2=1$$
Then $$[a, a^\dag]=1$$
