Contour integration

More residue calculus: sinc squared, fractional exponent, log, pie contour

January 26, 2025 math and physics play , , , ,

[Click here for a PDF version of this post]

Sinc squared.

This is problem 31(g) from [1]. Find
\begin{equation}\label{eqn:sincSquared:20}
I = \int_{-\infty}^\infty \frac{\sin^2 x}{x^2} dx.
\end{equation}

We will use the same upper half plane semicircular contour, enclosing the second order pole at the origin. This time we write
\begin{equation}\label{eqn:sincSquared:40}
\sin^2 x = \frac{ 1 – \cos\lr{ 2x } }{2},
\end{equation}
allowing us to write
\begin{equation}\label{eqn:sincSquared:60}
\begin{aligned}
I
&= \inv{2} \int_{-\infty}^\infty \frac{1 – \cos\lr{ 2 x } }{x^2} dx \\
&= \inv{2} \textrm{Re} \int_{-\infty}^\infty \frac{1 – e^{2 i x } }{x^2} dx.
\end{aligned}
\end{equation}
This has exactly the structure required to apply Jordan’s lemma, and conclude that the integral over the infinite semicircular part of the contour is zero.

We can proceed to compute the residues
\begin{equation}\label{eqn:sincSquared:80}
\begin{aligned}
I
&=
\inv{2} \textrm{Re} \oint \frac{1 – e^{2 i z } }{z^2} dz \\
&=
\inv{2} \textrm{Re} \frac{ \pi i }{1!} \evalbar{ \lr{1 – e^{2 i z } }’ }{ z = 0 }.
\end{aligned}
\end{equation}
Because we are sneaking around the pole at the origin with a half semicircle, we multiply the residue by \( \pi i \), not \( 2 \pi i \). This leaves
\begin{equation}\label{eqn:sincSquared:100}
I = \textrm{Re} \frac{\pi i}{2} \evalbar{ (- 2 i) e^{2 i z } }{ z = 0 },
\end{equation}
or
\begin{equation}\label{eqn:sincSquared:640}
\boxed{
I = \pi.
}
\end{equation}

An fractional exponent integral.

Next, let’s do 31(h). Given \( 0 < a < 1 \), we want to evaluate \begin{equation}\label{eqn:sincSquared:120} I = \int_0^\infty \frac{x^{2 a – 1}}{x^2 + b^2} dx. \end{equation} Let’s start with a \( x = b u \), where we assume that \( b > 0 \). This gives us
\begin{equation}\label{eqn:sincSquared:140}
\begin{aligned}
I
&= \int_0^\infty \frac{ b^{2 a – 1} u^{2 a – 1}}{b^2 \lr{ u^2 + 1 } } b du \\
&= b^{2(a – 1)} \int_0^\infty \frac{ u^{2 a – 1}}{u^2 + 1 } du.
\end{aligned}
\end{equation}
We now want to solve the slightly simpler integral, let’s call it
\begin{equation}\label{eqn:sincSquared:160}
J = \int_0^\infty \frac{ u^{2 a – 1}}{u^2 + 1 } du.
\end{equation}

Let’s now look at
\begin{equation}\label{eqn:sincSquared:180}
\begin{aligned}
K
&= \int_{-\infty}^0 \frac{ u^{2 a – 1}}{u^2 + 1 } du \\
&= -\int_{\infty}^0 \frac{ \lr{ – v } ^{2 a – 1}}{v^2 + 1 } dv \\
&= \lr{-1}^{2 a – 1} J.
\end{aligned}
\end{equation}
However
\begin{equation}\label{eqn:sincSquared:200}
\begin{aligned}
\lr{-1}^{2 a – 1}
&=
e^{i \pi \lr{ 2 a – 1 } } \\
&=
– e^{2 i \pi a },
\end{aligned}
\end{equation}
so
\begin{equation}\label{eqn:sincSquared:220}
\begin{aligned}
J
&= \inv{ 1 – e^{2 i \pi a } } \int_{-\infty, \infty} \frac{ u^{2 a – 1}}{u^2 + 1 } du \\
&= \inv{ 1 – e^{2 i \pi a } } \oint \frac{ z^{2 a – 1}}{z^2 + 1 } dz,
\end{aligned}
\end{equation}
that is, assuming the integral on the upper half plane semicircle is zero.

