real integral

A PV integral using contour integration.

January 27, 2025 math and physics play , , , , , ,

[Click here for a PDF version of this post]

Here’s the second last real-integral sub-problem from [1], problem 31(j). Find
\begin{equation}\label{eqn:oscillatorKernel:20}
I = P \int_{-\infty}^\infty \inv{ \lr{ \omega’ – \omega_0 }^2 + a^2 } \inv{ \omega’ – \omega } d\omega’.
\end{equation}

Our poles are sitting at \( \omega \), and
\begin{equation}\label{eqn:oscillatorKernel:80}
\alpha, \beta = \omega_0 \pm i a
\end{equation}
one of which sits above the x-axis, one below, and one on the line.

This means that if we compute the usual infinite semicircular contour integral, we have a \( 2 \pi i \) weighted residue above the line and one \( \pi i \) weighted residue for the x-axis pole. That is
\begin{equation}\label{eqn:oscillatorKernel:50}
\begin{aligned}
\oint \inv{ \lr{ z – \omega_0 }^2 + a^2 } \inv{ z – \omega } dz
&=
\lr{ 2 \pi i } \evalbar{ \inv{\lr{z – \lr{ \omega_0 – i a } } \lr{ z – \omega } } }{z = \omega_0 + i a }
+
\lr{ \pi i } \evalbar{ \inv{ \lr{ z – \omega_0 }^2 + a^2 }}{z = \omega } \\
&=
\lr{ 2 \pi i } \inv{\lr{\omega_0 + i a – \lr{ \omega_0 – i a } } \lr{ \omega_0 + i a – \omega } }
+
\lr{ \pi i } \inv{ \lr{ \omega – \omega_0 }^2 + a^2 } \\
&=
\frac{ 2 \pi i }{2 i a} \inv{ \omega_0 + i a – \omega } \frac{ \omega_0 – i a – \omega }{\omega_0 – i a – \omega }
+
\lr{ \pi i } \inv{ \lr{ \omega – \omega_0 }^2 + a^2 } \\
&=
\frac{ \pi }{ \lr{ \omega – \omega_0 }^2 + a^2 } \lr{ \frac{\omega_0 – \omega}{a} – i + i },
\end{aligned}
\end{equation}
or
\begin{equation}\label{eqn:oscillatorKernel:100}
\boxed{
I =
\frac{ \pi \lr{ \omega_0 – \omega } }{ a \lr{ \lr{ \omega – \omega_0 }^2 + a^2} }.
}
\end{equation}

Interestingly, Mathematica doesn’t seem to be able to solve this integral, even setting PrincipleValue to True. The solution ends up with a bogus seeming \( \textrm{Im}\left(\omega_0-\omega \right) = \textrm{Re}(a) \) restriction, and as far as I can tell, the Mathematica result is also zero after simplification that it fails to do. Mathematica can solve this if we explicitly state the PV condition as a limit, as shown in fig. 1.

fig. 1. Coercing Mathematica to evaluate this.

References

[1] F.W. Byron and R.W. Fuller. Mathematics of Classical and Quantum Physics. Dover Publications, 1992.

A weighted sinc function integral.

January 25, 2025 math and physics play , , , , ,

[Click here for a PDF version of this post]

Here’s another real integral problem from [1] (31(f)). Find
\begin{equation}\label{eqn:weightedSinc:20}
I = \int_0^\infty \frac{\sin x dx}{x\lr{ x^2 + a^2 }}.
\end{equation}
Both Mathematica and the text state that the answer is
\begin{equation}\label{eqn:weightedSinc:40}
I = \frac{\pi}{2 a^2} \lr{ 1 – e^{-a}}.
\end{equation}

My initial attempt to evaluate this using contour integral techniques gets the wrong answer. I’m going to post both my wrong solution method, and why the initial method was wrong.

Then I’ll follow up with the corrected method. The mistake, and it’s identification, is probably more interesting than the solution.

The contour.

