Woozles can be manufactured in either of two types of factory with the following cost functions. A perfectly competitive manufacturer of woozles currently has two factories, one of each type:
C1 = 0.2q1^2 + 5.2q1 + 9.8
C2 = q2^2 + q2 + 25
where Ci = total cost function for type i factory, i = 1, 2.
qi = production of type i factory, i = 1, 2.
(a) Market price for woozles is currently 4. What is the profit-maximizing (loss-minimizing) production from each factory?

How should i approach this question?
Do i first find the profit function: TR-TC, and then differentiate?