what is the optimum level of production? The demand function of a monopolist is $q = 12 - p$ where $p$ is the price. Using the total cost and total revenue I was trying to calculate the optimal (short term) level of production.

I tried to solve it using the total revenue $r = p x$. Then I calculated the marginal revenue (the derivative of total revenue) and set it to $0$.
Then I got $p = 6$ and $x = 6$.

However, I never used the cost function, what did I do wrong?
Try to think about what the the optimal level of production is supposed to be. What should it maximize? The revenue?

What you have calculated is the revenue maximizing level of production but maybe you wanted to find a level of production that maximizes something different?