Q:

How to formulate this maximisation problem?

Question
"A company offers the following schedule of charges: $30 per thousand for orders of 50,000 or less, with the charge decreased by 37.5 cents for each thousand above 50,000. Find the order size that makes th company's receipts a maximum". 
Attempted Answer
I understand that I have to formulate the above in some function, say f(x) where x is the number of orders, and then differentiate the function and equate the derivative to 0 to identify any maximum point. Yet, I am stuck as to putting the above into an equation. 
Some ideas that ran through my head included: 1) It's a linear equation where the gradient shifts after x= 50,000. 2) It requires two equations with different domains. Then I gave up.
Help would be appreciated. 

A:

Suppose the order size is $(50+N)$ thousand. Then the charge is \$ $30-0.375N$ per thousand.
The total charge is $(50+N)(30-0.375N)=1500+11.25N-0.375N^2$.
This has a maximum where (by differentiation) $11.25=0.75N$ i.e. $N=15$.
The required order is for $65$ thousand.

