Multiply the first equation by 8 and the second equation by 7.
8(7p + 5q) = 8(2)
56p + 40q = 16
7(8p - 9q) = 7(17)
56p - 63q = 119
Subtract the result of the second multiplication from the results of the first.
(56p + 40q) - (56p - 63q) = 16 - 119
103q = -103 (notice that p is eliminated)
q = -1
Substitute this result into the first equation.
7p + 5(-1) = 2
7p = 7
p = 1
The solution is (p, q) = (1, -1).
8(7p + 5q) = 8(2)
56p + 40q = 16
7(8p - 9q) = 7(17)
56p - 63q = 119
Subtract the result of the second multiplication from the results of the first.
(56p + 40q) - (56p - 63q) = 16 - 119
103q = -103 (notice that p is eliminated)
q = -1
Substitute this result into the first equation.
7p + 5(-1) = 2
7p = 7
p = 1
The solution is (p, q) = (1, -1).