You can put this solution on YOUR website! Since we want to solve for 'x', its best to get all the terms involving x onto one side:
Now bring all 'x' related terms to the left, and everything else to the right:
Multiply both sides by -1, this has the effect of changing the left to all +, and swaps the signs on the right:
Not done yet, there is further simplification:
Numerator:
Denominator:
So
Canceling a "p+q" from numerator and denominator: