The integral is, $$I=\int_{-\infty}^{\infty}\frac{\sin x}{x}\, dx$$ I know the answer would be $\pi$ and I know how to solve this using Feynman's method and Fourier transform. However I was trying something, rather naively, since by understanding of the subject is constrained to undergraduate mathematical physics. I did the following, taking the imaginary part of $e^{ix}$, $$\int_{-\infty}^{\infty}\frac{\sin x}{x}\, dx=\Im\left\{\int_{-\infty}^{\infty}\frac{e^{ix}}{x}\, dx\right\}$$ Then I introduced a variable $\alpha$ where taking $\alpha=1$ would result in the required integral. So we have here, $$I(\alpha)=\Im\left\{\int_{-\infty}^{\infty}\frac{e^{i\alpha x}}{x}\, dx\right\}$$ Taking the derivative of $I$ with $\alpha$ we will get, $$\frac{dI(\alpha)}{d\alpha}=\Im\left\{\int_{-\infty}^{\infty}ie^{i\alpha x}\, dx\right\}$$ We know that this is the definition of Dirac delta, $\delta(\alpha)$. Therefore, $$\frac{dI(\alpha)}{d\alpha}=\Im\left\{i2\pi\delta(\alpha)\right\}=2\pi\delta(\alpha)$$ Integrating with $\alpha$, $$I(\alpha)=2\pi\theta(\alpha)+c$$ Where, $\theta$ is the Heaviside step function and $c$ is the constant of integration. Using $\alpha=-\infty$ from the initial equation we shall get $I(-\infty)=0$, which gives $c=0$. Therefore, $$I(\alpha)=2\pi\theta(\alpha)$$ And putting $\alpha=1$ here, we have, $$I=2\pi$$ Which isn't the required answer. I want to know where I am going wrong, which step, or if it's the entire method. I am also not aware of all the properties of the functions I used and this is just me fiddling with things, so I will be really obliged if anyone can help.
Edit for duplication claim: My question isn't exactly about how to solve the sinc integral using the known methods. I want to know what is wrong with the approach I am using, which I know is wrong, but I don't know what exactly is going wrong.
Edit after suggestion in comments: Okay assuming $\alpha=-\infty$ to calculate the integration constant's value, is kind of a blunder, since that's not gonna work. However, if I take $\alpha=-1$ this might work, and will give me, $$I(-1)=-\int_{-\infty}^{\infty}\frac{\sin x}{x}\, dx=-I(1)$$ This means, $$c=I(-1)=-I(1)$$ And that would give me, $$I(\alpha)=2\pi\theta(\alpha)-I(1)$$ And now taking $\alpha=1$, $$I=\pi$$ And that matches the answer, however I am kinda skeptical if this approach is right.