0

Please verify my solution to this exercise

$f(x)=\left\{\begin{array}{rcl} \pi & \mbox{ si } & -\pi \leq x \leq \pi/2 \\ 0 & \mbox{ si } & \pi/2 < x < \pi \end{array}\right.$

$$a_0 = \frac{1}{2\pi}\int_{-\pi}^{\pi}f(x)dx=\frac{1}{2\pi}\int_{-\pi/2}^{\pi}\pi dx=\frac{1}{2}\int_{-\pi}^{\pi/2}dx=\frac{1}{2}((\pi/2)-(-\pi))=\frac{3}{4}\pi$$

$$a_n= \frac{1}{\pi}\int_{-\pi}^{\pi/2}\pi \cos(\frac{n\pi x}{\pi})dx=\int_{-\pi}^{\pi/2}\cos nx = \frac{1}{n}(\sin n\frac{\pi}{2} -\sin(-n\pi))=\frac{1}{n}$$

$$b_n=\frac{1}{\pi}\int_{-\pi}^{\pi/2}\pi\sin(\frac{n\pi x}{\pi})dx=\int_{-\pi}^{\pi/2}=-\frac{1}{n}(\cos (n\frac{\pi}{2})-\cos(-n\pi))=\frac{1}{n}$$

$F(x)=\frac{3}{4}\pi+\sum_{n=1}^{\infty}\frac{1}{n}(\cos nx+\sin nx)$

Cure
  • 4,051
  • 1
    I think $a_0$ is correct. For $a_n$, note that $\sin(-n\pi) = 0$ for any integer $n$, but $\sin (n \frac{\pi}{2}) = 1, 0, -1, 0, 1, 0, -1, 0, \ldots$. For $b_0$, we have $\cos(-n\pi) = (-1)^n$, and $\cos(n \frac{\pi}{2}) = 0, -1, 0, 1, 0, -1, 0, 1, \ldots$. So the simplification to $1/n$ looks wrong in both cases. –  Nov 30 '16 at 00:10

1 Answers1

1

Observe that

$$\frac1n\left(\sin\frac{n\pi}2-\sin(-n\pi)\right)=\frac1n\sin\frac{n\pi}2=\begin{cases}0,&n=0\pmod2\\{}\\\frac1n,&n=1\pmod4\\{}\\-\frac1n,&n=3\pmod4\end{cases}$$

and also

$$-\frac{1}{n}\left(\cos\frac{n\pi}2-\cos(n\pi)\right)=\begin{cases}-\frac1n(0-(-1))=-\frac1n,&n=1\pmod2\\{}\\-\frac1n(-1-1)=\frac2n,&n=2\pmod4\\{}\\-\frac1n(1-1)=0,&n=0\pmod4\end{cases}$$

Thus, you can see things aren't quite as you wrote them

DonAntonio
  • 211,718
  • 17
  • 136
  • 287