I am trying to find the adjoint of a system of differential equations. My equation looks like
$\dot a_i (t) = C_i + \sum_{j=1}^N L_{ij} a_i + \sum_{j=1}^{N} \sum_{k=1}^{N} a_j Q_{ijk} a_k$
Here $a_i(t):[0,T] \rightarrow C^{\infty}([0,T] \times \mathbb{R}^d)$
I now define the operator L as
$L(\mathbf{a(t)}) = C_i + \sum_{j=1}^N L_{ij} a_i + \sum_{j=1}^{N} \sum_{k=1}^{N} a_j Q_{ijk} a_k $
I need to find an operator M such that
$ \langle L(\mathbf{a(t)}) , \psi \rangle = \langle a(t), M \psi \rangle $
How do I go about doing that? I am confused mainly with the handling the index
My attempt is as follows we need M such that
$\langle \frac{d\mathbf {a}}{dt}, \mathbf{\psi} \rangle = \langle \mathbf{a} , M \mathbf{\psi} \rangle$
$\langle C_i + L_{ij} a_j + Q_{ijk} a_j a_k, \psi_i \rangle = \langle \mathbf{a(t)}, M \psi \rangle$, where I have used the summation convention
where the inner product $\langle u , \psi\rangle$ is defined as $\int_0^T u(t) \psi(t) dt$, here $\psi\in C_0^{\infty} [0,T]$
The above can be expanded as
$\langle C_i, \psi_i \rangle + \langle L_{ij} a_j, \psi_i \rangle+\langle Q_{ijk}a_j a_k, \psi_i \rangle$
$=\int_{0}^T C_i \psi_i dt+ \int_0^T L_{ij} a_j \psi_i dt + \int_0^T Q_{ijk} a_j a_k \psi_i dt $
The first term due to integration by parts can be written as $\int_{0}^T C_i \psi_i dt = \left[C_i \psi_i\right]_0^T-\int_0^T \psi_i \delta C_i dt$ which is zero due to the boundary condition on $\psi$ and variation $\delta C_i=0$
The second term is $ \langle L_{ij} a_j, \psi_i \rangle = \left[L_{ij}a_j\psi_i\right]_0^T-\int_0^T L_{ij} \psi_i \delta a_j dt$
Again the first term vanishes due to the boundary condition on $\psi$
The third term can be written after integration by parts
$\langle Q_{ijk}a_j a_k, \psi_i \rangle = -\int_0^T \left(Q_{ijk} \delta a_j a_k + Q_{ijk} a_j \delta a_k \right)\psi_i dt $
Is my approach till now correct?
How do I now visualize the adjoints based on the original definition i.e.
$ \langle L(\mathbf{a(t)}) , \psi \rangle = \langle a(t), M \psi \rangle $