Month: January 2025

A Green’s function solution to falling with resistance problem.

January 30, 2025 math and physics play , , , , , , , ,

[Click here for a PDF version of this post]

Motivation.

In a fun twitter/x post, we have a Green’s function solution to a constant acceleration problem with drag. The post is meant to be a joke, as the stated problem is: “A boy drops a ball from a height \( h \). What is the speed of the ball when it reaches the floor (no drag)?”

The joke is that nobody would solve this problem using Green’s functions, and nobody would solve this function using Green’s functions for the more general case, allowing for drag. Instead, you’d just solve this using energy balance, which makes the problem trivial.

That said, there are actually lots of cool ideas in the Green’s function method on the joke side of the solution.

So let’s play along with the joke and solve the general damped problem with Green’s functions. Along the way, we can fill in the missing details, and also explore some supplemental ideas that are worth understanding.

Setup.

The equation of motion is
\begin{equation}\label{eqn:greensDropWithResistance:20}
m \frac{d^2 \Bx}{dt^2} = – \gamma \frac{d \Bx}{dt} – m \Bg,
\end{equation}
where \( \Bg \) is a constant (positively oriented) force. The first detail that needs to be included, is that this isn’t the differential equation for the stated problem, and will become problematic should we attempt to apply Green’s function methods. We have to account for the “boy drops” part of the problem statement, and solve with a different forcing function, namely
\begin{equation}\label{eqn:greensDropWithResistance:40}
m \frac{d^2 \Bx}{dt^2} = – \gamma \frac{d \Bx}{dt} – m \Bg \Theta(t).
\end{equation}
This revised model of the system begins the application of the constant (gravitational) force, at time \( t = 0 \). This is now a system that will yield to Green’s function methods.

Fourier transform solution.

The joke solution has strong hints that Fourier transform methods were part of the story. In particular, it appears that the following definitions of the transform pair were used
\begin{equation}\label{eqn:greensDropWithResistance:60}
\begin{aligned}
\hatU(\omega) = F(u(t)) &= \int_{-\infty}^\infty u(t) e^{-i\omega t} dt \\
u(t) = F^{-1}(\hatU(\omega)) &= \inv{2\pi} \int_{-\infty}^\infty \hatU(\omega) e^{i\omega t} d\omega.
\end{aligned}
\end{equation}
However, if we are using Fourier transforms, why bother with Green’s functions? Instead, we can just solve for the system response using Fourier transforms. When looking for the system response, we usually pose the problem with more generality. For example, instead of the specific theta-weighted constant gravitational forcing function above, we seek to find the solution of
\begin{equation}\label{eqn:greensDropWithResistance:80}
m \frac{d^2 \Bx}{dt^2} + \gamma \frac{d \Bx}{dt} = \BF(t).
\end{equation}
We start by assuming that the Fourier transforms of \( \Bx(t), \BF(t) \) are \( \hat{\BX}(\omega), \hat{\BF}(\omega) \) so
\begin{equation}\label{eqn:greensDropWithResistance:100}
\Bx(t) = \inv{2\pi} \int_{-\infty}^\infty e^{i\omega t} \hat{\BX}(\omega) d\omega.
\end{equation}
Derivatives of this presumed Fourier representation are trivial
\begin{equation}\label{eqn:greensDropWithResistance:120}
\begin{aligned}
\Bx'(t) &= \inv{2\pi} \int_{-\infty}^\infty \lr{ i\omega } e^{i\omega t} \hat{\BX}(\omega) d\omega \\
\Bx”(t) &= \inv{2\pi} \int_{-\infty}^\infty \lr{ i\omega }^2 e^{i\omega t} \hat{\BX}(\omega) d\omega,
\end{aligned}
\end{equation}
so the frequency representation of our system is
\begin{equation}\label{eqn:greensDropWithResistance:140}
\inv{2\pi} \int_{-\infty}^\infty \lr{ m \lr{ i\omega }^2 + \gamma \lr{ i\omega} } e^{i\omega t} \hat{\BX}(\omega) d\omega
=
\inv{2\pi} \int_{-\infty}^\infty e^{i\omega t} \hat{\BF}(\omega) d\omega,
\end{equation}
or
\begin{equation}\label{eqn:greensDropWithResistance:160}
\hat{\BX}(\omega) = \frac{\hat{\BF}(\omega)}{-m \omega^2 + i \omega \gamma}.
\end{equation}
We now only have to inverse Fourier transform to find a solution, namely
\begin{equation}\label{eqn:greensDropWithResistance:180}
\begin{aligned}
\Bx(t)
&= \inv{2\pi} \int_{-\infty}^\infty e^{i\omega t} \frac{\hat{\BF}(\omega)}{-m \omega^2 + i \omega \gamma} d\omega \\
&= \inv{2\pi} \int_{-\infty}^\infty e^{i\omega t} \frac{1}{-m \omega^2 + i \omega \gamma} d\omega
\int_{-\infty}^\infty \BF(t’) e^{-i \omega t’} dt’ \\
&= \int_{-\infty}^\infty \lr{ -\inv{2\pi} \int_{-\infty}^\infty \frac{ e^{i\omega (t-t’)} }{m \omega^2 – i \omega \gamma} d\omega }F(t’) dt’,
\end{aligned}
\end{equation}
or
\begin{equation}\label{eqn:greensDropWithResistance:200}
\Bx(t) = \int_{-\infty}^\infty G(t – t’) \BF(t’) dt’,
\end{equation}
where
\begin{equation}\label{eqn:greensDropWithResistance:220}
G(\tau) = -\inv{2\pi} \int_{-\infty}^\infty \frac{ e^{i\omega \tau} }{\omega\lr{ m \omega – i \gamma}} d\omega.
\end{equation}

