Usually yes — Flexeril (cyclobenzaprine) and ibuprofen work differently and are commonly used together for short-term muscle pain, but mind the sedation and ibuprofen's stomach, heart and kidney risks, and check with your pharmacist or doctor first.
The two drugs act through different pathways, so they aren't expected to clash directly: cyclobenzaprine is a centrally acting skeletal muscle relaxant that works on the brain and nervous system to ease muscle spasm, while ibuprofen is an NSAID that blocks the body's production of substances causing pain, fever and inflammation. MedlinePlus's cyclobenzaprine interaction warnings center on MAO inhibitors and on substances that add to drowsiness (notably alcohol) — NSAIDs like ibuprofen are not flagged as a dangerous pairing. The caution comes from each drug's own profile rather than from a head-to-head reaction: cyclobenzaprine causes drowsiness and dizziness, and ibuprofen carries meaningful gastrointestinal, cardiovascular and kidney risks. Because the two address muscle pain in complementary ways, a clinician may pair them for an acute injury, but that decision should come from your prescriber, not be assumed.
Respect each drug's limits. For OTC ibuprofen, don't exceed 6 doses (taken every 4-6 hours) in 24 hours, and stop and see a doctor if pain lasts more than 10 days or fever more than 3 days. Cyclobenzaprine shouldn't be used for more than 3 weeks without talking to your doctor; because it makes you drowsy, don't drive or operate machinery until you know how it affects you, and avoid alcohol, which worsens the sedation. Be extra careful stacking other sedating medicines (sleep aids, anxiety meds, opioids, antihistamines) on top, since the combined drowsiness can add up. Ibuprofen can cause ulcers and stomach bleeding and raises heart attack and stroke risk — warning signs include black or tarry stools, vomiting blood, severe stomach pain, chest pain, shortness of breath, weakness on one side, or slurred speech; seek care immediately if these occur. People who should get a clinician's go-ahead first include older adults (cyclobenzaprine is generally not recommended over 65, and ibuprofen risks rise with age), and anyone with kidney or liver disease, a history of stomach ulcers or GI bleeding, heart disease or high blood pressure, or who takes blood thinners, aspirin, other NSAIDs, or antidepressants. When in doubt, ask your pharmacist or doctor.
This is general reference, not medical advice, and not a guarantee of safety. Interactions depend on your doses, health conditions, and other medicines. Always confirm with your pharmacist or doctor before combining products, and follow the dosing on each label.