On that semicircle, with \( z = R e^{i\theta} \),
\begin{equation}\label{eqn:sincSquared:240}
\begin{aligned}
\oint \frac{ z^{2 a – 1}}{z^2 + 1 } dz
&= \int_0^\pi \frac{ \lr{ R e^{i \theta} }^{2 a – 1} }{ R^2 e^{2 i \theta} + 1 } R e^{i \theta} d\theta \\
&\rightarrow \int_0^\pi R^{2 a – 1 + 1 – 2} e^{i \theta (2 a – 1) -i \theta} d\theta.
\end{aligned}
\end{equation}
Near \( a \approx 0 \) this is \( O(R^{-2}) \), which tends to zero. At the upper tend of the a range, where \( a = 1 – \epsilon \), this is
\begin{equation}\label{eqn:sincSquared:260}
O(R^{2(1 – \epsilon) – 2}) = O(1/R^{2 \epsilon}),
\end{equation}
which also tends to zero. We have only one enclosed pole, at \( z = i \), so
\begin{equation}\label{eqn:sincSquared:280}
\begin{aligned}
I
&= \frac{b^{2(a-1)}}{ 1 – e^{2 i \pi a } } ( 2 \pi i ) \evalbar{ \frac{z^{2 a – 1}}{z + i} }{z = i} \\
&= \frac{\pi b^{2(a-1)}}{ 1 – e^{2 i \pi a } } i^{2 a – 1}.
\end{aligned}
\end{equation}

But
\begin{equation}\label{eqn:sincSquared:300}
\begin{aligned}
i^{2 a – 1}
&= \lr{ e^{i \pi/2} }^{2 a – 1} \\
&= e^{i \pi a} e^{-i \pi/2} \\
&= -i e^{i \pi a},
\end{aligned}
\end{equation}
so
\begin{equation}\label{eqn:sincSquared:320}
\begin{aligned}
I
&= \frac{-i \pi b^{2(a-1)} e^{i \pi a}}{ 1 – e^{2 i \pi a } } \\
&= \frac{-i \pi b^{2(a-1)} }{ e^{-i \pi a} – e^{i \pi a } },
\end{aligned}
\end{equation}
or
\begin{equation}\label{eqn:sincSquared:660}
\boxed{
I = \frac{\pi b^{2(a-1)} }{ 2 \sin\lr{ \pi a } }.
}
\end{equation}

A log integral over the positive x-axis.

Problem 31(i) is
\begin{equation}\label{eqn:sincSquared:340}
I = \int_0^\infty \frac{\ln x}{x^2 + b^2} dx.
\end{equation}
Let’s see what happens to this integral over the \( x < 0 \) range.
\begin{equation}\label{eqn:sincSquared:360}
\begin{aligned}
\int_{-\infty}^0 \frac{\ln x}{x^2 + b^2} dx
&=
-\int_{\infty}^0 \frac{\ln(- u)}{u^2 + b^2} d u \\
&=
I + \int_0^\infty \frac{\ln e^{i \pi}}{u^2 + b^2} du \\
&=
I + \frac{i \pi}{2} \int_{-\infty}^\infty \inv{u^2 + b^2} du.
\end{aligned}
\end{equation}

