Your confusion is with the arduino analogWrite function. It's doesn't output a pure DC voltage but rather a digital PWM signal that is always either +5vdc or ground at any given instant in time. It's the duty cycle (ratio of on to off) that can be manipulated with the analogWrite function in 8 bits of resolution. If you require a true analog 0-5vdc output then you must add an external low pass filter to convert the PWM signal to a true analog output voltage. You also may need to add a op-amp buffer stage if you need to provide any significant current to the device using the signal.