I have solve this differential equation :
$$\left\{\begin{aligned}\frac{dy}{dx} + y &= f(x) \\
y (0)&=0.
\end{aligned}\right.$$
where $f (x) = \begin{cases}2 & \text{if } 0 \leq x < 1 \\
0 &\text{if }x \geq 1.\end{cases}$
Please explain how to solve as it involves discontinuous function $f$.