Been going back and forth and just want to see if I've come to the right conclusion! (Also if this is in the wrong section, let me know. New on here!)

Question:

Fixed costs of 10, Average Variable Cost function of q^{2}+4 and the demand equation is p+q=20.

A)Determine the profit function in terms of q.

My answer:

C(x)= q^{2}+4+10

=q^{2}+14

p(x) - p=20-q

R(x) = [20-q][q]

=20q-q^{2}

Therefore P(x) = 20q-q^{2}-q^{2}+14

= -2q^{2}+20q+14

B) Determine the production level that maximises the profit.

My answer:

= -b/2(a)

= -20/2(-2)

= 5