On the surface level, both painkillers essentially do the same job - they kill pain.
This can often radiate to other muscles in the body, amounting in even more pain.
So which painkiller is better for this specific jot down of pain?

Ibuprofen, on the other hand, is a non-steroidal anti-inflammatory drug (NSAID).
This specifically targets inflammation by blocking chemicals that cause this body response (viaCleveland Clinic).
They also inhibit the production of a chemical messenger called prostaglandin.

However, this suppression of prostaglandin can also be bad for your stomach.