I am trying to prove that AC is mininimized when AC=MC
This is how far I am:
FOC:
Showing what I want to prove
SOC:
This has to be positive in order to ensure that AC is minimized, but how can i conclude that?
Hope someone can help :)
You're making this way more complicated than it needs to be.
Edit: Okay it's a little more complicated that I thought but hey! What a cool result!
$AC = \frac{C(q)}{q} \\ MC = C'(q)$
When you minimize $AC$ with respect to $q$,
$$\frac{\partial AC}{\partial q} = \frac{C'(q) \cdot q - C(q)}{q^2} = 0$$ $$\implies C'(q) \cdot q - C(q) = 0$$ $$\implies C'(q) \cdot q = C(q)$$ $$\implies C'(q) = \frac{C(q)}{q}$$
Then marginal cost equals average cost. Which seems to be what you've gotten so far.
So now we check the second order conditions:
$$\frac{\partial AC}{\partial q} = \frac{C'(q)}{q} - \frac{C(q)}{q^2}$$ $$\frac{\partial^2 AC}{\partial q^2} = \frac{C''(q) \cdot q - C'(q)}{q^2} - \frac{C'(q) \cdot q^2 - C(q) \cdot 2q}{q^4}$$
What makes this expression greater than zero?
$$\frac{\partial^2 AC}{\partial q^2} = \frac{C''(q) \cdot q - C'(q)}{q^2} - \frac{C'(q) \cdot q^2 - C(q) \cdot 2q}{q^4} > 0$$ $$\implies \frac{C''(q) \cdot q - C'(q)}{q^2} > \frac{C'(q) \cdot q^2 - C(q) \cdot 2q}{q^4}$$ $$\implies C''(q) \cdot q - C'(q) > \frac{C'(q) \cdot q^2 - C(q) \cdot 2q}{q^2}$$ $$\implies C''(q) \cdot q - C'(q) > C'(q) - \frac{2C(q)}{q}$$ $$\implies C''(q) \cdot q > 2\left(C'(q) - \frac{C(q)}{q}\right)$$ $$\implies C''(q) \cdot q^2 > 2\left(C'(q) \cdot q - C(q)\right)$$
But recall that given the first derivative,
$$C'(q) = \frac{C(q)}{q}$$ $$\implies C'(q) \cdot q = C(q)$$
So substitute that into the above:
$$\implies C''(q) \cdot q^2 > 2\left(C(q) - C(q)\right)$$ $$\implies C''(q) \cdot q^2 > 0$$
And this is true as long as the total cost curve is convex, which is a pretty standard assumption. (I guess also positive production has to be a thing, so basically the firm has to be not shut down.) So we're done.
Here is an approach that might be a bit closer to the usual economic intuition.
The elementary intuition is that adding a marginal unit brings the average cost down if the marginal cost is below the average cost. This can be made precise.
$$\frac{\partial AC(q)}{\partial q} = \frac{C'(q) \cdot q - C(q)}{q^2} = \frac{C'(q) \cdot q}{q^2}-\frac{C(q)}{q^2}=\frac{1}{q}\big(MC(q)-AC(q)\big).$$ So, the marginal effect is negative if the marginal cost is smaller than the average cost and positive if the marginal cost is larger than the average cost. If it is zero, we have a local minimum.
With increasing marginal cost, it should also be a global maximum because the average cost is growing more slowly than the marginal cost by the same logic so that the marginal cost will stay above the average cost. Indeed, let $C'(q^*)=C(q^*)/q^*$ and $q>q^*$. We have $$C(q)/q=1/q\bigg(\int_{q^*}^qC'(x)~\mathrm dx+C(q^*)\bigg)$$ $$=1/q\bigg(\int_{q^*}^qC'(x)~\mathrm dx+q^*AC(q^*)\bigg)$$ $$=1/q\bigg(\int_{q^*}^qC'(x)~\mathrm dx+q^*MC(q^*)\bigg)$$ $$=1/q\bigg(\int_{q^*}^qC'(x)~\mathrm dx+\int_0^{q^*}MC(q^*)~\mathrm dx\bigg)$$ $$<1/q\int_0^qC'(q)~\mathrm dx=C'(q).$$ A similar argument works for $q<q^*$ to show that then $MC(q)<AC(q)$. In principle, this approach does not require the existence of second derivatives.