We study optimal quantum control robust against pulse inhomogeneities for various partial population transfers and single-qubit gates by inverse optimization. We show that the pulse is constant for time or energy minimization and we provide the analytic form of the detuning as Jacobi elliptic cosines. The performance of composite pulse techniques, which we optimize for the case of complete population transfer, is compared to this optimal bound.