Spline (mechanical)

Splines are ridges or teeth 
on a drive shaft that mesh with grooves in a mating piece and transfer torque to it, maintaining the angular correspondence between them.
For instance, a gear mounted on a shaft might use a male spline on the shaft that matches the female spline on the gear. The splines on the pictured drive shaft match with the female splines in the center of the clutch plate, while the smooth tip of the axle is supported in the pilot bearing in the flywheel. An alternative to splines is a keyway and key, though splines provide a longer fatigue life, and can carry significantly greater torques for the size.
Types.
There are several types of splines:
Uses.
Drive shafts on vehicles and power take-offs use splines to transmit torque and rotation and allow for changes in length.
Splines are used in several places in bicycles. The crank arm to BB shaft interfaces that are splined include ISIS Drive, Truvativ GXP and Howitzer, Shimano's Octalink and many others, most of which are proprietary. Some cranksets feature modular spiders, where torque is transmitted through splines. Cassettes engage the freehub via a spline that has one groove wider than the others to enforce a fixed orientation. Disc brake mounting interfaces that are splined include Centerlock, by Shimano.
Aircraft engines may have a spline upon which mounts the propeller. There may be a master spline which is wider than the others, so that the propeller may go on at only one orientation, to maintain dynamic balance. This arrangement is commonly found in larger engines, whereas smaller engines typically use a pattern of threaded fasteners instead.
Manufacturing.
There are two complementary types of splines, internal and external. External splines may be broached, shaped (for example on a gear shaping machine), milled, hobbed, rolled, ground or extruded. There are fewer methods available for manufacturing internal splines due to accessibility restrictions. Methods include those listed above with the exception of hobbing (no access). Often, with internal splines, the splined portion of the part may not have a through-hole, which precludes use of a pull / push broach or extrusion-type method. Also, if the part is small it may be difficult to fit a milling or grinding tool into the area where the splines are machined.
To prevent stress concentrations the ends of the splines are chamfered (as opposed to an abrupt vertical end). Such stress concentrations are a primary cause of failure in poorly designed splines.