Cook the carrots and sweet potatoes in boiling water to cover for 10 minutes, until barely tender. Drain.
Combine the carrots and sweet potatoes with remaining ingredients, except the margarine. Turn the mixture into a shallow 3-quart baking dish. Dot the top with the margarine and bake for 30 minutes. If top becomes too brown, cover with foil. A few minutes before it is done, mash it with a potato masher for a smoother consistency.