We’ve been fast and loose above, swapping order of integration without proper justification, and have assumed that all Fourier transforms and inverse transforms exist. Given all those assumptions, we now have a general solution for the system, requiring only the convolution of our driving force \( F(t) \) with the system response function \( G(t) \). The only caveat is that we have to be able to perform the integral for the system response function, and that integral does not exist.

There are lots of integrals that do not strictly exist when playing the fast and loose physicist game with Fourier transforms. One such example can be found by looking at any transform pair. For example, given \( u(t) = F^{-1}(\hatU(\omega)) \), we have
\begin{equation}\label{eqn:greensDropWithResistance:240}
\begin{aligned}
u(t)
&= \inv{2\pi} \int_{-\infty}^\infty \hatU(\omega) e^{i\omega t} d\omega \\
&= \inv{2\pi} \int_{-\infty}^\infty \lr{ \int_{-\infty}^\infty u(t’) e^{-i\omega t’} dt’ } e^{i\omega t} d\omega \\
&= \int_{-\infty}^\infty u(t’) \lr{ \inv{2\pi} \int_{-\infty}^\infty e^{i\omega (t-t’)} d\omega } dt’.
\end{aligned}
\end{equation}
This is exactly the sort of integration order swapping that we did to find the system response function above, and we are left with a statement that \( f(t) \) is the convolution of \( f(t) \), with another, also non-integrable, convolution kernel. Any physics student will recognize that kernel as a representation of the Dirac delta function, and without blinking, would just write
\begin{equation}\label{eqn:greensDropWithResistance:260}
\delta(\tau) = \inv{2\pi} \int_{-\infty}^\infty e^{i\omega \tau} d\omega,
\end{equation}
without worrying that it is not possible to evaluate this integral. Somebody who is trying to use the right mathematical language, would say that this isn’t a function, but is, instead a distribution. Just like this delta function distribution, our system response integral, something that we also cannot actually evaluate in a strict sense, is a distribution. It’s a beastie that has delta function like characteristics, and if we want to try to integrate it, we have to play sneaky games.

