Fourier series for $\sec(x)$

2.2k Views Asked by At

Expand in Fourier series the function $$f(x)=\sec(x) \quad x\in(-\pi/4,\pi/4).$$ Hint: Deduce a relation between the coefficients $a_n$ and $a_{n-2}$

Since this function is even, $b_n=0$ and $$a_n=\frac{8}{\pi}\int_0^{\pi/4}\sec(x)\cos(4nx)dx$$ and $$\begin{align} a_{n-2} & = \frac{8}{\pi}\int_0^{\pi/4}\sec(x)\cos(4nx-8x)dx \\ & = \frac{8}{\pi}\int_0^{\pi/4}\sec(x)(\cos(4nx)\cos(8x)+\sin(4nx)\sin(8x))dx \end{align}$$

From here I don't know how to follow the hint, it just get messier and messier, because they all have different arguments.

2

There are 2 best solutions below

7
On BEST ANSWER

$$\begin{eqnarray*}\int_{-\pi/4}^{\pi/4}\frac{\cos((4n+4)x)-\cos(4nx)}{\cos x}\,dx &=& -4\int_{\pi/4}^{\pi/4}\sin(x)\sin((4n+2)x)\,dx\\&=&-\frac{4\sqrt{2}(-1)^n}{(4n+2)^2-1}\\&=&-\frac{4\sqrt{2}(-1)^n}{(4n+1)(4n+3)}\\&=&2\sqrt{2}\left(\frac{(-1)^n}{4n+3}-\frac{(-1)^n}{4n+1}\right)\tag{1}\end{eqnarray*}$$ so summing both sides of this identity for $n=0,\ldots,N-1$ we get:

$$\int_{-\pi/4}^{\pi/4}\frac{\cos(4Nx)}{\cos x}\,dx = I_0 + 2\sqrt{2}\sum_{n=0}^{N-1}\left(\frac{(-1)^n}{4n+3}-\frac{(-1)^n}{4n+1}\right) \tag{2} $$ where: $$ I_0 = \int_{-\pi/4}^{\pi/4}\frac{dx}{\cos x} = 2\,\text{arccoth}(\sqrt{2}) = 2\log(1+\sqrt{2}).\tag{3}$$