This means that we have
\begin{equation}\label{eqn:sincSquared:380}
\int_{-\infty}^\infty \frac{\ln x}{x^2 + b^2} dx = 2 I + \frac{i \pi}{2} \int_{-\infty}^\infty \inv{u^2 + b^2} du,
\end{equation}
or
\begin{equation}\label{eqn:sincSquared:480}
\begin{aligned}
I
&= \inv{2} \int_{-\infty}^\infty \frac{\ln x – i \pi/2}{x^2 + b^2} dx \\
&= \inv{2} \int_{-\infty}^\infty \frac{\ln(-i x)}{x^2 + b^2} dx \\
&= \inv{2} \oint \frac{\ln(-i z)}{z^2 + b^2} dz \\
&= (\pi i) \evalbar{ \frac{\ln(-i z)}{z + i b} }{z = i b},
\end{aligned}
\end{equation}
or
\begin{equation}\label{eqn:sincSquared:680}
\boxed{
I = \frac{\pi \ln b}{2 b}.
}
\end{equation}

A pie contour.

Skipping ahead to 31(k), we want to find
\begin{equation}\label{eqn:sincSquared:500}
I = \int_0^\infty \frac{dx}{x^3 + a^3}.
\end{equation}
Some googling shows that we can evaluate integrals with \( x^n + b^n \) denominators, using a pie shaped contour, with slice sizes of \( 2 \pi /n \),
as plotted in fig. 1.

fig. 1. Pie shaped contour for cubic integral.

Integrating (backwards) along the \( 2 \pi/3 \) slice line, with \( \alpha = e^{\pi i/3} \), and \( z = \alpha^2 u \), we have
\begin{equation}\label{eqn:sincSquared:520}
\begin{aligned}
\int_0^\infty \frac{ \alpha^2 du }{ \alpha^6 u^3 + a^3 }
&=
\alpha^2 \int_0^\infty \frac{ du }{ u^3 + a^3 } \\
&= \alpha^2 I,
\end{aligned}
\end{equation}
so
\begin{equation}\label{eqn:sincSquared:540}
I = \inv{ 1 – \alpha^2 } \oint \frac{dz}{z^3 + a^3}.
\end{equation}
We can factor the denominator as
\begin{equation}\label{eqn:sincSquared:560}
z^3 + a^3 = \lr{ z – \alpha a }\lr{ z + a }\lr{ z – a/\alpha },
\end{equation}
where only the \( z = \alpha a \) pole is enclosed. The residue calculation is
\begin{equation}\label{eqn:sincSquared:580}
\begin{aligned}
I
&= \frac{ 2 \pi i }{1 – \alpha^2 } \evalbar{ \inv{\lr{z + a}\lr{ z – a/\alpha } } }{z = a\alpha} \\
&= \frac{ 2 \pi i }{a^2} \inv{ \lr{1 – \alpha^2 } \lr{ \alpha + 1 } \lr{ \alpha – 1/\alpha } } \\
\end{aligned}
\end{equation}
We now want to expand the denominator. I had trouble simplifying this by hand, and it took me a few tries to get it right:
\begin{equation}\label{eqn:sincSquared:600}
\begin{aligned}
-\lr{1 – \alpha^2 } \lr{ \alpha + 1 } \lr{ \alpha – 1/\alpha }
&=
-\frac{\lr{\alpha^2 -1}^2 \lr{ \alpha + 1 }}{\alpha} \\
&=
-\lr{ e^{2 \pi i/3} – 1}^2 \lr{ 1 + e^{i\pi/3} } e^{-i\pi/3} \\
&=
-\lr{ e^{4 \pi i/3} + 1 – 2 e^{ 2 \pi i /3} } \lr{ 1 + e^{-i\pi/3} } \\
&=
-\lr{ e^{4 \pi i/3} + 1 – 2 e^{ 2 \pi i /3} + e^{3 \pi i/3} + e^{-i\pi/3} – 2 e^{ \pi i /3} } \\
&=
-\lr{ e^{4 \pi i/3} – 2 e^{ 2 \pi i /3} + e^{-i\pi/3} – 2 e^{ \pi i /3} } \\
&=
-\lr{ \inv{2} \lr{ -1 – \sqrt{3} i } – \lr{-1 + \sqrt{3} i} + \inv{2}\lr{ 1 – \sqrt{3} i } – \lr{ 1 + \sqrt{3} i} } \\
&=
-\lr{ -\inv{2} – 1 – \inv{2} – 1 } \sqrt{3} i \\
&=
3 \sqrt{3} i.
\end{aligned}
\end{equation}
Putting the pieces together
\begin{equation}\label{eqn:sincSquared:620}
\boxed{
I = \frac{2 \pi}{3 \sqrt{3} a^2}.
}
\end{equation}

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.

