Okay, we are given:
A real Estate office handles a 50-unit apt. complex. When the rent is \$580/mo. all units are occupied.
For each \$40 increase in rent, however, an avg of one unit becomes vacant. Each occupied unit requires an avg of \$45 per month for service and repairs.
What rent should be charged to obtain a maximum profit?
Here's the way I would look at it:
Let z represent the number of \$40 increases in rent, that is, the monthly rent per unit is:
$\displaystyle r(z)=580+40z$
We are told that for each increase of 1 in z, there is a decrease of 1 in the number of units occupied, which we can state as:
$\displaystyle u(z)=50-z$
The monthly revenue is the total amount of rent collected, which is equal to the number of units occupied times the monthly rent per unit:
$\displaystyle R(z)=u(z)\cdot r(z)=(50-z)(580+40z)=20(50-z)(29+2z)$
The total monthly cost is the average cost per unit times the number of units occupied:
$\displaystyle C(z)=45u(z)=45(50-z)$
Now, the monthly profit is the monthly revenue minus the monthly cost:
$\displaystyle P(z)=R(z)-C(z)=20(50-z)(29+2z)-45(50-z)=5(50-z)(4(29+2z)-9)=5(50-z)(107+8z)$
Now, I am going to let you use differentiation, while I am going to use the fact that we have a parabolic profit function opening downward whose axis of symmetry will be midway between the roots, and thus the vertex (maximum point) will be on this axis.
The roots are:
$\displaystyle 107+8z=0\,\therefore\,z=-\frac{107}{8}$
$\displaystyle 50-z=0\,\therefore\,z=50$
The axis of symmetry is then the line (using the mid-point formula):
$\displaystyle z=\frac{-\frac{107}{8}+50}{2}=\frac{293}{16}$
See if you can get this critical value using the calculus. After this, we'll deal with the fact that we should treat z as a discrete variable rather than a continuous one.