Let’s put off evaluating that integral for now, and return to the Green’s function description of the story.

The Green’s function picture.

Using Fourier transforms, we found that it theoretically possible to find a convolution solution to the system, and found the convolution kernel for the system. The rough idea behind Green’s functions is to assume that such a convolution exists, say
\begin{equation}\label{eqn:greensDropWithResistance:280}
\Bx(t) = \Bx_0(t) + \int_{-\infty}^\infty G(t,t’) \BF(t’) dt’,
\end{equation}
where \( \Bx_0(t) \) is any solution of the homogeneous problem satisfying, in this case,
\begin{equation}\label{eqn:greensDropWithResistance:300}
m \frac{d^2}{dt^2} \Bx_0(t) + \gamma \frac{d}{dt} \Bx_0(t) = 0,
\end{equation}
and \( G(t,t’) \) is a convolution kernel, representing the system response, to be determined.
If we plug this presumed solution into our differential equation, we find
\begin{equation}\label{eqn:greensDropWithResistance:320}
\int_{-\infty}^\infty \lr{
m \frac{\partial^2}{\partial t^2} G(t,t’)
+ \gamma \frac{\partial}{\partial t} G(t,t’)
} \BF(t’) dt’
=
\BF(t),
\end{equation}
but
\begin{equation}\label{eqn:greensDropWithResistance:340}
\BF(t) = \int_{-\infty}^\infty \BF(t’) \delta(t – t’) dt’,
\end{equation}
so, if we can find \( G \) satisfying
\begin{equation}\label{eqn:greensDropWithResistance:360}
m \frac{\partial^2}{\partial t^2} G(t,t’) + \gamma \frac{\partial}{\partial t} G(t,t’) = \delta(t – t’),
\end{equation}
then we have solved the system. We can simplify this slightly by presuming that the \( t,t’ \) dependence is always a difference, and seek \( G(\tau) \) such that
\begin{equation}\label{eqn:greensDropWithResistance:380}
m G”(\tau) + \gamma G'(\tau) = \delta(\tau).
\end{equation}
We now pull the Fourier transform out of our toolbox again, assuming that
\begin{equation}\label{eqn:greensDropWithResistance:400}
G(\tau) = \inv{2 \pi} \int_{-\infty}^\infty \hat{G}(\omega) e^{i\omega\tau} d\omega,
\end{equation}
for which
\begin{equation}\label{eqn:greensDropWithResistance:420}
\inv{2 \pi} \int_{-\infty}^\infty \lr{ m \lr{ i \omega }^2 + \gamma \lr{ i \omega } } \hat{G}(\omega) e^{i\omega \tau} d\omega
=
\inv{2 \pi } \int_{-\infty}^\infty e^{i\omega \tau} d\omega,
\end{equation}
or
\begin{equation}\label{eqn:greensDropWithResistance:440}
\hat{G}(\omega) = \inv{ m \lr{ i \omega }^2 + \gamma \lr{ i \omega } }.
\end{equation}
This is the Fourier transform of the Green’s function, and is exactly what we found earlier using pure Fourier transforms. Our starting point was different this time, as we just blatantly assumed that the solution had a convolution structure. We then found a differential equation for that convolution kernel, the Green’s function. Only then did we pull the Fourier transform out of the toolbox to attempt to find the structure of that Green’s function.

Evaluating the Green’s function integral.

We can’t go any further without figuring out what to do with our nasty little divergent integral \ref{eqn:greensDropWithResistance:220}. We may coerce this into something that we can evaluate using standard contour integration, if we offset the pole at the origin slightly. Given \( \epsilon > 0 \), let’s evaluate
\begin{equation}\label{eqn:greensDropWithResistance:460}
G(\tau, \epsilon) = -\inv{2\pi} \oint \frac{ e^{i z \tau} }{\lr{ z – i \epsilon } \lr{ m z – i \gamma}} dz.
\end{equation}
We can evaluate this integral using infinite semicircular contours, using an upper half plane contour for \( \tau > 0 \) and a lower half plane contour for \( \tau < 0 \), as illustrated in fig. 1, and fig. 2.

 

