Should the leg with a broken femur (which has been treated with surgery) be exercised when the swelling of the leg has sufficiently decreased, but the muscles still hurt?
This is a question to ask the surgeon who operated on the leg. Eventually, once the femur heals, you should be able to exercise on it unless there are some unusual individual circumstances. However, you do not want to start exercising if the bone has not healed yet. Whether the bone is healed or not will depend on (a) how long it has been since the surgery (a day? a year?), (b) how bad the break was, (c) the type of surgery performed to repair it, and (d) the general health of the patient. Pain is generally a warning sign that means "be careful" so if your leg is in pain, you should listen to that warning sign and avoid stressing the area. So, in summary: (1) Talk to the doctor who operated and ask how long you need to wait before you can exercise, and what types of exercise would be appropriate; (2) After your doctor clears you for exercise, consider talking to a physical therapist about the best way to strengthen the area. Exercise is great for improving many aspects of health, but you need to be careful if you have a broken bone.