How to maximize or minimize $f(x)=ax^2+bx$? I am trying to self-study calculus from the Internet. I have learnt things mostly from MIT OCW site and also from other sites. However, I am stuck on this simple problem:

Find the maximum/minimum value of $f(x)=ax^2+bx$ (where a and b are constants)

First we can find the critical points by solving $f'(x)=0 \implies 2ax+b = 0 \implies x={-b\over2a}$.
But I don't think that is the solution, because $f(0)=a(0)^2+b(0)=0$.
So obviously, minimum or maximum should be $0$?
What have I done wrong?
(Sorry for asking such A basic question, I have just started learning calculus).
 A: The minimum or maximum value (there will be one maximum or minimum) will be given by $$f\left(\frac{-b}{2a}\right) = a\left(\frac {-b}{2a}\right)^2 + b \left(\frac{-b}{2a}\right)= -\frac{b^2}{4a}$$
Indeed, the ordered pair, $$\left(\frac{-b}{2a}, -\frac{b^2}{4a}\right)$$ is the vertex of the parabola $ax^2 + bx$.
Whether the point is a maximum or minimum will depend on the sign of $a$. 


*

*If $a<0$, then the parabola opens downward, meaning the vertex is
where $f(x)$ attains its maximum, there being no minimum.

*If $a > 0$, then the parabola opens upward, meaning the vertex is
where $f(x)$ attains its mimimum, there being no maximum.

*And of course, if $a = 0$, then we do not have a parabola, but rather
a line, $y = bx$, with slope $b$ for which there is no maximum or minimum.  Certainly, if $b = 0,$ too,  we have then the horizontal line $y = 0$.
A: Note that,
since
$f'(x) = 2ax+b$,
$f'(0) = b$.
If $b \ne 0$,
then $f$ is either increasing
or decreasing at $0$,
depending on whether
$b > 0$ or $b < 0$.
Therefore
$f$ can not have a maximum or minimum at $0$
if $b \ne 0$.
If $b = 0$,
then $f$ does have
either a maximum 
(if $a < 0$)
 or minimum
(if $a > 0$)
at $0$.
A: If $a=0$, then $f(x)=bx$, which is trivial.
If $a\not =0$, then we have the following form:$$f(x)=a\left(x+\frac{b}{2a}\right)^2-\frac{b}{4a^2}.$$
This is called parabola whose vertex is $(-b/(2a),-b/(4a^2))$.
Then, if $x\in\mathbb R$, we know the followings :


*

*When $a\gt 0$, $f(x)$ does not have the maximum and the minimum is $f(-b/(2a))=-b/(4a^2)$.

*When $a\lt 0$, the maximum is $f(-b/2a)=-b/(4a^2)$ and $f(x)$ does not have the minimum.
A: If you complete the square we get the parabola 

$$ y+\frac{b^2}{4a} = a\left( x+\frac{b}{2a} \right)^2 $$

with vertex located at the point $ \left( -\frac{b}{2a}, -\frac{b^2}{4a} \right) $. All you need now is just to know some properties of the parabola to determine your min and max. I leave it for you to carry on the task.