fig. 1. Contour for tau > 0.

 

 

fig. 2. Contour for tau < 0.

By Jordan’s lemma, that upper half plane infinite semicircular part of the contour integral is zero for the \( \tau > 0 \) case, and for the \( \tau < 0 \) case, the lower half plane infinite semicircular part of the contour integral is zero. We can proceed with the residue calculations. In the upper half plane, we have both of the enclosed poles, so \begin{equation}\label{eqn:greensDropWithResistance:480} \begin{aligned} G(\tau > 0, \epsilon)
&= -\inv{2\pi m } \int_{-\infty}^\infty \frac{ e^{i \omega \tau} }{\lr{ \omega – i \epsilon } \lr{ \omega – i \gamma/m}} d\omega \\
&= -\frac{ 2 \pi i }{ 2 \pi m} \lr{
\evalbar{ \frac{ e^{i z \tau} }{ z – i \gamma/m} }{z = i \epsilon}
+
\evalbar{ \frac{ e^{i z \tau} }{ z – i \epsilon } }{ z = i \gamma/m}
} \\
&=
-\frac{i}{m} \lr{
\frac{ e^{-\epsilon \tau} }{ i \epsilon – i \gamma/m}
+
\frac{ e^{-\gamma\tau/m} }{ i \gamma/m – i \epsilon }
} \\
&=
-\lr{
\frac{e^{-\epsilon \tau}}{ m \epsilon – \gamma }
+
\frac{ e^{-\gamma\tau/m} }{ \gamma – m \epsilon }
},
\end{aligned}
\end{equation}
and for the lower half plane, where there are no enclosed poles we have \( G(\tau < 0, \epsilon) = 0 \). In the \( \epsilon \rightarrow 0 \) limit, we are left with
\begin{equation}\label{eqn:greensDropWithResistance:500}
G(\tau) = \inv{\gamma} \lr{ 1 – e^{-\gamma \tau/m} } \Theta(\tau).
\end{equation}

Back to the original problem.

We may now go and find the specific solution for the original problem where \( F(t) = – m g \Be_2 \Theta(t) \). That solution is
\begin{equation}\label{eqn:greensDropWithResistance:520}
\begin{aligned}
\Bx(t)
&= \Bx(0) + \int_{-\infty}^\infty G(t – t’) \lr{ – m g \Be_2 \Theta(t’) } dt’ \\
&= \Bx(0) – m g \Be_2 \int_{-\infty}^\infty \frac{\Theta(t – t’)}{\gamma} \lr{ 1 – e^{-\gamma \lr{ t – t’}/m } } \Theta(t’) dt’ \\
&= \Bx(0) – m g \Be_2 \int_{0}^\infty \frac{\Theta(t – t’)}{\gamma} \lr{ 1 – e^{-\gamma \lr{ t – t’}/m } } dt’ \\
&= \Bx(0) – \frac{m g}{\gamma} \Be_2 \int_{0}^t \lr{ 1 – e^{-\gamma \lr{ t – t’}/m } } dt’ \\
&= \Bx(0) – \frac{m g}{\gamma} \Be_2 \int_0^t \lr{ 1 – e^{-\gamma u/m } } du \\
&= \Bx(0) – \frac{m g}{\gamma} \Be_2 \evalrange{ \lr{ t’ – \frac{e^{-\gamma u/m } }{-\gamma/m} } }{u=0}{t} \\
&= \Bx(0) – \frac{m g}{\gamma} \Be_2 \lr{ t + \frac{m e^{-\gamma t/m }}{\gamma} – \frac{m}{\gamma} } \\
&= \Bx(0) – \frac{m g t}{\gamma} \Be_2 – \frac{m^2 g}{\gamma^2} \lr{ 1 – e^{-\gamma t/m } }.
\end{aligned}
\end{equation}