Before delving into the residue calculations, it’s first helpful to note that the integrand is an even function, so we may transform it first into an integral over the entire real axis:
\begin{equation}\label{eqn:weightedSinc:60}
I = \inv{2} \int_{-\infty}^\infty \frac{\sin x dx}{x\lr{ x^2 + a^2 }}.
\end{equation}
The obvious choice for the contour is illustrated in fig. 1, where \( R \rightarrow \infty \), and \( \rho \rightarrow 0 \).

fig. 1. Contour with two semicircles.

We have to figure out if the circular contour integrals are zero, in the limit. Let’s start with the small contour, with \( z = \rho e^{i \theta} \)
\begin{equation}\label{eqn:weightedSinc:80}
\begin{aligned}
I_\rho
&= \inv{2} \oint \frac{\sin z dz}{z \lr{ z^2 + a^2 }} \\
&= \inv{2} \int_\pi^{2 \pi} \frac{\sin\lr{ \rho e^{i\theta} } \rho i e^{i \theta} d\theta}{\rho e^{i\theta} \lr{ \rho^2 e^{2 i \theta} + a^2 }} \\
&\approx \inv{2} \int_\pi^{2 \pi} \frac{\rho e^{i\theta} d\theta}{\lr{ \rho^2 e^{2 i \theta} + a^2 }} \\
&= \frac{\rho}{2} \int_\pi^{2 \pi} \frac{e^{i\theta} d\theta}{\lr{ \rho^2 e^{2 i \theta} + a^2 }} \\
&\rightarrow \frac{\rho}{2 a^2} \int_\pi^{2 \pi} e^{i\theta} d\theta \\
&\rightarrow 0.
\end{aligned}
\end{equation}

The wrong way.

To complete the problem, I did a similar argument showing that the limit along the infinite semicircle was zero, and then proceeded to evaluate the residues. Let’s see what we get if this is done. We are trying to evaluate

\begin{equation}\label{eqn:weightedSinc:100}
I = \inv{2} \oint \frac{\sin z dz}{z \lr{ z + ia } \lr{ z – ia } },
\end{equation}
where we have a “half-enclosed” pole at \( z = 0 \), and fully enclosed pole at \( z = i a \). The residues are

\begin{equation}\label{eqn:weightedSinc:120}
\begin{aligned}
I
&= \inv{2} \lr{ 2 \pi i } \lr{ \evalbar{ \frac{\sin z}{z \lr{ z + ia } } }{z = i a} + \evalbar{ \inv{2} \frac{\sin z}{\lr{ z^2 + a^2 }} }{z = 0} } \\
&= \inv{2} \lr{ 2 \pi i } \frac{e^{i^2 a} – e^{-i^2 a}}{2i \lr{ ia } \lr{ 2 ia } } \\
&= \frac{ \pi }{4 a^2} \lr{e^{a} – e^{-a}}.
\end{aligned}
\end{equation}

This has a similar structure to the actual answer, but is wrong. I couldn’t find any obvious mistake in the residue calculation, so I was scratching my head for a while about what I did wrong. This confusion was only compounded by figuring out a different way to evaluate this, which did yield the right answer.

The right way.

The key to getting the right answer is to notice that
\begin{equation}\label{eqn:weightedSinc:65}
\inv{2} \int_{-\infty}^\infty \frac{\cos x dx}{x\lr{ x^2 + a^2 }} = 0,
\end{equation}
so we can, instead compute
\begin{equation}\label{eqn:weightedSinc:70}
I = \inv{2} \textrm{Im} \int_{-\infty}^\infty \frac{e^{ix} dx}{x\lr{ x^2 + a^2 }}.
\end{equation}
It’s easy to repeat the argument that after the \( x \rightarrow z \) substitution, this is also zero on the small semicircle, in the \( \rho \rightarrow 0 \) limit. On the large semicircle, the integrand is now in the perfect form to apply Jordan’s lemma. Recall that lemma was:

Lemma 1.1: Jordan’s Lemma.

