Manufacturers cover cast iron bathtubs or other metals in porcelain or enamel, and rust develops on a bathtub because the surface chips or cracks and exposes the metal. When damage occurs to the plating and the metal comes in constant contact with water, the metal oxidizes and rusts. You can repair minor rust damage that doesn't compromise the structural integrity of the tub using epoxy-based tub-repair products.

...
...

Dry the bathtub thoroughly with a rag or towel. Turn off the water supply to the bathtub in order for the bathtub to remain completely dry during the repair process.

...

Sand the rusty area with fine-grit sandpaper to remove all traces of rust. If rust covers large areas of the tub, equip a belt sander with fine-grit sandpaper and sand off the rust. Sand until you expose the metal under the rust.

...

Vacuum the bathtub to remove loosened rust. Pick up fine bits of rust with a tack cloth. A tack cloth is a sticky cloth that grabs tiny bits of debris and holds them on the cloth.

...

Paint the exposed metal with an epoxy-based primer and allow the primer to dry for two to three hours. For small chips, use an artist's paintbrush. For large surface areas, use a low nap paint roller.

...

Apply two coats of a high-gloss epoxy-based paint over the primer. Allow each coat to dry for two to three hours between applications. Choose a closely matching color to blend into the existing finish.