Another real integral using contour integration.

January 21, 2025 math and physics play , , ,

[Click here for a PDF version of this post]

Here’s (31(d)) from [1]. Find
\begin{equation}\label{eqn:fourPoles:20}
I = \int_0^\infty \frac{dx}{1 + x^4} = \inv{2}\int_{-\infty}^\infty \frac{dx}{1 + x^4}.
\end{equation}
This one is easy conceptually, but a bit messy algebraically. We integrate over the contour \( C \) illustrated in fig. 1.

fig. 1. Standard above the x-axis, semicircular contour.

We want to evaluate
\begin{equation}\label{eqn:fourPoles:40}
2 I = \oint_C \frac{dz}{1 + z^4},
\end{equation}
because the semicircular part of the integral is \( O(R^{-3}) \), which tends to zero in the \( R \rightarrow \infty \) limit.

The poles are at the points
\begin{equation}\label{eqn:fourPoles:60}
\begin{aligned}
z^4
&= -1 \\
&= e^{i \pi + 2 \pi i k},
\end{aligned}
\end{equation}
or
\begin{equation}\label{eqn:fourPoles:80}
\begin{aligned}
z
&= e^{i \pi/4 + \pi i k/2},
\end{aligned}
\end{equation}
These are the points \( z = (\pm 1 \pm i)/\sqrt{2} \), two of which are enclosed by our contour. Specifically
\begin{equation}\label{eqn:fourPoles:100}
\begin{aligned}
2 I
&= \oint_C \frac{dz}{
\lr{ z – \frac{1 + i}{\sqrt{2}} }
\lr{ z – \frac{-1 + i}{\sqrt{2}} }
\lr{ z – \frac{1 – i}{\sqrt{2}} }
\lr{ z – \frac{-1 – i}{\sqrt{2}} }
} \\
&= \oint_C \frac{dz}{
\lr{ z – \frac{1 + i}{\sqrt{2}} }
\lr{ z – \frac{-1 + i}{\sqrt{2}} }
\lr{ \lr{z + \frac{i}{\sqrt{2}}}^2 – \inv{2} }
} \\
&=
\evalbar{
\frac{ 2 \pi i }
{
\lr{ z – \frac{-1 + i}{\sqrt{2}} }
\lr{ \lr{z + \frac{i}{\sqrt{2}}}^2 – \inv{2} }
}
}{z = \frac{1 + i}{\sqrt{2}}}
+
\evalbar{
\frac{ 2 \pi i }
{
\lr{ z – \frac{1 + i}{\sqrt{2}} }
\lr{ \lr{z + \frac{i}{\sqrt{2}}}^2 – \inv{2} }
}
}
{z = \frac{-1 + i}{\sqrt{2}} } \\
&=
\evalbar{
\frac{(2 \pi i )(2 \sqrt{2})}
{
\lr{ z’ + 1 – i }
\lr{ \lr{z’ + i}^2 – 1 }
}
}{z’ = 1 + i}
+
\evalbar{
\frac{(2 \pi i )(2 \sqrt{2})}
{
\lr{ z’ – 1 – i }
\lr{ \lr{z’ + i}^2 – 1 }
}
}
{z’ = -1 + i}
\\
&=
\frac{2 \pi i \sqrt{2}}
{
\lr{2 i + 1}^2 – 1 }

