Variational approach to the milne problem with a specular and diffuse reflecting boundary