y=sin²x+2sinxcosx+3cos²x
=1/2(1-cos2x)+sin2x+3/2(1+cos2x)
=sin2x+cos2x+2
=√2sin(2x+π/4)+2
∵-π≤x≤π
∴-7π/4≤2x+π/4≤9π/4
∴最大值=√2+2;最小值=-√2+2
y=sin²x+2sinxcosx+3cos²x
=1/2(1-cos2x)+sin2x+3/2(1+cos2x)
=sin2x+cos2x+2
=√2sin(2x+π/4)+2
∵-π≤x≤π
∴-7π/4≤2x+π/4≤9π/4
∴最大值=√2+2;最小值=-√2+2