code: def gauss_box_model_deriv(x, amplitude=1.0, mean=0.0, stddev=1.0, hpix=0.5):
      
      z = (x - mean) / stddev
      z2 = z + hpix / stddev
      z1 = z - hpix / stddev
  
      da = norm.cdf(z2) - norm.cdf(z1)
  
      fp2 = norm_pdf_t(z2)
      fp1 = norm_pdf_t(z1)
  
      dl = -amplitude / stddev * (fp2 - fp1)
      ds = -amplitude / stddev * (fp2 * z2 - fp1 * z1)
      dd = amplitude / stddev * (fp2 + fp1)
  
      return da, dl, ds, dd
docs: Derivative of the integral of  a Gaussian profile.