Given \( R(z) \rightarrow 0 \), then for \( \alpha > 0 \) on a upper half-plane semicircular arc,
\begin{equation*}
\lim_{\Abs{z} \rightarrow \infty} \oint R(z) e^{i \alpha z} dz = 0.
\end{equation*}

We have \( \alpha = 1 \), which is greater than zero, and the rest of the integrand is \( O(R^{-3}) \), so it’s zero. Now we can just compute the residues

\begin{equation}\label{eqn:weightedSinc:140}
\begin{aligned}
\inv{2} \oint \frac{e^{iz} dz}{z\lr{ z^2 + a^2 }}
&=
\lr{ \pi i } \lr{ \evalbar{ \frac{e^{iz}}{z \lr{ z + i a }} }{z = i a} + \inv{2} \evalbar{ \frac{e^{iz}}{z^2 + a^2 }}{z = 0} } \\
&=
\lr{ \pi i } \lr{ \frac{e^{-a}}{ia \lr{ 2 i a }} + \inv{2} \frac{1}{a^2}} \\
&=
\frac{\pi i}{2 a^2} \lr{ 1 – e^{-a} }.
\end{aligned}
\end{equation}
Taking the imaginary part of this integral, we have the solution.

What went wrong?

I don’t think there is anything wrong with the residue calculation for “the wrong way”, but it was not correct to argue that the integral along the infinite semicircular arc was zero in that case.

I’d made that argument in the following fashion, looking for the limit of
\begin{equation}\label{eqn:weightedSinc:160}
\begin{aligned}
\int \frac{\sin z}{z \lr{ z^2 + a^2 } } dz
=
\int \frac{e^{iz}}{2 i z \lr{ z^2 + a^2 } } dz –
\int \frac{e^{-iz}}{2 i z \lr{ z^2 + a^2 } } dz
\end{aligned}
\end{equation}
We can apply Jordan’s lemma to the first integral, but not the second. To see why specifically, consider an explicit \( z = R e^{i \theta } \) parameterization of that integral
\begin{equation}\label{eqn:weightedSinc:180}
\begin{aligned}
\Abs{\int \frac{e^{-iz}}{2 i z \lr{ z^2 + a^2 } } dz}
&=
\inv{2} \Abs{ \int_0^\pi \frac{e^{-i R e^{i\theta} }}{R e^{i\theta} \lr{ R^2 e^{2 i \theta} + a^2 } } i R e^{i \theta} d\theta } \\
&=
\inv{2} \Abs{ \int_0^\pi \frac{e^{-i R e^{i\theta} }}{\lr{ R^2 e^{2 i \theta} + a^2 } } d\theta } \\
&=
\inv{2} \Abs{ \int_0^\pi \frac{ e^{-i R \cos\theta} e^{R \sin\theta} }{\lr{ R^2 e^{2 i \theta} + a^2 } } d\theta }.
\end{aligned}
\end{equation}
Not only is this not zero, it’s very obviously infinite for \( R \rightarrow \infty \), as the real exponential will dominate (at least for some angles.) In particular, note that along the imaginary axis, say \( z = i u\), we have \( \sin z = i \sinh u \), which blows up as \( u \rightarrow \infty \). That sine is not well behaved, so we have to use the imaginary part trick, to convert it to an exponential that will submit properly to Jordan’s lemma.

The moral of the story is that if we incorrectly identify that a portion of the contour integral is zero, when it isn’t, the rest of the results that follow are garbage.

References

[1] F.W. Byron and R.W. Fuller. Mathematics of Classical and Quantum Physics. Dover Publications, 1992.

Evaluating some real trig integrals with unit circle contours.

January 19, 2025 math and physics play , , , , ,

[Click here for a PDF version of this post]

Here are a couple of problems from [1].

A sine integral.

