If you have a cast-iron tub, chances are it is somewhat "long in the tooth," and like most older things, probably showing a bit of wear and tear. It is important to remember that even though tubs may be cast iron, they are coated with porcelain, which scratches rather easily, so staining can be particularly troublesome. Older fixtures generally have a degree of surface wear that makes them even more porous and hard to clean than new versions.
Wash the tub thoroughly with a mild cleaner made for porcelain bathroom fixtures, or use a homemade paste mixture of baking soda, liquid dish detergent and warm water. Rinse well.
Determine the type of stain you have — ordinary stains can usually be removed with chlorine bleach or hydrogen peroxide applied with a cloth or soaked paper towels directly to the stained surface, then rinsed after 30 minutes or so. Repeat if necessary. Rinse well.
Use a paste made from baking soda and hydrogen peroxide to clean stubborn stains and black marks on porcelain surfaces, or do as Earl Proulx suggests in his book Yankee Home Hints, "…mix a thick paste of fresh hydrogen peroxide and a scratchless cleanser such as Bon Ami. …add a pinch of cream of tartar. Cover the stains with the paste and let sit for at least 20 minutes. Rub the marks off with a plastic dish scrubber… rinse. Repeat as needed." This mixture also works well on green stains from copper fixtures (see Reference 1).
Use muriatic acid on lime deposits. Be aware that it is a powerful caustic agent that should be handled with caution — always wear rubber gloves and eye protection. Saturate a cloth and place it over the stain to soak for several minutes; remove and repeat if needed. Rinse very well before using the bathtub.
Prepare a mix of lemon juice and salt to remove orange or reddish brown stains — they are likely the result of iron in the water, and are particularly difficult to remove. If scrubbing with this formula does not work right away, try soaking the affected area by spreading the paste over it and allowing the paste to sit undisturbed for an hour or so before scrubbing again with more of the mixture. Rinse well.