Can someone help with the following: I know how to get the MC and AC; however I'm not sure on the algabraic part.

Given the following short-run total cost function, answer the following questions.

TC = 3q2 + 5q + 300

a. Find the marginal and average cost functions.

b. Show that AC is at its minimum when q = 10 and that MC = AC at this output.

A.

Given:
tc(q)= 3q²+5q+300
The marginal cost is what would cost an extra item (quantity) for a given quantity q. It is obtained by finding the derivative of tc(q) with respect to q:
marginal cost, mc(q)
= tc'(q)
= d(tc(q))/dq
= 6q+5

Average cost is the total cost of q items averaged over q, i.e. divided by q.
average cost, ac(q)
= tc(q)/q

B.
mc(10) = 6*10+5 = 65
ac(10) = (3*(10)² + 5*(10) + 300 )/10
= 65

Thus mc(10) = ac(10)