Solving Even Function Integrals: $a_0$ & $a_n$

Click For Summary
SUMMARY

The forum discussion focuses on solving even function integrals specifically for the coefficients $a_0$ and $a_n$ in the Fourier series representation of the function $f(\theta) = \frac{a_0}{2} + \sum_{n=1}^{\infty} a_n \cos n\theta$. The integral for $a_0$ is calculated as $a_0 = \frac{4}{\pi}$ after resolving the integral $\int_{0}^{\pi} \sin \theta \, d\theta = 2$. For the coefficients $a_n$, it is established that $a_n = \frac{2}{\pi} \int_{0}^{\pi} \sin \theta \cos n\theta \, d\theta$, with specific results for even and odd $n$. The discussion emphasizes the importance of correctly applying integration techniques to derive these coefficients.

PREREQUISITES
  • Understanding of Fourier series and their coefficients
  • Knowledge of integration techniques, particularly integration by parts
  • Familiarity with trigonometric identities and properties of even functions
  • Experience with definite integrals, especially involving sine and cosine functions
NEXT STEPS
  • Learn about the derivation of Fourier series coefficients for periodic functions
  • Study integration by parts in depth, focusing on applications in Fourier analysis
  • Explore the properties of even and odd functions in mathematical analysis
  • Investigate the convergence of Fourier series and their applications in signal processing
USEFUL FOR

Mathematicians, physics students, and engineers interested in Fourier analysis, particularly those working with periodic functions and their integrals.

Dustinsfl
Messages
2,217
Reaction score
5
$f(-\theta) = |\sin(-\theta)| = |-\sin\theta| = |\sin\theta| = f(\theta)$.
Hence, $f$ is even, and we need to only consider.
$$
f(\theta) = \frac{a_0}{2} + \sum_{n = 1}^{\infty}a_n\cos n\theta.
$$

$$
a_0 = \frac{1}{\pi}\int_{-\pi}^{\pi}|\sin\theta|d\theta = \frac{1}{\pi}\int_{0}^{\pi}\sin\theta d\theta - \frac{1}{\pi}\int_{-\pi}^0\sin\theta d\theta = \frac{2}{\pi}\int_{0}^{\pi}\sin\theta d\theta
$$
but when I solve this integral, I get 0.
How do I solve this integral?
$$
a_n =\frac{1}{\pi}\int_{-\pi}^{\pi}|\sin\theta|\cos n\theta d\theta = \frac{2}{\pi}\int_{-\pi}^{\pi}\sin\theta\cos n\theta d\theta
$$
 
Physics news on Phys.org
Hi dwsmith, :)

dwsmith said:
$f(-\theta) = |\sin(-\theta)| = |-\sin\theta| = |\sin\theta| = f(\theta)$.
Hence, $f$ is even, and we need to only consider.
$$
f(\theta) = \frac{a_0}{2} + \sum_{n = 1}^{\infty}a_n\cos n\theta.
$$

$$
a_0 = \frac{1}{\pi}\int_{-\pi}^{\pi}|\sin\theta|d\theta = \frac{1}{\pi}\int_{0}^{\pi}\sin\theta d\theta - \frac{1}{\pi}\int_{-\pi}^0\sin\theta d\theta = \frac{2}{\pi}\int_{0}^{\pi}\sin\theta d\theta
$$
but when I solve this integral, I get 0.

\[\int_{0}^{\pi}\sin\theta d\theta=\left. -\cos\theta\right|^{\pi}_{0}=-\cos\pi+\cos 0=1+1=2\]

dwsmith said:
How do I solve this integral?
$$
a_n =\frac{1}{\pi}\int_{-\pi}^{\pi}|\sin\theta|\cos n\theta d\theta = \frac{2}{\pi}\int_{-\pi}^{\pi}\sin\theta\cos n\theta d\theta
$$

\begin{eqnarray}

\int_{-\pi}^{\pi}|\sin\theta|\cos n\theta d\theta&=&-\int_{-\pi}^{0}\sin\theta\cos n\theta d\theta+\int_{0}^{\pi}\sin\theta\cos n\theta d\theta\\

&=&\int_{0}^{\pi}\sin\theta\cos (n\pi-n\theta) d\theta+\int_{0}^{\pi}\sin\theta\cos n\theta d\theta\\

&=&(-1)^{n}\int_{0}^{\pi}\sin\theta\cos n\theta d\theta+\int_{0}^{\pi}\sin\theta\cos n\theta d\theta\\

\end{eqnarray}

