I want to learn how to find adjoints for operators. I was told the adjoint of the operator $M(f(x))=-f'(x)-xf(x)$, using integration by parts, is $N(f(x))=f'(x)-xf(x)$.
Main question: How do I find the adjoint?
I don't see how to use the definition here. The definition states that the adjoint $N$ is defined by $\langle Mx,y\rangle=\langle x,Ny \rangle$. What is an inner product of this form? I don't know how $\langle Mx,y\rangle$ is defined.
Minor Question: How is integration by parts being employed?
Let us rewrite the relationship between $M$ and its transposed operator $N$ with $x$ and $y$ replaced by $f$ and $g$:
$$ \langle Mf,g\rangle=\langle f,Ng \rangle$$
It suffices to check that:
$$\int (Mf)(x)g(x)dx=\int f(x)(Ng)(x)dx$$
Or:
$$\int (-f'(x)-x f(x))g(x)dx=\int f(x)(g'(x)-x g(x))dx$$
which is true, by using integration by parts.
Remark : in the integration by parts, we have assumed that the "integrated part" [...]$_a^b$ is zero.
if the integration domain is $\mathbb{R}$, it will be necessary for this that all functions $f,g \cdots$ tend to $0$ at infinity (the case underlined by @copper.hat).
if the integration domain is a bounded interval [$a,b$], one will have the following conditions: $f(a)=g(a)=f(b)=g(b)=0$.