y=sinxcosx+cosx^2
=1/2sin2x+1/2(cos2x+1)
=1/2(sin2x+cos2x)+1/2
=1/2(根号2*sin(2x+π/4))+1/2
y的最大值是1/2*根号2+1/2=(根号2+1)/2
当2x+π/4=2kπ+π/2 时取得
即x=kπ+π/8,k是整数
y=sinxcosx+cosx^2
=1/2sin2x+1/2(cos2x+1)
=1/2(sin2x+cos2x)+1/2
=1/2(根号2*sin(2x+π/4))+1/2
y的最大值是1/2*根号2+1/2=(根号2+1)/2
当2x+π/4=2kπ+π/2 时取得
即x=kπ+π/8,k是整数