Proving AC is minimized when MC=AC 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} &gt; 0$$
$$\implies \frac{C''(q) \cdot q - C'(q)}{q^2} &gt; \frac{C'(q) \cdot q^2 - C(q) \cdot 2q}{q^4}$$
$$\implies C''(q) \cdot q - C'(q) &gt; \frac{C'(q) \cdot q^2 - C(q) \cdot 2q}{q^2}$$
$$\implies C''(q) \cdot q - C'(q) &gt; C'(q) - \frac{2C(q)}{q}$$
$$\implies C''(q) \cdot q &gt; 2\left(C'(q) - \frac{C(q)}{q}\right)$$
$$\implies C''(q) &gt; 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) &gt; 2\left(C(q) - C(q)\right)$$
$$\implies C''(q) &gt; 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.