Ignoring the missing factor of \( g \) on the last term in the twitter slide, this is the final result before the limiting argument on that slide.

Having found the Green’s function for this system, we could then, fairly trivially, use it to solve similar systems with different forcing functions. For example, suppose we have a mass on a table, with friction, and a forcing function (perhaps sinusoidal) moving that mass. We could then figure out the time response for that particular forcing function, and would only have a convolution integral to evaluate. That general applicability is one of the beauties of these transform or Green’s function methods.

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.

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.

A contour integral with a third order pole.

January 21, 2025 math and physics play , , ,

[Click here for a PDF version of this post]

Here’s problem 31(e) from [1]. Find
\begin{equation}\label{eqn:thirdOrderPole:20}
I = \int_0^\infty \frac{x^2 dx}{\lr{ a^2 + x^2 }^3 }.
\end{equation}
Again, we use the contour \( C \) illustrated in fig. 1

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

Along the infinite semicircle, with \( z = R e^{i\theta} \),
\begin{equation}\label{eqn:thirdOrderPole:40}
\Abs{ \int \frac{z^2 dz}{\lr{ a^2 + z^2 }^3 } } = O(R^3/R^6),
\end{equation}
which tends to zero. We are left to just evaluate some residues
\begin{equation}\label{eqn:thirdOrderPole:60}
\begin{aligned}
I
&= \inv{2} \oint \frac{z^2 dz}{ \lr{ a^2 + z^2 }^3 } \\
&= \inv{2} \oint \frac{z^2 dz}{ \lr{ z – i a }^3 \lr{ z + i a }^3 } \\
&= \inv{2} \lr{ 2 \pi i } \inv{2!} \evalbar{ \frac{d^2}{dz^2} \lr{ \frac{z^2}{ \lr{ z + i a }^3 } } }{z = i a}
\end{aligned}
\end{equation}
Evaluating the derivatives, we have
\begin{equation}\label{eqn:thirdOrderPole:80}
\begin{aligned}
\lr{ \frac{z^2}{ \lr{ z + i a }^3 } }’
&= \frac{ 2 z \lr{ z + i a } – 3 z^2 }{ \lr{ z + i a }^4 } \\
&=
\frac{ – z^2 + 2 i a z }
{ \lr{ z + i a }^4 },
\end{aligned}
\end{equation}
and
\begin{equation}\label{eqn:thirdOrderPole:100}
\begin{aligned}
\frac{d^2}{dz^2} \lr{ \frac{z^2}{ \lr{ z + i a }^3 } }
&= \lr{ \frac{ – z^2 + 2 i a z }
{ \lr{ z + i a }^4 } }’ \\
&= \frac{ \lr{ – 2 z + 2 i a }\lr{ z + i a} – 4 \lr{ – z^2 + 2 i a z }}{ \lr{ z + i a }^5 },
\end{aligned}
\end{equation}
so
\begin{equation}\label{eqn:thirdOrderPole:120}
\begin{aligned}
\evalbar{ \frac{d^2}{dz^2} \lr{ \frac{z^2}{ \lr{ z + i a }^3 } } }{z = i a}
&=
\frac{ \lr{ – 2 i a + 2 i a }\lr{ 2 i a} – 4 \lr{ a^2 – 2 a^2 }}{ \lr{ 2 i a }^5 } \\
&=
\frac{ 4 a^2 }{ \lr{ 2 i a }^5 } \\
&=
\inv{8 a^3 i}.
\end{aligned}
\end{equation}
Putting all the pieces together, we have
\begin{equation}\label{eqn:thirdOrderPole:140}
\boxed{
I = \frac{\pi}{16 a^3}.
}
\end{equation}

References

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