This work is concerned with maximization and minimization problems of functionals associatedrnwith solutions of elliptic di erential equations depending on functions which belong to classesrnof rearrangements. We prove existence and uniqueness results, and present some features ofrnoptimal solutions.rnWe also discuss maximization and minimization of the energy integral associated with solutionsrnto partial di erential equations with coe cients depending on a suitable source or well. Underrnsuitable geometrical conditions on the domain rn we nd the optimal con gurations.