This is problem (31(a)). For \( a > b > 0 \), find
\begin{equation}\label{eqn:unitCircleContourIntegrals:20}
I = \int_0^{2 \pi} \frac{d\theta}{a + b \sin\theta}.
\end{equation}
We can proceed by making a change of variables \( z = e^{i\theta} \), for which \( dz = i z d\theta \). Also let \( \alpha = a/b \), so
\begin{equation}\label{eqn:unitCircleContourIntegrals:40}
\begin{aligned}
I
&= \inv{b} \oint_{\Abs{z} = 1} \frac{-i dz}{z} \inv{\alpha + (1/2i)\lr{z – 1/z}} \\
&= \frac{2}{b} \oint_{\Abs{z} = 1} \frac{dz}{2 i z \alpha + z^2 – 1} \\
&= \frac{2}{b} \oint_{\Abs{z} = 1} \frac{dz}{\lr{ z + i \alpha + i\sqrt{\alpha^2 – 1}}\lr{ z + i \alpha – i\sqrt{\alpha^2 – 1}}}.
\end{aligned}
\end{equation}
Clearly the mixed sign factor represents the pole that falls within the unit circle, so we have only one residue to include
\begin{equation}\label{eqn:unitCircleContourIntegrals:60}
\begin{aligned}
I
&= \frac{2}{b} 2 \pi i \evalbar{ \inv{ z + i \alpha + i\sqrt{\alpha^2 – 1}} }{ z = -i \alpha + i \sqrt{ \alpha^2 – 1 } } \\
&= \frac{4 \pi i}{b} \inv{ 2 i \sqrt{\alpha^2 – 1}} \\
&= \frac{2 \pi}{\sqrt{a^2 – b^2}}.
\end{aligned}
\end{equation}

Sines and cosines upstairs and downstairs.