\frac{2 \pi i \sqrt{2}}
{ \lr{2 i – 1}^2 – 1 }
\\
&=
\frac{\pi i \sqrt{2}}
{
2 (-1 + i)
}
+
\frac{\pi i \sqrt{2}}
{ 2(1 + i) }
\\
&=
\lr{ -1 – i }
\frac{\pi i}
{
2 \sqrt{2}
}
+
\lr{ 1 – i }
\frac{\pi i}
{ 2 \sqrt{2} }
\\
&=
\frac{\pi}
{ \sqrt{2} }
\end{aligned}
\end{equation}
or
\begin{equation}\label{eqn:fourPoles:120}
\boxed{
I = \frac{\pi}{2 \sqrt{2}}.
}
\end{equation}

References

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

A fun ellipse related integral.

January 18, 2025 math and physics play , , ,

[Click here for a PDF version of this post]

Motivation.

This was a problem I found on twitter ([2])

Find
\begin{equation}\label{eqn:ellipicalIntegral:20}
I = \int_0^\pi \frac{dx}{a^2 \cos^2 x + b^2 \sin^2 x}.
\end{equation}

I posted my solution there (as a screenshot), but had a sign wrong. Here’s a correction.

Solution.

Let’s first assume we aren’t interested in the \( a^2 = b^2 \), nor either of the \( a = 0, b = 0\) cases (if either of \( a, b \) is zero, then the integral is divergent.)

We can make a couple simple transformations to start with
\begin{equation}\label{eqn:ellipicalIntegral:40}
\begin{aligned}
\cos^2 x &= \frac{\cos(2x) + 1}{2} \\
\sin^2 x &= \frac{1 – \cos(2x)}{2},
\end{aligned}
\end{equation}
and then \( u = 2 x \), for \( dx = du/2 \)
\begin{equation}\label{eqn:ellipicalIntegral:60}
\begin{aligned}
I
&= \int_0^{2\pi} 2 \frac{du/2}{a^2 \lr{ 1 + \cos u } + b^2 \lr{1 – \cos u}} \\
&= \int_0^{2\pi} \frac{du}{ \lr{ a^2 – b^2 } \cos u + a^2 + b^2 }.
\end{aligned}
\end{equation}
There is probably a simple way to evaluate this integral, but let’s try it the fun way, using contour integration. Following examples from [1], let \( z = e^{i u} \), where \( dz = i z du \), and \( \alpha = \lr{ a^2 + b^2 }/\lr{ a^2 – b^2 } \), for
\begin{equation}\label{eqn:ellipicalIntegral:80}
\begin{aligned}
I
&= \oint_{\Abs{z} = 1} \frac{dz/(i z)}{ \lr{ a^2 – b^2 } \lr{ z + \inv{z}}/2 + a^2 + b^2 } \\
&= \frac{2}{i \lr{ a^2 – b^2 }} \oint_{\Abs{z} = 1} \frac{dz}{ z \lr{ z + \inv{z} + 2 \alpha} } \\
&= \frac{2}{i \lr{ a^2 – b^2 }} \oint_{\Abs{z} = 1} \frac{dz}{ z^2 + 2 \alpha z + 1 } \\
&= \frac{2}{i \lr{ a^2 – b^2 }} \oint_{\Abs{z} = 1} \frac{dz}{ \lr{ z + \alpha – \sqrt{\alpha^2 – 1}}\lr{ z + \alpha + \sqrt{\alpha^2 – 1}} }.
\end{aligned}
\end{equation}

