determine the functions for profit

can you please help me with this one?

a company produces books for a cost of $15 each, and sells the books to bookstores for $40 each.for each one dollar increase in price of books , sales decrease by 100 per week. the firm currently sells 1000 books per week at a price of $40 each. show all calcilations in your work.

a) write the total cost function C(x)

b) write the total revenue function R(x)

c) write the profit function p(X)

d) determine the profit maximizing output (x)

e) compute the profit maximizing price ( p)