Incidentally, line $(2)$ together with the Riemann-Lebesgue lemma gives: $$ \sum_{n=0}^{+\infty}\left(\frac{1}{8n+1}-\frac{1}{8n+3}-\frac{1}{8n+5}+\frac{1}{8n+7}\right)=\frac{1}{\sqrt{2}}\,\log(1+\sqrt{2}).\tag{4}$$ $(2)$ is also enough to prove that $c_N$, the coefficient of $\cos(4Nx)$ in the Fourier series of $\frac{1}{\cos x}$, behaves like $C\cdot\frac{(-1)^N}{N^2}$ for large $N$s. $(2)$ may be seen also as a consequence of: $$ \mathcal{L}\left(\frac{1}{\cosh x}\right) = \frac{1}{2}\left(\psi\left(\frac{s+3}{4}\right)-\psi\left(\frac{s+1}{4}\right)\right),\tag{5}$$ where $\psi(z)=\frac{d}{dz}\log\Gamma(z)=\frac{\Gamma'(z)}{\Gamma(z)}.$

1
On

Here is yet another way to proceed. We have the integral of interest $I$ which is defined as

$$\begin{align} I_n&\equiv \frac{8}{\pi}\int_0^{\pi/4}\sec x\cos(4nx)dx\\\\ &=\text{Re}\left(\frac{8}{\pi}\int_0^{\pi/4}\sec x\,e^{i4nx}dx\right) \tag 1 \end{align}$$

We will evaluate $I_n$ in $(1)$ using the method of contour integration. To that end, we analyze the contour integral $J_n$ defined as

$$J_n\equiv \text{Re}\left(\frac{16}{i\pi}\oint_C \frac{z^{4n}}{z^2+1}dz\right)$$

where $C$ is the "pie-shaped" contour that is comprised of

$(C_1)$ the line segment along the real axis from $(0,0)$ to $(1,0)$

$(C_2)$ the arc along the unit circle from $(1,0)$ to $(\sqrt{2}/2,\sqrt{2}/2)$

$(C_3)$ the line segment from $(\sqrt{2}/2,\sqrt{2}/2)$ to $(0,0)$

From the residue theorem,

$$J_n=0 \tag 2$$

since $\frac{z^{4n}}{z^2+1}$ is analytic in $C$.


The integral $J_n^{(1)}$ over $C_1$ is given by

$$\begin{align} J_n^{(1)} &= \text{Re}\left(\frac{16}{i\pi}\int_0^1 \frac{x^{4n}}{x^2+1}dx\right)\\\\ &=0 \tag 3 \end{align}$$

since $\int_0^1 \frac{x^{4n}}{x^2+1}dx$ is purely real.


The integral $J_n^{(2)}$ over $C_2$ is given by

$$\begin{align} J_n^{(2)} &= \text{Re}\left( \frac{16}{i\pi}\int_0^{\pi/4} \frac{(e^{ix})^{4n}}{(e^{ix})^2+1}ie^{ix}dx\right)\\\\ &=\text{Re}\left(\frac{8}{\pi}\int_0^{\pi/4}\frac{e^{i4nx}}{\cos x}dx\right)\\\\ &=\frac{8}{\pi}\int_0^{\pi/4}\sec x\cos (4nx)dx\\\\ &=I_n \tag 4 \end{align}$$


The integral $J_n^{(3)}$ over $C_3$ is given by

$$\begin{align} J_n^{(3)}&= \text{Re}\left(\frac{16}{i\pi}\int_1^0\frac{(e^{i\pi/4}t)^{4n}}{(e^{i\pi/4}t)^2+1}e^{i\pi/4}dt\right)\\\\ &=\frac{(-1)^n16}{\pi\sqrt{2}}\int_0^1\frac{t^{4n}(t^2-1)}{t^4+1}dt \tag 5 \end{align}$$


Using $(2)-(5)$ reveals that

$$I_n=\frac{(-1)^{n+1}16}{\pi\sqrt{2}}\int_0^1\frac{t^{4n}(t^2-1)}{t^4+1}dt \tag 6$$


We now examine the sum of the telescoping terms $I_{n+1}-I_n$.

First, using $(6)$, observe that we have

$$\begin{align} I_{n+1}&=\frac{(-1)^{n+2}16}{\pi\sqrt{2}}\int_0^1 \frac{t^{4n+4}(t^2-1)}{(t^4+1)}dt\\\\ &=\frac{(-1)^{n}16}{\pi\sqrt{2}}\int_0^1t^{4n}(t^2-1)\left(1-\frac{1}{t^4+1}\right)dt\\\\ &=\frac{(-1)^n16}{\pi\sqrt{2}}\int_0^1(t^2-1)t^{4n}dt\\\\ &+I_n\\\\ &=I_n+\frac{(-1)^n16}{\pi\sqrt{2}}\left(\frac{1}{4n+3}-\frac{1}{4n+1}\right) \tag 7 \end{align}$$

Then, using $(7)$ shows that

$$\begin{align} I_N-I_0&=\sum_{n=0}^{N-1}(I_{n+1}-I_n)\\\\ &=\frac{16}{\pi\sqrt{2}}\sum_{n=0}^{N-1} (-1)^{n}\left(\frac{1}{4n+3}-\frac{1}{4n+1}\right)\\\\ I_N&=\bbox[5px,border:2px solid #C0A000]{I_0+\frac{16}{\pi\sqrt{2}}\sum_{n=0}^{N-1} (-1)^{n}\left(\frac{1}{4n+3}-\frac{1}{4n+1}\right)} \end{align}$$

where $I_0=\frac{8}{\pi}\int_0^{\pi/4}\sec x\,dx=\frac{4}{\pi}\log(3+2\sqrt{2})$, which agrees with the result obtained by @JackD'aurizio ... as expected!!