Let,
f(x)=x2+mx+(m2+6m)
As per question given that exactly one root of the equation lies between -2 and 0.
Hence, only one is negative.
Therefore f(−2)×f(0)<0
Putting the value in the function ,we get
[(−2)2−2m+m2+6m]×[m2+6m]<0
⇒[m2+4m+4]×m(m+6)<0
⇒(m+2)2×m×(m+6)<0
Hence, the range of m becomes
m∈(−6,0)−{−2,}
We can write it as
m∈(−6,−2)∪(−2,0)