Let me cite a theorem and then ask a question
Let $f$ be meromorphic in a neighborhood of $\overline{H_{+}}$ with a finite number of poles which belong to $H_{+}$. If there exist $A>0,R>0,\epsilon>0$ such that $$|f(z)|\leq A|z|^{-\epsilon} $$ as long as $|z|>R$, then for $a>0$ $$\int_{-\infty}^{\infty}f(x)e^{iax}dx=2\pi i\sum_{a_{j}\in H_{+}}\text{res}(fe^{iaz};a_{j})$$
Now, take $\int_{-\infty}^{\infty}\frac{x\sin x}{x^2+4}dx$ as an example. Taking $f(z)=\frac{z}{z^2+4}$, we see that $$|f(z)|=\frac{|z|}{|z^2+4|}\leq2\frac{1}{|z|} $$ for $|z|>8$. Our function satisfies the assumptions in the theorem and has only one pole in $H_{+}$. Taking the imaginary part of $2\pi i\cdot\text{res}(fe^{iz};2i)$ leads to the answer. Now, my question. Say we want to compute the integral $\int_{-\infty}^{\infty}\frac{P(x)}{Q(x)}\sin xdx$ such that $\text{deg}P=\text{deg}Q-1$ and $Q\neq 0$. If we do nothing but apply the theorem above, and by doing so we obtain some number, does it prove that the integral is convergent? In other words, if someone asked me about the convergence of that real integral and I showed him a solution involving the above theorem, would it be valid? I'm asking this question because in the past I've seen problems like: prove (using methods of calculus) that such an integral is convergent and then, using methods of residues, find its value.