This is problem (31(b)). Given \( a > b > 0 \) (again), this time we want to find
\begin{equation}\label{eqn:unitCircleContourIntegrals:80}
I = \int_0^{2 \pi} \frac{\sin^2 \theta d\theta}{a + b \cos\theta}.
\end{equation}
We’d like to make the same \( z = e^{i \theta} \) substitution, but have to prepare a bit. We rewrite the sine
\begin{equation}\label{eqn:unitCircleContourIntegrals:100}
\begin{aligned}
\sin^2 \theta
&= \inv{2} \lr{ 1 – \cos(2\theta) } \\
&= \inv{2} – \inv{4}\lr{ e^{2 i \theta} + e^{-2 i \theta} },
\end{aligned}
\end{equation}
so, again setting \( \alpha = a/b \), we have
\begin{equation}\label{eqn:unitCircleContourIntegrals:120}
\begin{aligned}
I
&= \inv{b} \oint_{\Abs{z} = 1} \lr{ \inv{2} – \inv{4}\lr{ z^2 + 1/z^2 } } \frac{-i dz}{z} \inv{\alpha + (1/2)\lr{ z + 1/z} } \\
&= \frac{-i}{2 b} \oint_{\Abs{z} = 1} \lr{ 2 – z^2 – \inv{z^2} } \frac{dz}{ 2 \alpha z + z^2 + 1 } \\
&= \frac{-i}{2 b} \oint_{\Abs{z} = 1} dz \frac{ 2 z^2 – z^4 – 1 }{ z^2 \lr{ 2 \alpha z + z^2 + 1} } \\
&= \frac{-i}{2 b} \oint_{\Abs{z} = 1} dz \frac{ 2 z^2 – z^4 – 1 }{ z^2 \lr{ z + \alpha + \sqrt{ \alpha^2 – 1} }\lr{ z + \alpha – \sqrt{ \alpha^2 – 1} } }.
\end{aligned}
\end{equation}
The enclosed poles are at \( z = 0 \) (a second order pole) and \( z = -\alpha + \sqrt{ \alpha^2 – 1} \), so the integral is
\begin{equation}\label{eqn:unitCircleContourIntegrals:140}
\begin{aligned}
I
&= \lr{ 2 \pi i } \lr{ \frac{-i}{2 b} } \lr{
\evalbar{ \lr{ \frac{ 2 z^2 – z^4 – 1 }{ 2 \alpha z + z^2 + 1 } }’ }{z = 0}
+
\evalbar{ \frac{ 2 z^2 – z^4 – 1 }{ z^2 \lr{ z + \alpha + \sqrt{ \alpha^2 – 1} } } }{ z = -\alpha + \sqrt{ \alpha^2 – 1} }
}
\end{aligned}
\end{equation}
The derivative residue simplifies to
\begin{equation}\label{eqn:unitCircleContourIntegrals:160}
\begin{aligned}
\evalbar{ \lr{ \frac{ 2 z^2 – z^4 – 1 }{ 2 \alpha z + z^2 + 1 } }’ }{z = 0}
&=
\evalbar{ \frac{ 4 z – 4 z^3 }{2 \alpha z + z^2 + 1} – \frac{ 2 z^2 – z^4 – 1}{\lr{ 2 \alpha z + z^2 + 1 }^2 }\lr{ 2 \alpha + 2 z } }{z = 0} \\
&= 2 \alpha,
\end{aligned}
\end{equation}
whereas the remaining residue is
\begin{equation}\label{eqn:unitCircleContourIntegrals:180}
\evalbar{ -\frac{ \lr{z^2 – 1}^2 }{ z^2 \lr{ 2 \sqrt{ \alpha^2 – 1} } } }{ z = -\alpha + \sqrt{ \alpha^2 – 1} }
=
\evalbar{ -\lr{z – \inv{z}}^2 \inv{ 2 \sqrt{ \alpha^2 – 1} } }{ z = -\alpha + \sqrt{ \alpha^2 – 1} },
\end{equation}
but
\begin{equation}\label{eqn:unitCircleContourIntegrals:220}
\begin{aligned}
\inv{z}
&= \inv{ -\alpha + \sqrt{ \alpha^2 – 1 } } \frac{ \lr{ \alpha + \sqrt{ \alpha^2 – 1 }} }{ \lr{ \alpha + \sqrt{ \alpha^2 – 1 } } } \\
&= \frac{ \alpha + \sqrt{ \alpha^2 – 1 } }{ -\alpha^2 + \lr{ \alpha^2 – 1} } \\
&= -\lr{ \alpha + \sqrt{ \alpha^2 – 1 } },
\end{aligned}
\end{equation}
and
\begin{equation}\label{eqn:unitCircleContourIntegrals:240}
\begin{aligned}
z – \inv{z}
&= -\alpha + \sqrt{ \alpha^2 – 1 } + \alpha + \sqrt{ \alpha^2 – 1 }
&= 2 \sqrt{ \alpha^2 – 1 },
\end{aligned}
\end{equation}
so
\begin{equation}\label{eqn:unitCircleContourIntegrals:260}
\begin{aligned}
\evalbar{ -\frac{ \lr{z^2 – 1}^2 }{ z^2 \lr{ 2 \sqrt{ \alpha^2 – 1} } } }{ z = -\alpha + \sqrt{ \alpha^2 – 1} }
&= – \frac{ \lr{ 2 \sqrt{ \alpha^2 – 1 } }^2 }{ 2 \sqrt{ \alpha^2 – 1} } \\
&= – 2 \sqrt{ \alpha^2 – 1 },
\end{aligned}
\end{equation}
for a final answer of
\begin{equation}\label{eqn:unitCircleContourIntegrals:200}
\begin{aligned}
I
&= \frac{2 \pi}{b} \lr{ \alpha – \sqrt{\alpha^2 – 1} } \\
&= \frac{2 \pi}{b^2} \lr{ a – \sqrt{a^2 – b^2} }.
\end{aligned}
\end{equation}

Another cosine integral.

