I am having trouble with an Optimization problem, I can find everything except for the maximized amount. It wants me to determine the level of production q where P(q) is maximized. Here is the given information:

p(q)= 180-2q ; C(q)= q^3+5q+162

I found R(q) Revenue to be: 180q-2q^2 I then need to subtract c(q) from that which looks like this: (180-2q^2) - (q^3+5q+162) and I got P(q) to be:

-q^3-4q+175q-162=P(q) To find the maximized value you are supposed to take the derivative of P(q) which I got to be: -3q^2-4q+175 to find the maximized level of production you are supposed to solve for q, however I am confused how to do this because there is a q^2 term there. The book's answer for maximized production is q=7 Any help would be appreciated, thanks!