How is the electric field created by a battery inside a conducting wire constant? My book says that a cell (or a battery) creates a constant electric field inside a conducting wire. 
They've made use of a cylindrical conductor for the purpose of explanation and said that since the ends are constantly being kept at constant potentials (though the potential at one end is different from the other, potential at the respective ends are constant) the electric field inside will be constant. But how?
 A: In low-speed electrodynamics, electrostatic laws still hold. If you disagree, consider that the ohm's law, the start point of circuits electrodynamics in vector form.
$$\mathbf{J}=\sigma \mathbf{E}$$
There is no magnetic term. If fact, what ohm's law tells us is that the volume charge density in a conductor (better to say resistive material) is proportional to force per charge. So it should be like this:
$$\mathbf{J}=\sigma (\mathbf{E}+\mathbf{v}\times \mathbf{B})$$
But, the fact that it is taught in the first form is due to very low speed of moving charges in a circuit. So agreeing on this, we can proceed like this:
In electrostatics, neglecting the dielectric part because we don't need it here, any configuration can be considered as the superposition of 1. the  charges densities present there 2. the rest.
The rest includes electrodes kept at constant voltage.
After finding the potential of the two parts, we can sum them and then by taking the gradient, we can find the electric field.
For the second part (the rest), you can see that the only electrodes there are the two you have mentioned which are kept at constant potential. 
Inside the conductor we have: fixed potential at the ends, and the fact that charge can't leak out of the conductor at the round sides. In terms of math, this is written like this:
$$0=\mathbf{J}\cdot\mathbf{\hat{n}}=\mathbf{E}\cdot\mathbf{\hat{n}}=\nabla V\cdot\mathbf{\hat{n}}=\frac{\partial V}{\partial n}=0$$
According to a uniqueness theorem, If either $V$ or $\frac{\partial V}{\partial n}$ is known on all boundaries, then the potential is uniquely determined inside. So as long as the boundary conditions are kept constant (which is the case here), the potential inside will be constant. Moreover, as long as the potential is unique, you can guess the answer. Here a uniform electric field will satisfy all the boundary conditions, so this is the only answer. 
About the first part (charge densities), as long as we are talking about the inside of the conductor, we have:
$$\frac{\rho}{\epsilon_0}=\nabla \cdot \mathbf{E}=\frac1\sigma \nabla \cdot \mathbf{J}=0 \ \implies \ \rho =0$$
Because the electric field inside is uniform.
So this is telling us that there is no charge inside the conductor.
Now, if we superpose the two cases, the resulting field will also be constant because the field in the second part was constant.

Without losing the generality, as a point, you can learn this rule:

As long as the boundary conditions and the sources don't change, the resulting filed won't change.

A: This is my shot.. :)
If you take a look of the electric field of a dipole you can verify that there are more field lines near the charges than in the middle. In other words, the electric is not constant along the space between poles. But let's move on and try to understand what happens in the wire –in the very beginning– when we connect it to a battery.
First, suppose that the E field is constant. I love the analogy of the electron being like a ball falling through a plane with constant slope (constant E field) and some rocks within. In this case, all electrons will flow, in average, with some drift velocity.
Now suppose, as in the dipole case, that in the middle of that plane there is a space with lower slope (lower E field). What will occur? That we will see a higher density of electrons in that space.
Now let's get back to the charge world. What is the effect of an accumulation of charge? An induced electric field, opposite to the direction of the field caused by the battery. This induced electric field will reduce the net force experimented by the electrons in the higher slope region –i.e. reducing that slope.
So the initial E field is not constant, but once the free electrons of the wire "understand" and react to that initial field, a new constant E field is achieved. This new E field cannot be zero since the wire is connected to a battery with constant voltage.
Hope I've added some value.. :)
A: A wire is used to conduct electricity along its length.   So, in normal usage,
with all current parallel to the axis of the cylindrical wire, the electric potential is a function only of the length dimension (if it varied with radial
dimension or direction, current would flow sideways).  
The gradient of potential, i.e. the field, can only be along the length dimension.
By Ohm's law, that means all current is in that direction, and by Kirchoff's
rule, current in series bits of the wire are equal.    The only
solution that fits all these facts is uniform field inside the wire.
If the wire were to change composition (have different composition along
its length), Ohm's law would insist that the field gradient be higher in the
higher-resistivity parts.  That would mean a NON-uniform field.
If there were non-axial-direction current imposed, or significant
variation in the wire diameter, all bets are  off.   Symmetry is required.
