P = x (4 + q) - 5
This is the simplified version of the problem given
p=qx+4x−5 would be the answer to your problem. Math Papa is a good website to use for alegebra or math
5.8m questions
7.5m answers