With Java animations by Bill Casselman

2. The straightline differential
This is a gear train in a generalized sense: it involves two racks, straight bars with teeth, which can be thought of as segments of a gear of infinite radius. In this mechanism the two racks (purple and green) face each other at a fixed distance, and are free to slide back and forth along their own axes, while meshing with a pinion (yellow) rolling between them. The pinion is attached at its center to a (blue) slider. The simplest way to understand this mechanism is to think of the positions of purple and green racks as inputs, and the position of the blue slider as output. If the two racks move in the same direction at the same speed, the slider moves with them at the same speed, and the pinion gear does not turn. If they move in opposite directions at the same speed, the slider stays put, and the pinion wheel turns. Let's agree to count speed to the right as positive, and speed to the left as negative. Then, in general, if the top rack moves with speed a and the bottom with speed b, the slider moves at speed (a+b)/2. Proof: Choose a coordinate system moving with the green rack. In that coordinate system, the top rack moves with speed ab. Instantaneously, the top of the pinion is moving with speed ab, the bottom is moving with speed 0. It follows that the center is moving with speed (ab)/2. In a stationary coordinate system, the bottom rack moves with speed 0+b=b, the top rack with speed ab+b=a and the pinion and slider with speed (ab)/2+b=(a+b)/2. 
In this Java animation by Bill Casselman, the motions of the
racks can be controlled by the sliders. Speeds are adjustable from
2 to +2 in increments of 1/8. Begin Java animation: GO. 