Given $$f(x)=\begin{cases}1,&-2<x<0\\ x,&0<x<2\end{cases}.$$ I want to check that whether the Fourier series converges to $f(x)$.
I have found the Fourier series of this function:
$$f(x)=1+\sum_{n=0}^\infty \frac{2}{n^2\pi^2}\left((-1)^n-1\right)\sin\left(\frac{n\pi x}{2}\right)+\sum_{n=1}^\infty \frac{2}{\pi n}(-1)^{n+1}\cos\left(\frac{n\pi x}{2}\right)$$
Now we check whether this series converges to $f(x)$ for the intervals $-2<x<0$ and $0<x<2$ .
This function has a jump discontinuity at $x=0$ because $f(0^{+})\neq f(0^{-})$ and note that on the intervals $-2<x<0$ and $0<x<2$ both the function and its derivative are continuous. Therefore it is a piecewise smooth function. Note that the function itself is not continuous at $x=0$ but because this point of discontinuity is a jump discontinuity the function is still piecewise smooth.
In the intervals $-2<x<0$ and $0<x<2$ the function and hence the periodic extension are both continuous and so on these two intervals the Fourier series will converge to the periodic extension and hence will converge to the function itself.
Edit: At the point $x=0$ the function has a jump discontinuity and so the periodic extension will also have a jump discontinuity at this point. That means that at $x=0$ the Fourier series will converge to,
$$\frac{1}{2}\left[f(0^+)+f(0^-)\right]=\frac{1}{2}$$
At the end point $x=2$, $f(x)$ has jump discontinuity. So the Fourier series converges to
$$\frac{1}{2}\left[f(2^+)+f(2^-)\right]=\frac{3}{2}$$
Hence the Fourier seris converges to $f(x)$.
Is it correct?
Please verify someone!
Thanks!