Differentiation of the value function in Burdett Mortensen (1998)
When you take the integral of a $\max_{\{\cdot\}}$ operator, I think you have to split the integral into two separate integrals with different supports on them.

Even if your value function is complicated and there is no differentiability, you only need continuity for an existence of a solution to solve the optimization problem.