# Integrating $\int_{0}^{r} \sqrt{r^2 - x^2} \cos(wx)dx$

I am attempting to integrate the following:

$$\int_{0}^{r} \sqrt{r^2 - x^2} \cos(wx)dx$$

My first thought was to attempt integration by parts and then substitution, which yields:

$$\frac{\sqrt{r^2 - x^2}\sin(wx)}{w} + \frac{1}{wr^{3}}\int_{0}^{r}\frac{x}{\sqrt{1 - \frac{x}{r}^2}}\sin(wx)dx$$

However, from here I am stuck. Using substitution like $$\frac{x}{r}=\cos(u)$$ gives $$dx=-r\sin(u)$$ and $$x=r\cos(u)$$. Am I missing something obvious here? It has been a minute since I have done more complicated integrals.

For background, this is supposed to be the Fourier integral of the following function:

$$f(x)=2n_1\sqrt{r^2-x^2}$$

So essentially finding the Fourier integral of the above. Any help and suggestion is welcome.

• I haven't worked out any details, but it might be fruitful to set $x = r \sin \theta$, use symmetry to write the integral as some multiple of some integral in $\theta$ over $[0, 2\pi]$, substitute $z := e^{i\theta}$ to realize the integral as a contour integral along the unit circle, and apply the Residue Theorem. Commented May 2, 2023 at 0:57

Substituting $$x = r \sin \theta$$ transforms the integral to $$r^2 \int_0^\frac{\pi}{2} \cos^2 \theta \cos (w r \sin \theta) \,d\theta .$$ By symmetry this is $$\frac{r^2}{4} \int_0^{2 \pi} \cos^2 \theta \cos (w r \sin \theta) \,d\theta = \frac{r^2}{4} \int_0^{2 \pi} \cos^2 \theta \exp( iw r \sin \theta) \,d\theta .$$ (Also by symmetry the integral of the imaginary part of $$\cos^2 \theta \exp(i w r \sin \theta)$$ is zero.) These new bounds have the advantage of transforming our integral into one over the unit circle, $$S^1$$, via the standard parameterization $$z = e^{i \theta}$$, $$dz = i e^{i \theta}\,d\theta$$, which implies that $$d\theta = \frac{dz}{i z}$$. Under this change of variable, and along $$S^1$$, we have $$\cos \theta = \frac{1}{2} \left(z + \frac{1}{z}\right)$$ and $$\sin \theta = \frac{1}{2 i} \left(z - \frac{1}{z}\right)$$, so the integral becomes $$\oint_{S^1} \left[\frac{1}{2}\left(z + \frac{1}{z}\right)\right]^2 \exp\left[\frac{wr}{2} \left(z - \frac{1}{z}\right)\right] \frac{dz}{iz} = \frac{1}{4 i} \oint_{S^1} \left(z + \frac{2}{z} + \frac{1}{z^2}\right) \exp\left[\frac{wr}{2} \left(z - \frac{1}{z}\right)\right] \,dz.$$ We can now apply the Residue Theorem, and the Bessel functions appear in our computation, almost by definition: The Bessel functions $$J_n(u)$$ at integer parameter values $$n$$ can be defined as the Laurent series coefficients in the expansion $$\exp\left[\frac{u}{2} \left(z - \frac{1}{z}\right)\right] = \sum_{n=-\infty}^\infty J_n(u) z^n .$$ Looking for contributions to the $$\frac{1}{z}$$ term in the Laurent expansion, we find that \begin{align*} \operatorname{Res}\left(\left(z + \frac{2}{z} + \frac{1}{z^2}\right) \exp\left[\frac{wr}{2} \left(z - \frac{1}{z}\right)\right]; 0\right) &= J_{-2}(wr) + 2 J_0(wr) + J_2(wr) \\ &= 2 [J_0(wr) + J_2(wr)] \\ &= 2 \cdot \frac{2}{wr} J_1(w r) \\ &= \frac{4}{wr} J_1(w r) . \end{align*} In the second equality above, we've used the symmetry $$J_{-n} = (-1)^n J_n$$, and in the third we've applied the usual recurrence relation satisfied by the Bessel functions to simplify our expression.
So, the Residue Theorem yields $$\frac{1}{4 i} \oint_{S^1} \left(z + \frac{2}{z} + \frac{1}{z^2}\right) \exp\left[\frac{wr}{2} \left(z - \frac{1}{z}\right)\right] \,dz = \frac{1}{4 i} \cdot 2 \pi i \cdot \frac{4}{wr} J_1(w r) = \frac{2 \pi}{w r} J_1(w r).$$ Finally, multiplying by $$\frac{r^2}{4}$$ gives that our original integral has value $$\int_0^r \sqrt{r^2 - x^2} \cos(w x) \,dx = \boxed{\frac{\pi r}{2 w} J_1(w r)}.$$ Regarded as a function of $$w$$ this quantity has a removable singularity at $$w = 0$$, where it approaches $$\frac{\pi r^2}{4}$$.
Under $$x = r \sin \theta$$, one has $$\begin{eqnarray} &&\int_{0}^{r} \sqrt{r^2 - x^2} \cos(wx)dx\\ &=&r^2 \int_0^\frac{\pi}{2} \cos^2 \theta \cos (w r \sin \theta) \,d\theta \\ &=&r^2\int_0^{\frac\pi2} \cos^2\theta\sum_{n=0}^\infty \frac{(-1)^{n}}{(2n)!}w^{2n} r^{2n} \sin^{2n} \theta \,d\theta \\ &=&r^2\sum_{n=0}^\infty \frac{(-1)^{n}}{(2n)!}w^{2n} r^{2n} \int_0^{\frac\pi2}\cos^2\theta\sin^{2n} \theta \,d\theta \\ &=&r^2\sum_{n=0}^\infty \frac{(-1)^{n}}{(2n)!}w^{2n} r^{2n} \frac{\sqrt{\pi}\Gamma(n+\frac12)}{4(n+1)!} \\ &=&r^2\sum_{n=0}^\infty \frac{(-1)^{n}\pi(2n-1)!!}{2^{n+2}(2n)!(n+1)!}w^{2n} r^{2n}. \end{eqnarray}$$ Here $$\int_0^{\frac\pi2}\cos^pt\sin^qtdt=\frac{\Gamma(\frac{p+1}2)\Gamma(\frac{q+1}2)}{2\Gamma(\frac{p+q+2}2)}$$ is used.