Definition of the formal $L^2$-adjoint $T^*$ of a linear operator $T:C^\infty(T^*M\odot T^*M)\to C^\infty(M)$ Let $(M,g)$ be a Riemannian manifold, $C^\infty(T^*M\odot T^*M)$ the space of all smooth symmetric $2$-tensor fields on $M$, and $C^\infty(M)$ the space of all smooth functions on $M$. I'd like to know the definition of the formal $L^2$-adjoint $T^*$ of a linear operator $T:C^\infty(T^*M\odot T^*M)\to C^\infty(M)$. For a concrete example of $T$, one can see
Linearization of scalar curvature: $DR|_g(h)=-\Delta_g(\mathrm{tr}_g h)+\mathrm{div}_g(\mathrm{div}_g h)-\langle\mathrm{Ric}_g,h\rangle_g$
to know about the linearized scalar curvature.
In a linear algebra course or a functional analysis course, it is a standard practice to define the adjoint of a linear operator between inner product spaces, but somehow I didn't find too much reference on formal adjoints. So far, I've got only one example: given a closed manifold, we know the gradient operator $\mathrm{grad}$ and $-\mathrm{div}$ are the formal adjoints of each other in the sense that
$$\int_M\langle\mathrm{grad}f,X\rangle_g dV_g=\int_M f(-\mathrm{div}X) dV_g\tag{1}$$
for every $f\in C^\infty(M)$ and every smooth vector field $X$ in $\mathfrak{X}(M)$. How about $T^*$? By analogy with the previous example and my experience of ordinary adjoint operators, it seems like I have to find a linear operator $T^*$ that goes from $C^\infty(M)$ to $C^\infty(T^*M\odot T^*M)$ and satisfies
$$\langle T(A),f\rangle_{L^2}=\langle A,T^*(f)\rangle_\color{red}{?}\tag{2}$$
for every $A\in C^\infty(T^*M\odot T^*M)$ and every $f\in C^\infty(M)$. Having learned the Lebesgue space $L^p(M)$, I don't feel pressured about the $L^2$ bracket in (2), but what should I do with the mysterious bracket in the same equation? Is that an inner product of covariant $2$-tensor fields? Much is appreciated if someone could offer an authoritative reference that clearly defines the formal adjoint of a mapping between spaces of smooth sections of vector bundles. Thank you.
 A: Equation $(2)$ that you stated is exactly how the adjoint operator should be defined, in the sense that we want to have the "integration by parts" formula hold $$\langle T(A), f \rangle_{L^2} = \langle A, T^*(f) \rangle_{L^2}. $$ This is also the exact same way you define the adjoint of a bounded linear operator between two Hilbert spaces.
From the Riemannian metric on $M$, there are canonical fiber metrics on each tensor bundle over $M$, and then you can define the $L^2$ inner product of two tensors using this. For the definition of these fiber metrics, you can have a look in John Lee's Introduction to Riemannian manifolds, Chapter 2.
A: EDIT: Fixed the tensor types of $A$ and $T$. Also, I now see that $T$ could be a differential operator.
You don't say what type of operator $T$ is, but I assume you want it to be a differential operator. My original answer assumed that $T$ was just a tensor map, which is a rather trivial case.
Let's instead assume that $T$ is a first order differential operator. In other words, given $A \in C^\infty(T^*M\otimes T^*M)$, which can be written in local coordinates as
$$
A = A_{ij}\,dx^i\otimes dx^j,
$$
the operator $T: C^\infty(T^*M\otimes T^*M) \rightarrow C^\infty(M)$ is given by
$$
T(A) = \alpha^{ijk}\nabla_kA_{ij},
$$
where $\alpha = \alpha^{ijk}\,\partial_i\otimes\partial_j\otimes\partial_k \in C^\infty(T_*M\otimes T_*M\otimes T_*M)$.
There are two $L^2$ norms here, one for scalar functions,
$$
\langle f,h\rangle_{L^2} = \int_M fh\,dV
$$
and one for $2$-tensors,
\begin{align*}
\langle A,B\rangle_{L^2} &= \int_M \langle A, B\rangle\,dV\\
&= \int_M g^{ip}g^{jq}A_{ij}B_{pq}\,dV
\end{align*}
Therefore, integrating by parts, we get
\begin{align*}
\langle T(A),f\rangle_{L^2} &= \int_M T(A)f\,dV\\
&= \int \alpha^{ijk}\nabla_kA_{ij}f\,dV\\
&= \int (-\nabla_k(\alpha^{ijk}f))A_{ij}\,dV\\
&= \int \langle T^*(f),A\rangle\,dV,
\end{align*}
where $T^*: C^\infty(M) \rightarrow C^\infty(T^*M\otimes T^*M)$ is given by
$$
T^*(f) = -g_{ip}g_{jq}\nabla_k(\alpha^{pqk}f)\,dx^i\otimes dx^j.
$$
