How to optimizing a function that takes two different forms in two different regions

18 Views Asked by At

enter image description here

a,b,and P are non-negative constants. And $\theta$ is a random variable with distribution function $F(\theta)$ and density function $f(\theta)$. Denote $H(\theta)= {F(\theta)\over f(\theta)}$. No constraints. My method is letting the first-order derivative equals to zero, and get the optimal $z(\theta)$, but there is a problem that ${(P-z(\theta))}^+$ is a non-differentiable function, so can't use first-order derivative.