# Fourier series discontinuity

How do you formally fourier expand a function that has a discontinuity at a certain point, to get the right value at the point of discontinuity ? Let's say I wanted to expand the following function $f(x) = \begin{cases} U_0 & \quad \text{if } x \text{ > 0}\\ 0 & \quad \text{if } x \text{ = 0}\\ \end{cases}$

I know that if I choose the right $k$ in $f(x)= \sum_{k=0}^{k=\infty} a_k\cos(k x)+b_k\sin(k x)$ and find the right intervals this would be $0$ at $x=0$, is there a formal way of selecting the right $k$ ? Is this a consequence of the fact that the integrals in the definition for $a_k$ and $b_k$ are not "sensitive" for sets with volume equal to zero ?

When a function $f$ is periodic on $\mathbb{R}$ with period $2\pi$, and is of bounded variation on $[0,2\pi]$, then the Fourier series for $f$ converges pointwise everywhere on $\mathbb{R}$ to the mean of the left- and right-hand limits of $f$. The mean of the left- and right- hand limits of $f$ is not affected by redefining the function at a point. There are various other classical convergence theorems can be used to get at the same thing.