Remove the prime rib from the fridge 2 to 3 hours before cooking, and allow it to come to room temperature.
Preheat your oven to 450°F (230°C). In a small bowl, mix together the butter, garlic, salt, thyme, rosemary, and black pepper.
After the prime rib has come to room temperature, pat it down with paper towels to make sure it's dry. Then rub the entire outside of the prime rib with the herb butter mixture.
Place the prime rib in an oven-safe pan or roasting tray with the bone-side down, fat-side up. Place the onion slices in the pan around the meat, if you're making the red wine au jus. If not, you can omit the onions.
Cook the prime rib in the center of the oven for 20 minutes at 450°F (230°C). It should get a nice sear on the outside. If not, cook it a few minutes longer. Then reduce the temperature of the oven to 325°F (160°C) and continue cooking until the internal temperature reaches 120°F (50°C), which takes about an hour and a half, for medium-rare. But go by temperature, not time, as it will depend on the size of your prime rib and your oven.
Remove the prime rib from the oven and let it rest for 20 to 30 minutes. You can tent it with aluminum foil to keep it warm. Then, remove the string and bones, and slice it up into thick ½-inch thick slices.