In one market, the demand is $D_1=80-P_1$ and in the other $D_2=100-2P_2$. Suppose the markets are separated. What output level should be produced and what price will prevail. Since $D_1=80-P_1$, then $Profits=Revenue-Cost=Demand*Price-Demand*Cost=P_1(80-P_1)-10(80-P_1)$
For market 2, $D_2=100-2P_2$ so $Profit=P_2(100-2P_2)-10P_2$
To maximize profit just do calculus to work out the maximum of each of the resulting quadratics. Is this correct?