Last problem of this sort (31 (c)), was to find, again with \( a > b > 0 \)
\begin{equation}\label{eqn:unitCircleContourIntegrals:280}
I = \int_0^{2 \pi} \frac{ d\theta} {\lr{ a + b \cos \theta }^2 }.
\end{equation}
Making our \( z = e^{i \theta} \) substitution, and setting \( \alpha = a/b \), we have
\begin{equation}\label{eqn:unitCircleContourIntegrals:300}
\begin{aligned}
I &= \inv{b^2} \oint_{\Abs{z} = 1} \frac{ -i dz/z} {\lr{ \alpha + (1/2)\lr{ z + 1/z } }^2 } \\
&= \frac{-4 i}{b^2} \oint_{\Abs{z} = 1} \frac{ z dz}{\lr{ 2 \alpha z + z^2 + 1 }^2 } \\
&= \frac{-4 i}{b^2} \oint_{\Abs{z} = 1} \frac{ z dz}{\lr{ z + \alpha + \sqrt{\alpha^2 – 1} }^2\lr{ z + \alpha – \sqrt{\alpha^2 – 1} }^2}.
\end{aligned}
\end{equation}
Again, only this mixed sign pole will be within the unit circle, so
\begin{equation}\label{eqn:unitCircleContourIntegrals:320}
\begin{aligned}
I
&= \lr{\frac{-4 i}{b^2} }\lr{ 2 \pi i }
\lr{
\evalbar{ \lr{ \frac{z}{\lr{ z + \alpha + \sqrt{\alpha^2 – 1} }^2} }’ }{z = -\alpha + \sqrt{\alpha^2 – 1} }
}
\end{aligned}
\end{equation}

That derivative is
\begin{equation}\label{eqn:unitCircleContourIntegrals:340}
\begin{aligned}
\lr{ \frac{z}{\lr{ z + \alpha + \sqrt{\alpha^2 – 1} }^2} }’
&=
\inv{\lr{ z + \alpha + \sqrt{\alpha^2 – 1} }^2} – \frac{2 z}{\lr{ z + \alpha + \sqrt{\alpha^2 – 1} }^3} \\
&= \frac{z + \alpha + \sqrt{\alpha^2 – 1} – 2 z}{\lr{ z + \alpha + \sqrt{\alpha^2 – 1} }^3} \\
&= \frac{-z + \alpha + \sqrt{\alpha^2 – 1}}{\lr{ z + \alpha + \sqrt{\alpha^2 – 1} }^3}.
\end{aligned}
\end{equation}
Evaluating it at our pole \( z = -\alpha + \sqrt{\alpha^2 – 1} \), we have
\begin{equation}\label{eqn:unitCircleContourIntegrals:360}
\begin{aligned}
\frac{-z + \alpha + \sqrt{\alpha^2 – 1}}{\lr{ z + \alpha + \sqrt{\alpha^2 – 1} }^3}
&=
\frac{ \alpha – \sqrt{\alpha^2 – 1} + \alpha + \sqrt{\alpha^2 – 1}}{\lr{ -\alpha + \sqrt{\alpha^2 – 1} + \alpha + \sqrt{\alpha^2 – 1} }^3} \\
&= \frac{ 2 \alpha }{\lr{ 2 \sqrt{\alpha^2 – 1} }^3 } \\
&= \inv{4} \frac{ \alpha }{\lr{ \alpha^2 – 1}^{3/2} },
\end{aligned}
\end{equation}
so
\begin{equation}\label{eqn:unitCircleContourIntegrals:380}
\begin{aligned}
I
&= \frac{8 \pi}{b^2} \inv{4} \frac{ \alpha }{\lr{ \alpha^2 – 1}^{3/2} } \\
&= \frac{2 \pi a }{b^3 \lr{ \alpha^2 – 1}^{3/2} },
\end{aligned}
\end{equation}
but \( b^3 = \lr{ b^2}^{3/2} \), for
\begin{equation}\label{eqn:unitCircleContourIntegrals:400}
I = \frac{ 2 \pi a }{ \lr{ a^2 – b^2 }^{3/2} }.
\end{equation}

References

[1] F.W. Byron and R.W. Fuller. Mathematics of Classical and Quantum Physics. Dover Publications, 1992.