A question of deriving an industry supply curve from cobb-douglass production function I have a question about a proper derivation of industry supply curve from cobb-Douglas. 

The production function is given as:

\begin{equation}
q_i = 2x_1^{1/2}x_2^{1/2}
\end{equation}

the price of $x_1$ input is $w_1=1$ and $x_2$ is $w_2=4$ 

These are the steps I used in trying to derive the supply curve:

I used the well-known fact that technical rate of substitution must be equal to factor prices so:

\begin{equation}
\frac{\text{MP}_{x_1}}{\text{MP}_{x_2}} = \frac{w_1}{w_2}
\end{equation}

So after substituting prices and the marginal products which we get from taking the partial derivatives of $q_i$ we get:

\begin{equation}
\frac{x_1}{x_2} = \frac{1}{4} \text{ or } x_1 = 4x_2
\end{equation}

Now I substituted this back into the cobb-douglas to get:

\begin{equation}
q_i = 4x_2 \text{ or } \frac{q_i}{4} = x_2
\end{equation}

Now I just used general profit equation:

\begin{equation}
\pi_i= pq_i - w_1x_1 -w_2 x_2
\end{equation}

I substituted the solution for both $x_1 = 4x_2$ and also that $x_2 = q_i/4$ and I got:

\begin{equation}
\pi_i= pq_i - 2q_i
\end{equation}

So my thinking was that by solving for optimal $q_i*$ and multiplying it by $n$ - the number of firms I could get the supply curve. But since the profit function is linear the $q_i$ drops from the derivation.

Please, could someone give me advice on how to proceed?

Edit: Also I forgot to mention that it is assumed that industry is perfectly competitive.
Your method and numerical calculations are correct.  

Then, it is a well-known fact that Cobb-Douglas (i.e exponential with constant returns to scale) production functions with price-taking behavior lead to linear cost functions, i.e. to constant marginal cost and equal to average cost, and linear profit functions, which means that profits in the long run will be either zero or infinite: If price is above $2$ ($=MC=AC$) each firm would want to produce an infinite amount of output. if it is equal to $2$, firms that produce will make zero profits. If it is below $2$ no firm will produce and profits will again be zero.

At market level, the assumption of perfect competition (costless entry especially) in turn implies that the long-run (no fixed costs) market supply curve will be horizontal at $P=MC=AC$, and the level of output will be determined by the demand curve and consumer preferences. The output per firm and hence the number of firms remains undetermined here.