There is a single enclosed pole on the real axis. For \( a^2 > b^2 \) where \( \alpha > 0 \) that pole is at \( z = -\alpha + \sqrt{ \alpha^2 – 1} \), so the integral is
\begin{equation}\label{eqn:ellipicalIntegral:100}
\begin{aligned}
I
&= 2 \pi i \frac{2}{i \lr{ a^2 – b^2 }} \evalbar{ \frac{1}{ z + \alpha + \sqrt{\alpha^2 – 1 } }}{z = -\alpha + \sqrt{ \alpha^2 – 1}} \\
&= \frac{4 \pi}{ a^2 – b^2 } \frac{1}{ 2 \sqrt{\alpha^2 – 1 } } \\
&= \frac{4 \pi }{ 2 \sqrt{\lr{a^2 + b^2}^2 – \lr{a^2 – b^2}^2 } } \\
&= \frac{2 \pi }{ \sqrt{4 a^2 b^2 } } \\
&= \frac{\pi }{ \Abs{ a b } },
\end{aligned}
\end{equation}
and for \( a^2 < b^2 \) where \( \alpha < 0 \), the enclosed pole is at \( z = -\alpha – \sqrt{ \alpha^2 – 1} \), where
\begin{equation}\label{eqn:ellipicalIntegral:120}
\begin{aligned}
I
&= 2 \pi i \frac{2}{i \lr{ a^2 – b^2 }} \evalbar{ \frac{1}{ z + \alpha – \sqrt{\alpha^2 – 1 } }}{z = -\alpha – \sqrt{ \alpha^2 – 1}} \\
&= \frac{4 \pi}{ a^2 – b^2 } \frac{1}{ -2 \sqrt{\alpha^2 – 1 } } \\
&= \frac{4 \pi}{ b^2 – a^2 } \frac{1}{ 2 \sqrt{\alpha^2 – 1 } } \\
&= \frac{4 \pi }{ 2 \sqrt{\lr{a^2 + b^2}^2 – \lr{b^2 – a^2}^2 } } \\
&= \frac{2 \pi }{ \sqrt{4 a^2 b^2 } } \\
&= \frac{\pi }{ \Abs{ a b } }.
\end{aligned}
\end{equation}
Observe that this also holds for the \( a = b \) case.

References

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

[2] CalcInsights. A decent integral problem to try out, 2025. URL https://x.com/CalcInsights_/status/1880110549146431780. [Online; accessed 18-Jan-2025].

Green’s function video series is now done

March 15, 2022 math and physics play , , , , , , , ,

I’ve been working on a Green’s function video series, available on both Odysee and the old legacy CensorshipTube.  In this series, I am working from the great Dover book [1].  You can think of this book as a one stop shop containing most of the advanced mathematical tricks that any graduate student in physics or engineering would ever need.

I chose to leisurely visit most of the single variable Green’s function content from chapter 7 of this book in this video series, with focus on the damped forced harmonic oscillator problem
\begin{equation}\label{eqn:greens:20}
\LL x(t) = F(t),
\end{equation}
where
\begin{equation}\label{eqn:greens:40}
\LL = \frac{d^2}{dt^2} + 2 \gamma \frac{d}{dt} + \omega_0^2.
\end{equation}
In more pedestrian notation, this problem is the differential equation
\begin{equation}\label{eqn:greens:60}
x”(t) + 2 \gamma x'(t) + \omega_0^2 x(t) = F(t).
\end{equation}

Green’s function solution to the forced damped harmonic oscillator