\[\therefore a_{2n}=\frac{2}{\pi}\int_{0}^{\pi}\sin\theta\cos 2n\theta d\theta\mbox{ and }a_{2n+1}=0\mbox{ where }n\geq 1\]

Use integration by parts to evaluate this integral. Solution can be found >>here<<.

Kind Regards,
Sudharaka.
 
Last edited:
Sudharaka said:
$$
\int_{0}^{\pi}\sin\theta\cos (n\pi+n\theta) d\theta+\int_{0}^{\pi}\sin\theta\cos n\theta d\theta
$$
$$
(-1)^{n}\int_{0}^{\pi}\sin\theta\cos n\theta d\theta+\int_{0}^{\pi}\sin\theta\cos n\theta d\theta
$$

Why do you have this instead of
$$
2\int_{0}^{\pi}\sin\theta\cos n\theta d\theta
$$
 
dwsmith said:
$f(-\theta) = |\sin(-\theta)| = |-\sin\theta| = |\sin\theta| = f(\theta)$.
Hence, $f$ is even, and we need to only consider.
$$
f(\theta) = \frac{a_0}{2} + \sum_{n = 1}^{\infty}a_n\cos n\theta.
$$

$$
a_0 = \frac{1}{\pi}\int_{-\pi}^{\pi}|\sin\theta|d\theta = \frac{1}{\pi}\int_{0}^{\pi}\sin\theta d\theta - \frac{1}{\pi}\int_{-\pi}^0\sin\theta d\theta = \frac{2}{\pi}\int_{0}^{\pi}\sin\theta d\theta
$$
but when I solve this integral, I get 0.
$\displaystyle \int_{0}^{\pi}\sin\theta\, d\theta = 2$, so you should get $a_0 = 4/\pi.$

dwsmith said:
How do I solve this integral?
$$
a_n =\frac{1}{\pi}\int_{-\pi}^{\pi}|\sin\theta|\cos n\theta d\theta = \frac{2}{\pi}\int_{\color{red}0}^{\pi}\sin\theta \cos n\theta d\theta
$$
Integrate by parts twice, to get $$\int_{0}^{\pi}\sin\theta\cos n\theta\, d\theta = \begin{cases}\frac{-2}{n^2-1} & (n \text{ even}), \\ 0 & (n \text{ odd}). \end{cases}$$
 
dwsmith said:
Why do you have this instead of
$$
2\int_{0}^{\pi}\sin\theta\cos n\theta d\theta
$$

Both answers are fine, I didn't realize that first and made a confusion by thinking your answer is wrong. Opalg's post seem to answer your question directly.

Kind Regards,
Sudharaka.
 
The Fourier series is
$$
\frac{2}{\pi} - 2\sum_{n = 1}^{\infty}\frac{1}{4n^2 - 1}\cos 2n\theta.
$$
 
dwsmith said:
The Fourier series is
$$
\frac{2}{\pi} - 2\sum_{n = 1}^{\infty}\frac{1}{4n^2 - 1}\cos 2n\theta.
$$
Getting there! But you have still forgotten to multiply the integral by $2/\pi$ to get $a_n.$ The answer should be $$\frac{2}{\pi} - \frac4\pi\sum_{n = 1}^{\infty}\frac{1}{4n^2 - 1}\cos 2n\theta.$$
 
Opalg said:
Getting there! But you have still forgotten to multiply the integral by $2/\pi$ to get $a_n.$ The answer should be $$\frac{2}{\pi} - \frac4\pi\sum_{n = 1}^{\infty}\frac{1}{4n^2 - 1}\cos 2n\theta.$$

I had
$$
\frac{-2}{n\pi}\left[\left.\frac{\cos\theta\cos n\theta}{n}\right|_0^{\pi} - \frac{1}{n}\int_0^{\pi}\cos n\theta\sin\theta d\theta\right] = \frac{2}{\pi}\int_0^{\pi}\cos n\theta\sin\theta d\theta
$$
The $2/\pi$ canceled.
 
dwsmith said:
The $2/\pi$ canceled.
Huh? What did it cancel with? I can guarantee that the answer I gave in my previous comment is correct.
 

Similar threads

  • · Replies 15 ·
Replies
15
Views
3K
  • · Replies 14 ·
Replies
14
Views
2K
  • · Replies 4 ·
Replies
4
Views
3K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 29 ·
Replies
29
Views
5K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 13 ·
Replies
13
Views
6K
  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 19 ·
Replies
19
Views
2K