函数f(x)=x3+3ax2+3(a+2)x+1有极大值又有极小值,则a的范围是______.