If I have a function f(x) like this:
\begin{cases} 0 & 0 \leq x\leq1 \\ 1 & 1< x \leq 2 \end{cases}
I want to find sine series, for example so I use the formula below:

My issue is, how to determine L? I assumed at the beginning that we look at the intervals, and see the amount in which they differ, like 1-0 = 1, or 2-1 = 1. But this is clearely wrong because in this prolem L =2. How do you determine L, in general?
Also, function graph:
