In many cases, it may actually be more cost effective to repair a microwave if the issue is minor and the appliance is relatively new. However, if the microwave is over ten years old or has developed several issues, it may be more affordable to purchase a new microwave.
What is the life expectancy of a microwave magnetron?
about 2000 hours
Most microwave magnetrons last about 2000 hours. Low-quality microwave magnetrons won't last as long. If your microwave does not heat properly or dies, it's possible the magnetron died. If so you're better off replacing the whole microwave.
BTW, I prefer microwaves with Inverter technology, superior to regular units.