Find values of $a$ for which function will have real roots 
Find the range of values of $a$ for which the equation $$2x^3-3x^2-12x+a=0$$ will have all roots real and distinct.

what i tried
I found the derivative and got the roots of $f'(x)$ as $-1,2$ but now i need another condition to find values of a but i don't know what that condition should be.
Thanks in advance !
 A: Consider $f(x)=2x^3-3x^2-12x$, whose graph appears below.
For $b > f(-1)$ or $b < f(2)$ the equation $f(x)=b$ has only one solution.
For $b = f(-1)$ or $b = f(2)$ the equation $f(x)=b$ has two solutions, one of which is double.
For $f(2) < b < f(-1)$ the equation $f(x)=b$ has three solutions.
Therefore, $-a \in (f(2), f(-1))$.

A: Let $p$ and $q$ with $p<q$  be two distinct roots of $f'(x)$; in your case $p=-1 $ and $q=2$.  Then For the 3 roots to be real you need to have $f(p)>0, f(q)<0$ so that the decreasing segment between $p$ and $q$ intersects the $f=0$ axis.
$$f(p)>0 \implies \left[ 2x^3 -3x^2 -12x+a \right]_{x=p=-1} > 0 \implies 7+a>0
$$
$$f(q)<0 \implies \left[ 2x^3 -3x^2 -12x+a \right]_{x=p=+2} < 0 \implies a-20<0
$$
So the range you want is 
$$ -7 < a < 20$$
A: The conditions to find the interval $(a_1,a_2)$ for which the equation has 3 distinct solutions when $a\in(a_1,a_2)$ are the following:
$$
f(-1)=0\Rightarrow a=a_1=-7;\\
f(2)=0\Rightarrow a=a_2=20.
$$
In fact, $f(-1)=0$ means that the local maximum point is a (double) root, while $f(2)=0$ means that the local minimum is a (double) root. 
A: You have found the two extremum. For the equation to have $3$ distinct real roots, the two extremum must occur in between the roots due to Rolle's theorem. That is, the extremum have different signs. Thus we solve $f(2) \cdot f(-1) < 0$. Once you do the algebra, you see that this is the same as solving $(a-20)(a+7)<0$ and so our solution is $a \in (-7, 20)$
