A baseball team plays in a stadium that holds 52000 spectators. With the ticket price at $9 the average attendance has been 21000. When the price dropped to $6, the average attendance rose to 26000.

a) Find the demand function p(x), where x is the number of the spectators. (Assume p(x) is linear.)
b) How should ticket prices be set to maximize revenue?