context: When you've had knee or hip replacement surgery, the best way to get back to the activities you love is to keep up with your rehab. Physical therapy will help ease pain and swelling and get you closer to recovery. Your health team won't wait long to get you on your feet. Your rehab starts while you're still in the hospital. As soon as a few hours after your surgery -- depending on your condition and your doctor's orders -- a physical therapist may get you up out of bed to practice using a walker or crutches. You'll also learn how to get in and out of a chair, and begin exercises that strengthen the muscles in your legs. You may also have a session with an occupational therapist, who will teach you simple ways to navigate your kitchen or put on your socks and shoes. You'll leave the hospital about 3 days after your surgery. Your doctor may ask you to stay overnight for days or weeks at a rehab center before going home. Other folks go straight back home. If you go back to your own place after the hospital, you'll probably visit a clinic three times a week for physical therapy sessions that last about an hour each. At your first appointment, your therapist will do a check of your new joint and how well you can move. Then, working with your doctor's recommendations, he'll make a plan to meet your specific needs. You have three big goals: Improve how well your joint moves. Your physical therapist may call this increasing your "range of motion." After knee surgery, for instance, you may have pain and swelling that makes it hard to stretch the joint. Your therapist will lead you through exercises to help you bend and straighten it. You may also need to use a type of equipment called an isokinetic machine that does the work for you. Riding a stationary bike can also help. Strengthen your muscles . Before your surgery, joint pain may have slowed you down and made you weaker. Your therapist will show you exercises that make you strong again so you can walk more easily, without pain. If you've had a hip replacement, you'll work on your "abductors," the muscles that help you coordinate your movements for all kinds of things, such as walking, dancing, or getting in and out of a car. At first, your therapist will have you extend your leg outward while you stand. Later, you'll do it while you lie down and work against gravity. To strengthen the muscles around your knee, your therapist will have you do exercises like quad sets. For these, you lie on your back, with your legs straight, and then tighten your muscles by pushing the back of your knees into the floor. Other exercises may include straight leg raises and knee extensions. Improve your balance. Your therapist may time you as you stand first on one leg and then the other, or have you try balance games on the Wii Fit. Everybody's different, and everyone's joints recover at a different rate. But in general, you'll be in a formal rehab program for about 6 to 8 weeks. Before you "graduate," your therapist will bring you up to speed on skills like getting on and off an escalator, climbing stairs, and getting in and out of a car. You're ready now to head back to work and get back to the activities you enjoy, from playing sports to shopping 'til you drop. But keep up with any at-home exercises your therapist suggests. Your hard work will pay off -- and you and your new hip or knee will be better than ever.