(x)=x^2-4ax+2a+6
=x^2-4ax+4a^2-4a^2+2a+6
=(x-2a)^2+(-4a^2+2a+6)
顶点(2a,-4a^2+2a+6)
若f(x)≥0
所以顶点纵坐标 -4a^2+2a+6≥0
2a^2-a-3≤0
-1≤a≤3/2
当-1≤a≤3/2时
g(a)=2-a|a+3|
=2-a(a+3)
=-a^2-3a+2
=-a^2-3a-9/4+17/4
=-(a+3/2)^2+17/4
当a=-1时,g(a)有最大值4
当a=3/2时,g(a)有最小值-19/4
即g(a)的值域是[-19/4,4]