$-\int cosx dx = -sinx + d$, where $d \in \mathbb{R}$ is a constant of integration. Since we need only one (actually: anyone) of the indefinite integrals -in order to find an integration factor- we can pick $d=0$