I am learning about operators in vector spaces and I am solving an example mentioned in the book Mathematical Methods for Physicists,Arfkens, Weber, Harris. I am stuck in an example which illustrates the evaluation of the adjoint operator.
The operator A in the space $\mathcal{L}^2[-1,1]$ is given as $$ A = -i \frac{d}{dx} $$
To evaluate the adjoint operator I computed the scalar product $\left < f | Ag\right >$ which leads to $$ \left < f | Ag\right > = \left[ -i f^{*}(x) g(x)\right]_{-1}^{1} + \int_{-1}^{1} \left( -i \frac{df(x)}{dx}\right)^{*}g(x) \ dx $$
Expansion of boundary terms leads to $$ \left < f | Ag\right > = -if(1)^{*}g(1) + if(-1)^{*}g(-1) + \int_{-1}^{1} \left( -i \frac{df(x)}{dx}\right)^{*}g(x) \ dx $$
Can I write these expanded boundary terms using the Delta function( with help of the sifting property) as $$ -if(1)^{*}g(1) = -i \int_{-1}^{1} \delta(x-1)f^{*}(x)g(x)dx \\ if(-1)^{*}g(-1) = i \int_{-1}^{1} \delta(x+1)f^{*}(x)g(x)dx $$
I am unsure how the Delta function will operate when definite limits are used. The textbook gives the following equation which I think is not possible without taking into account the previously mentioned delta function simplification: $$ \int_{-1}^{1} \left( \left[ i \delta(x - 1) - i \delta(x + 1) - i \frac{d}{dx} \right] f(x) \right)^* g(x) \, dx. $$