I am trying to solve/prove this Principal Value integral
$$ \mathscr{P}\int_{-\infty}^{+\infty}\dfrac{x^2\cdot \sin\left(x\right)}{x-a}{\rm{d}}x=\ -\ i\pi a^2\cdot\cos\left(a\right)\ ,$$
where $a$ takes a finite value.
The way I try to prove this is by noticing there pole is a first order pole at $x=a$, then by calculating the Residue at this value I find that
$$ \mathscr{P}\int_{-\infty}^{+\infty}\dfrac{x^2\cdot \sin\left(x\right)}{x-a}{\rm{d}}x =-i\pi \cdot Res\left(\dfrac{x^2\cdot \sin\left(x\right)}{x-a},a\right)= $$
$$ =-i\pi\cdot\lim_{x\rightarrow a}\left(x^2 \cdot \sin\left(x\right)\right) = -i\pi a^2 \cdot {\sin(a)}\ ,$$
which of course is not correct.
Hence, does anyone knows what I am doing wrong, and if yes could please explain it to me?
NOTE: Just to mention that i end up to this question because a made use of Green's function for quantum many-body system. So if anyone have a clue about this they might be able to help.
Thanks in advance.
******* EDIT:
I tried to keep it short, but the truth is that I need to prove this
$$-\dfrac{1}{a^3} \mathscr{P}\int_{-\infty}^{+\infty}\dfrac{x^3\cdot F(x)}{x-a}\dfrac{{\rm{d}}x}{2\pi} = G(a)\ ,$$
where
$$ F(x) = \frac{3}{2}\left[(1-y)\cdot \frac{\sin(x)}{x} + (1-3y)\cdot\left( \frac{cos(x)}{{x^2}} - \frac{sin(x)}{x^3}\right) \right]$$
and
$$ G(a) = \frac{3}{4}\left[-(1-y)\cdot \frac{\cos(a)}{a} + (1-3y)\cdot\left( \frac{sin(a)}{{a^2}} + \frac{cos(a)}{a^3}\right) \right],$$
where $y=const$.
Thanks again for the effort.
Integral $I=P.V.\int_{-\infty}^{+\infty}\dfrac{x^2\cdot \sin\left(x\right)}{x-a}{\rm{d}}x$ makes sense as the function acting in the space of smooth and finite function (in the sense of tempered distribution). https://ncatlab.org/nlab/show/tempered+distribution#:~:text=Formally%2C%20a%20tempered%20distribution%20is,%F0%9D%92%AE%E2%80%B2(%E2%84%9Dn).
Lets evaluate $I(k)=\int_{-\infty}^{+\infty}\dfrac{x^2\cdot \sin\left(kx\right)}{x-a}{\rm{d}}x=\Im{J}(k) $, where the integral is considered in the sense of principal value.
$$J(k)=\int_{-\infty}^{+\infty}\dfrac{x^2e^{ikx}}{x-a}{\rm{d}}x=\int_{-\infty}^{+\infty}\dfrac{(t+a)^2e^{ik(t+a)}}{t}{\rm{d}}t=e^{ika}\int_{-\infty}^{+\infty}e^{ikt}\Bigl(\dfrac{a^2}{t}+2a+t\Bigr)dt$$
$$\int_{-\infty}^{+\infty}\frac{e^{ikt}}{t}=\pi{i}\,sgn(k)$$
$$\int_{-\infty}^{+\infty}e^{ikt}=2\pi\delta(k)$$ $$\int_{-\infty}^{+\infty}te^{ikt}=-2\pi{i}\frac{d}{dk}\delta(k)$$
All these have meaning in the sense of distribution, i.e. if we consider $\int_{-\infty}^{+\infty}J(k)f(k)dk$, where $f(k)$ is a finite function with smooth derivatives:
$$\int_{-\infty}^{+\infty}\delta(k)f(k)dk=f(0)$$ $$\int_{-\infty}^{+\infty}f(k)\Bigl(\frac{d}{dk}\delta(k)\Bigr)dk=-\frac{d}{dk}f(k)|_{k=0}=-f'(0)$$
Therefore, $$J(k)=\pi{i}{a}^2e^{ika}\,sgn(k)+4\pi{a}e^{ika}\delta(k)-2\pi{i}e^{ika}\frac{d}{dk}\delta(k)=$$ $$I(k)=\Im{J}(k)=\pi{a^2}\cos(ka)sgn(k)+4\pi{a}\sin(ka)\delta(k)(=0)-2\pi\cos(ka)\frac{d}{dk}\delta(k)$$ The last term should be understood in the following way:
$$-2\pi\int_{-\infty}^{+\infty}f(k)\cos(ka)\Bigl(\frac{d}{dk}\delta(k)\Bigr)dk=2\pi\int_{-\infty}^{+\infty}\frac{d}{dk}\Bigl(f(k)\cos(ka)\Bigr)\delta(k)dk=$$ $$=2\pi{f'}(0)-a\lim_{k\to0}f(k)\sin(ak)=2\pi{f'}(0)$$
if the function $f(k)$ (as supposed) is smooth and does not have singularities.
Finally $$I(k)=\Im{J}(k)=\pi{a^2}\cos(ka)sgn(k)-2\pi\frac{d}{dk}\delta(k)$$ where the second term makes sense only in the sense of tempered distribution.
We can put $k=1$ and (formally) get $I(1)=\pi{a^2}\cos(a)$, but the meaning of $I(1)$ depends on what we are going to do with it further.