Generation of discrete first‐ and second‐order sensitivities for single shooting