Im currently studying microeconomics and I have encountered a math problem which I can't seem to figure out. The concerned problem can be viewed in the image that I have posted. To be more specific, what I don't understand is how exactly the first order condition is derived. I know that I'm supposed to use the chain rule but when I do the calculations, my result is wrong. I guess that q1(1-q1-q2-c) is the outer function and 1-q1-q2-c is the inner function. Is that right? Can someone please take be through the steps to how I get 1-q1-q2-c-q1=0? I would be extremely thankful if someone could help me with this problem.
Best regards
A confused student

The first order condition is obtained by product rule. Although I believe it can be done in a better way. It is
$$\frac{\partial \pi}{\partial q_1}=\frac{\partial q_1}{\partial q_1}(1-q_1-q_2-c)+q_1 \frac{\partial (1-q_1-q_2-c)}{\partial q_1}=(1-q_1-q_2-c)-q_1$$