How to find the short run and long run cost functions, given the production function? 
The production function of car is given by $f(x_1,x_2,x_3) = \sqrt{x_1}+\sqrt{x_2}+\sqrt{x_3}$ (assume competitive input and output markets).
  
  
*
  
*Find the short run cost function (let input 3 be ﬁxed in short run) and the long run cost function. 
  
*Derive the proﬁt function, supply function and input demand functions.
  

I was able to find the short run cost function but I'm having trouble evaluating the long run cost function and part 2 of the question.
I don't know how to approach such questions as I am new to the field of economics.
thank you
 A: The long-run cost function is the solution to 
$\min_{x_1,x_2,x_3} p_1x_1+p_2x_2+p_3x_3$ s.t. $\sqrt{x_1}+\sqrt{x_2}+\sqrt{x_3} = q$. This type of problem is solved most easily with the help of Lagrange multipliers by constructing a new function that 'penalizes' violation of the constraints. We then choose a multiplier on this 'penalty' s.t. it is optimal not to violate the constraint. (Don't worry if you don't get this intuition - most undergraduates in econ use it without understanding why it works).
Thus we define $\mathcal{L}(x_1,x_2,x_3,\lambda) = p_1x_1+p_2x_2+p_3x_3 - \lambda(\sqrt{x_1}+\sqrt{x_2}+\sqrt{x_3}-q)$ and maximize this for $x_1,x_2,x_3$ and $\lambda$. The FOCs are $p_1 = \frac{\lambda}{2\sqrt{x_1}}$, $p_2 = \frac{\lambda}{2\sqrt{x_2}}$, $p_3 = \frac{\lambda}{2\sqrt{x_3}}$ and the constraint itself. Dividing the first by the second and rearranging yields $\frac{p_1}{p_2} \sqrt{x_1} = \sqrt{x_2}$ and similarly we can derive $\frac{p_1}{p_3} \sqrt{x_1} = \sqrt{x_3}$. Plugging this into the constraint yields:
$\begin{eqnarray*}\sqrt{x_1}+\frac{p_1}{p_2}\sqrt{x_1}+\frac{p_1}{p_3} \sqrt{x_1} &=& q, \\ \text{ i.e. } x_1 &=& \left(\frac{q}{\frac{p_1}{p_1}+\frac{p_1}{p_2}+\frac{p_1}{p_3}}\right)^2.\end{eqnarray*}$ 
You can repeat this to yield solutions for $x_2$ and $x_3$ -- or you could recognize the symmetry. The cost function is then just $C(q) = p_1x_1(q)+p_2x_2(q)+p_3x_3(q)$.
The profit function is $\pi(q) =  pq-C(q)$ (assuming the firm is competitive) and the supply function is just the  $q$ that solves $\max_q \pi(q)$. The input demand functions are the functions we already computed above, i.e. $x_1(q)$ etc.
Hope this helps. If not please specify what level of education you are currently in - in particular I am surprised somebody asked you to solve this without telling you about Lagrange multipliers.
