The brachistochrone curve is the same shape as the tautochrone curve ; both are cycloids. However, the portion of the cycloid used for each of the two varies. More specifically, the brachistochrone can use up to a complete rotation of the cycloid (at the limit when A and B are at the same level), but always starts at a cusp. In contrast, the tautochrone problem can use only up to the first half rotation, and always ends at the horizontal. The problem can be solved using tools from the calculus of variations and optimal control.