Question:medium

Periodic function \(f(x)\) is given below.
\[ f(x)=\begin{cases}-1, & -\pi < x < 0 \\ 1, & 0 < x < \pi\end{cases}; \quad f(x+2\pi)=f(x) \]
The CORRECT option representing the Fourier series expansion of \(f(x)\) is:

Show Hint

Check whether \(f(x)\) is odd or even first: an odd function's Fourier series has no constant term and no cosine terms, only sines.
Updated On: Jul 22, 2026
  • \(f(x)=\dfrac{4}{\pi}\Big[\sin x+\dfrac{\sin 3x}{3}+\dfrac{\sin 5x}{5}+\cdots\Big]\)
  • \(f(x)=-\dfrac{4}{\pi}\Big[\sin x+\dfrac{\sin 3x}{3}+\dfrac{\sin 5x}{5}+\cdots\Big]\)
  • \(f(x)=1+\dfrac{4}{\pi}\Big[\sin x+\dfrac{\sin 3x}{3}+\dfrac{\sin 5x}{5}+\cdots\Big]\)
  • \(f(x)=1-\dfrac{4}{\pi}\Big[\sin x+\dfrac{\sin 3x}{3}+\dfrac{\sin 5x}{5}+\cdots\Big]\)
Show Solution

The Correct Option is A

Solution and Explanation

Step 1: Write the complex exponential Fourier series.
For period $2\pi$, write $f(x)=\sum_{n=-\infty}^{\infty}c_ne^{inx}$, where
\[ c_n=\frac{1}{2\pi}\int_{-\pi}^{\pi}f(x)e^{-inx}\,dx \]

Step 2: Split the integral over the two pieces where $f$ is defined.
\[ c_n=\frac{1}{2\pi}\left[\int_{-\pi}^{0}(-1)e^{-inx}\,dx+\int_{0}^{\pi}(1)e^{-inx}\,dx\right] \]
Using $\int e^{-inx}dx=\dfrac{e^{-inx}}{-in}$ for $n\neq 0$:
\[ \int_{-\pi}^{0}(-1)e^{-inx}dx=\frac{1-e^{in\pi}}{in},\qquad \int_{0}^{\pi}(1)e^{-inx}dx=\frac{1-e^{-in\pi}}{in} \]

Step 3: Add the two pieces and simplify using $e^{\pm in\pi}=(-1)^n$.
\[ c_n=\frac{1}{2\pi}\left[\frac{1-(-1)^n}{in}+\frac{1-(-1)^n}{in}\right]=\frac{1-(-1)^n}{in\pi} \]
For even $n$, $(-1)^n=1$, so $c_n=0$. For odd $n$, $(-1)^n=-1$, so $c_n=\dfrac{2}{in\pi}=-\dfrac{2i}{n\pi}$. Also $c_0=\dfrac{1}{2\pi}\int_{-\pi}^{\pi}f(x)\,dx=0$ since the areas at $+1$ and $-1$ cancel.

Step 4: Convert back to real sine terms by pairing $n$ and $-n$.
For odd $n>0$: $c_ne^{inx}+c_{-n}e^{-inx}=-\dfrac{2i}{n\pi}e^{inx}+\dfrac{2i}{n\pi}e^{-inx}=-\dfrac{2i}{n\pi}(e^{inx}-e^{-inx})=-\dfrac{2i}{n\pi}(2i\sin nx)=\dfrac{4}{n\pi}\sin nx$, using $e^{inx}-e^{-inx}=2i\sin nx$. This matches the sine coefficient found by the direct real-integral method.

Step 5: Sum over all odd positive $n$.
\[ f(x)=\sum_{n\text{ odd}>0}\frac{4}{n\pi}\sin nx=\frac{4}{\pi}\left[\sin x+\frac{\sin 3x}{3}+\frac{\sin 5x}{5}+\cdots\right] \]

Final Answer:
\[ \boxed{f(x)=\frac{4}{\pi}\left[\sin x+\frac{\sin 3x}{3}+\frac{\sin 5x}{5}+\cdots\right]} \], option (A), reached here through the complex exponential form instead of the direct real sine-coefficient integral.
Was this answer helpful?
0


Questions Asked in GATE CE exam