# Solving a difficult integral

I have the integral ##\displaystyle \int_{- \infty}^{\infty} \frac{\cos x}{x^2+1} dx##. We are going to use differentiation under the integral sign, so we let ##\displaystyle I(t) = \int_{- \infty}^{\infty} \frac{\cos tx}{x^2+1} dx##, and then, after manipulation, ##\displaystyle I'(t) = \int_{- \infty}^{\infty} \frac{\sin tx}{x(x^2+1)} dx - \int_{- \infty}^{\infty} \frac{\sin tx}{x} dx##. My question lies in the rightmost integral. In a solution I've seen, the rightmost integral is linked to the Dirichlet integral: https://en.wikipedia.org/wiki/Dirichlet_integral. And so ##\pi## is simply substituted for this expression. What I don't understand is how can it be linked to this known integral when there is that ##t## in the argument of ##\sin##?

kuruman
Homework Helper
Gold Member
Can you not change variables? Let ##u=tx##, etc. etc.

Can you not change variables? Let ##u=tx##, etc. etc.
Okay, I see how that could work... But I don't know the sign of t, right? As such I can't tell whether the upper bound on the integral goes to ##+ \infty## or ##- \infty##

kuruman
Homework Helper
Gold Member
The final answer should not depend on the sign of ##t## because ##I(t)=I(-t)##. You have an even function in ##x## and ##t##. That helps you to link to the Dirchlet integral by putting a ##2## up front and taking the limits from zero to infinity.

Is there a reason for why you don't deal with the original integral via calculus of residues?