I want to solve the following:
Given the $2\pi$ periodic function $f$:
$$ f(x) = \begin{cases} 2\pi & for \;\; 0 < x < K \\ 0 & for \;\; K < x<2\pi \end{cases} $$
Where K is a constant between $0$ and $2\pi$.
Find the complex Fourier Series of $f$.
I am new to these kinds of problem and I need an informal, step-by-step explanation of how one finds the series. Thanks so much for helping me out!
A small $caveat$: the function $f$ is not periodic, as it is defined only on $[0,2\pi]$. You need to introduce at first a periodic extension $\tilde{f}$, and then compute the Fourier coefficients of $\tilde{f}$. In the OP the period $T=2\pi$ is considered: you can draw the $2\pi$-periodic extension $\tilde{f}$ of $f$ quite easily.
The definition of Fourier coefficients (contained, for example in here) allows you to use the formulae in jiku's comment, where the period $T=2\pi$ is explicitly chosen.