Answer
Tennis balls cost 2 dollars and golf balls cost 3 dollars
Work Step by Step
We call x the cost of a tennis ball and y the cost of a golf ball. Thus, we obtain:
$ 3x + 2y = 12 $
And
$ 6x +3y = 21$
In order to solve this problem, we multiply one or both of the equations by a value that will make one of the variables cancel. We multiply the top equation by -2, and we multiply the bottom equation by 1. Then, we add the two equations to obtain:
$-y = -3 \\ y =3 $
We plug in the given value into the top equation and solve for the other variable:
$ 3x + 2(3) = 12 \\ 3x = 6 \\ x =2$