In the first video, of what I thought would probably be three videos, we formally solve this problem, by attacking it with Fourier transform pairs
\begin{equation}\label{eqn:greens:80}
\begin{aligned}
\hat{f}(k) &= \inv{\sqrt{2\pi}} \int_{-\infty}^\infty e^{i k t} f(t) dt \\
f(t) &= \inv{\sqrt{2\pi}} \int_{-\infty}^\infty e^{-i k t} \hat{f}(k) dk,
\end{aligned}
\end{equation}
and find a specific solution to the forcing problem
\begin{equation}\label{eqn:greens:100}
x(t) = \int_{-\infty}^\infty G(t,t’) F(t’) dt’,
\end{equation}
where our convolution kernel (later shown to satisfy the Green’s function criteria) is
\begin{equation}\label{eqn:greens:120}
G(t,t’) = -\inv{2 \pi} \int_{-\infty}^\infty \frac{e^{-ik(t-t’)}}{k^2 + 2 i \gamma k – \omega_0^2} dk.
\end{equation}
We also find that the homogeneous solutions have the form
\begin{equation}\label{eqn:greens:140}
x(t) = e^{-\gamma t \pm i \alpha t},
\end{equation}
where \( \alpha = \sqrt{ \omega_0^2 – \gamma_2 } \).

Evaluating the Fourier convolution kernel for the forced damped harmonic oscillator

In the second video we proceed to dig out our coutour integration techniques and use them to evaluate the convolution kernel. I do a very quick non-rigorous refresher and justification of contour integration and residue analysis, and then proceed to tackle our convolution kernel, rewritten as
\begin{equation}\label{eqn:greens:160}
G(t,t’) = -\inv{2 \pi} \int_{-\infty}^\infty \frac{e^{-ik(t-t’)}}{\lr{k – k_1}\lr{ k – k_2}} dk.
\end{equation}
We evaluate this in top and bottom half plane infinite closed semi-circular contours (both of which include the real axis component that we are interested in).  We find that the upper half semi-circular path is zero for \( t – t’ < 0 \), as is the entire integral, as it encloses no poles. We find that the lower half semi-circular path is zero for \( t – t’ > 0 \), so the real axis integral can be evaluated by computing the two residues.  In the end we find
\begin{equation}\label{eqn:greens:180}
G(t,t’) = \Theta(t – t’) e^{-\gamma(t-t’)} \frac{\sin(\alpha (t – t’))}{\alpha}.
\end{equation}
Incidentally, we see that the Green’s function, in this case, is a Heavyside-theta weighted superposition of homogeneous solutions. Specifically, if
\begin{equation}\label{eqn:greens:200}
\begin{aligned}
x_1(t) &= e^{-\gamma t + i \alpha t} \\
x_2(t) &= e^{-\gamma t – i \alpha t},
\end{aligned}
\end{equation}
then
\begin{equation}\label{eqn:greens:220}
G(t,t’) = \Theta(t-t’) \lr{
\frac{x_1(-t’)}{2 i \alpha} x_1(t)

\frac{x_2(-t’)}{2 i \alpha} x_2(t)
}.
\end{equation}
This becomes relevant later in the series when we derive and utilize Wrokskian determinant form of the Green’s function.

Showing that the convolution kernel for the forced damped harmonic oscillator is a Greens function

In the third video, we demonstrate that the convolution kernel that we derived using Fourier transforms, and contour integration, is in fact a Green’s function for the problem. That is
\begin{equation}\label{eqn:greens:240}
\LL G(t,t’) = \delta(t- t’).
\end{equation}
This is a formal way of expressing the fact that the Green’s function is an inverse of the linear operator. Specifically, given
\begin{equation}\label{eqn:greens:260}
x(t) = \int_{-\infty}^{\infty} G(t,t’) F(t’) dt’,
\end{equation}
then application of our linear operator to both sides gives
\begin{equation}\label{eqn:greens:280}
\LL x(t) = \int_{-\infty}^{\infty} \LL G(t,t’) F(t’) dt’,
\end{equation}
so if \ref{eqn:greens:240} is true, we have
\begin{equation}\label{eqn:greens:300}
\LL x(t) = F(t),
\end{equation}
as desired.

Green’s function for a first order linear system: two different ways

