Calculus Profit Maximization Suppose that it costs a company 5000€ to produce a machine and that the demand for machines (in thousands) for a price of thousand euros is expressed by        q(p)=50 − 2p. What price for a machine will maximize the company´s profit?
Please clarify how could I answer these type of questions.If there are any tutorials, I'd be grateful if you share them.
 A: This is a simple profit maximization question from Economics. You are given a demand function, here $q(p)=50 − 2p$ and a cost function $5q$. So now you need to put them together to get the profit function.
The profit function in general is given by
$$ p(q)q-C(q) \text{ or, less often as } q(p)p-C(p)$$
The profit function should be expressed as a maximization problem in either the price $p$ or quantity $q$. That's for the background.
This should be explained in any intermediate Microeconomics textbook. For example you can check a book by Varian "Intermediate Microeconomics: A Modern Approach"

In your particular case you need to invert first the demand function to express price in terms of quantity. So 
$$q=50-2p  $$ can be inverted to
$$ p = 25-\frac{1}{2}q $$
Now, put everythhing together to construct profit function
$$ p(q)q-C(q)$$ or
$$ (25-\frac{1}{2}q)q - 5q$$
Your problem is now simplified to
$$ max_q \left[\left(25-\frac{1}{2}q\right)q - 5q\right] $$
Taking first-order condition you get
$$ 25-q-5=0$$ or
$$ q = 20 $$ 
Since the function is concave (second derivative is negative) this is the optimal quantity that maximizes profits. 
The price corresponding to q=20 is $p=25-\frac{1}{2}*20=15$.
Note: It is always important to remember whether you solved for optimal q or optimal p. Then use the demand function to obtain the other variable of interest (in the example I solved for q and then used demand function to obtain p).
