Step-by-step explanation:
In general, you solve equations by "undoing" what was "done" to the variable, generally in the reverse of the order in which the operations were done.
These are known as "2-step" linear equations, because they can be solved in two steps.
In the first equation, the variable is multplied by p and q is added to the product. Reversing these steps in reverse order, we subtract q, then divide by p:
px +q = r . . . . . given equation
px = r - q . . . . . q is subtracted (from both sides)
x = (r -q)/p . . . . both sides are divided by p
___
The rules of equality require that the same operation be performed on both sides of the equation. When we say "subtract q" we mean "subtract q from both sides of the equation." Doing something different to one side or the other will make it be a different equation than the one you're trying to solve. My teacher would say, "keep the equal sign sacred."
_____
In the second equation, q is added to the variable, then the sum is multiplied by p. Reversing these steps in reverse order means we divide by p, then subtract q.
p(x +q) = r . . . . . given equation
x + q = r/p . . . . . divide by p
x = (r/p) -q . . . . . subtract q (from the quotient)
___
Please note that the second equation can be made to look like the first equation if parentheses are eliminated.
p(x +q) = r
px +pq = r . . . . . . a constant added to the product of p and x
Using the first solution with these values, we find ...
x = (r -pq)/p
If we divide this out, we see ...
x = (r/p) - q . . . . . same as our solution to the second equation