how can these forums help new people, like you, to post better questions?
Had a quick look at it and I can confirm that changing PWM_FREQUENCY in https://github.com/arduino/Arduino/blob/ide-1.5.x/hardware/arduino/sam/variants/arduino_due_x/variant.h#L182 does change the freq. So if you just need the 4k freq it'll work fine. Still, a way to change the freq in the sketch would be preferred.
I keep hoping to find a way to impress on people like this how to better ask their questions.
The forum software runs on a computer - heck, it should be smart enough ......
Therefore what you might consider a simple thing to do is not always possible.