If n is the number of apartments are occupied. Total Rent company is getting: \((720 + 40(50-n)) n - 48n\)
We have to maximize the above equation.
\(y=720n + 2000n - 40n^2 - 48n
\\y=2672n-40n^2
\\y'=(2672n-40n^2)'=2672-80n
\\y'=0
\\2672-80n=0
\\2672=80n
\
= 33.4 \approx 33\)
\(\text{Rent} = 720 + (50-33)40 = 720 + 680 = \$1400\)