NSAIDS have antipyretic activity and can be used to treat fever.   Fever is caused by elevated levels of prostaglandin E2 , which alters the firing rate of neurons within the hypothalamus that control thermoregulation.   Antipyretics work by inhibiting the enzyme COX, which causes the general inhibition of prostanoid biosynthesis ( PGE2 ) within the hypothalamus .   PGE2 signals to the hypothalamus to increase the body's thermal set point.   Ibuprofen has been shown more effective as an antipyretic than paracetamol (acetaminophen).   Arachidonic acid is the precursor substrate for cyclooxygenase leading to the production of prostaglandins F, D & E.
At therapeutically equivalent doses, different narcotics are likely to produce similar levels of side effects such as constipation, respiratory and cardiovascular depression, nausea, and pruritus. While clinical trials have failed to show that any one narcotic has fewer side effects than another in the population as a whole, persons vary greatly with regard to their tolerance for narcotic side effects. Tolerance and physical dependence can occur with chronic use of all opioids, but these are not generally a concern in the treatment of acute pain. No evidence supports the use of agonist/antagonist medications (., pentazocine [Talwin], butorphanol [Stadol]) to decrease opioid side effects. In fact, the literature suggests that these medications produce more side effects than more effective narcotics. One randomized, single-dose postoperative study 42 reported a 20 percent rate of dysphoria with pentazocine and butorphanol versus a 3 percent rate with other opioids.
Like aspirin and indometacin , ibuprofen is a nonselective COX inhibitor, in that it inhibits two isoforms of cyclooxygenase, COX-1 and COX-2. The analgesic , antipyretic , and anti-inflammatory activity of NSAIDs appears to operate mainly through inhibition of COX-2, which decreases the synthesis of prostaglandins involved in mediating inflammation, pain, fever, and swelling. Antipyretic effects may be due to action on the hypothalamus, resulting in an increased peripheral blood flow, vasodilation, and subsequent heat dissipation. Inhibition of COX-1 instead would be responsible for unwanted effects on the gastrointestinal tract.  However, the role of the individual COX isoforms in the analgesic, anti-inflammatory, and gastric damage effects of NSAIDs is uncertain and different compounds cause different degrees of analgesia and gastric damage.