My trilogy in four parts steps backwards slightly in preparation for examination of the Wronskian method of Green’s function construction. Here I tackle one of the simplest first order single variable systems, that of
\begin{equation}\label{eqn:greens:320}
\LL = \frac{d}{dt} + \alpha.
\end{equation}
We derive the Green’s function, first using the now familiar Fourier transform and contour integration methods, and then attempt to find the Green’s function by demanding that it has the structure of a piecewise superposition of homogeneous solutions, which is the method used in the book for second order systems. Since we have a first order system, our superposition is trivially simple, as it requires only scaling our homogeneous solution \( x_1(t) = e^{-\alpha t} \) in each of the domains
\begin{equation}\label{eqn:greens:340}
\begin{aligned}
G(t,t’) &= A x_1(t), \quad t – t’ > 0 \\
G(t,t’) &= B x_1(t), \quad t – t’ < 0.
\end{aligned}
\end{equation}
We find that
\begin{equation}\label{eqn:greens:360}
G(t,t’) = B e^{-\alpha t} + \Theta(t- t’) e^{-\alpha (t – t’) }.
\end{equation}
The second term is precisely what we found by direct Fourier transformation, and the first is related to the boundary conditions for the Green’s function itself, something that we address in the final video.

Wronskian form for the Green’s Function of a general 2nd order one variable differential equation

In this part of my trilogy in five parts, we derive the Wronskian form of the Green’s function for a second order differential equation. Given
\begin{equation}\label{eqn:greens:380}
\LL = f_0(t) \frac{d^2}{dt^2} + f_1(t) \frac{d}{dt} + f_2(t),
\end{equation}
and two homogenous solutions \( x_1(t), x_2(t) \), we find
\begin{equation}\label{eqn:greens:400}
G(t,t’) = \alpha x_1(t) + \beta x_2(t) +
\frac{\Theta(t- t’)}{f_0(t’)} \frac{
\begin{vmatrix}
x_1(t’) & x_2(t’) \\
x_1(t) & x_2(t) \\
\end{vmatrix}
}
{
\begin{vmatrix}
x_1(t’) & x_2(t’) \\
x_1′(t’) & x_2′(t’) \\
\end{vmatrix}
}.
\end{equation}
We use this to re-derive the Green’s function for the forced, damped, harmonic oscillator, finding the previous result from Fourier-transform and contour integration (provided we set \( \alpha = \beta = 0 \).)

Green’s function boundary value conditions

In this final sixth video, my channelling of Douglas Adams (trilogy in four and then five parts) fails completely. However, I do finally address boundary conditions for the Green’s function itself. I don’t use the damped forced harmonic oscillator, but the very simplest second order system
\begin{equation}\label{eqn:greens:420}
x”(t) = F(t).
\end{equation}
I chose this equation, and not the damped forced HO, because the Green’s function for this system was derived twice in the text by direct integration. Once for the single point boundary condition
\begin{equation}\label{eqn:greens:440}
\begin{aligned}
x(a) &= x_0 \\
x'(a) &= \bar{x}_0,
\end{aligned}
\end{equation}
and once for a two point boundary condition
\begin{equation}\label{eqn:greens:460}
\begin{aligned}
x(0) &= x_0 \\
x(1) &= x_1.
\end{aligned}
\end{equation}

I apply the Wronskian method to derive the Green’s function for this differential operator, which is just
\begin{equation}\label{eqn:greens:480}
G(t,t’) = \alpha + \beta t + \lr{t-t’} \Theta(t-t’),
\end{equation}
and then proceed to apply the pair of boundary conditions to the Green’s function, fixing the \( \alpha \) and \( \beta \) constants for each. There’s a bit of subtlety and hand waving required to get the right results, so it is probably worth repeating the problem for some more complex cases in the future and making sure that I do fully understand how this works. I am able to rederive the Green’s functions from the text for each of the two boundary condition cases.

This business of application of the boundary conditions to the Green’s function itself is very important, and as I found back when I took QM-I (phy356). If you don’t do it, then you get the wrong answers. Perhaps, now finally armed with a better understanding of the tools, I should go back, find that problem again and try it anew.

References

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