f(x) is continuous in the interval 0≤x<π4,π4<x<π2,π2<x≤π
We need to make the function continuous at x=π4,π2
For continuity at x=π4,limx→π4−f(x)=limx→π4+f(x)=f(π4)
limx→(π4)−(x+a√2sinx)=limx→(π4)+(2xcotx+b)=f(π4)
⇒π4+a√2sin(π4)=2.π4.cot(π4)+b=2π4.cot(π4)+b
⇒π4+a=π2+b⇒a−b=π4 ...(1)
For continuity at x=π2,limx→π2−f(x)=limx→π2+f(x)=f(π2)
⇒limx→π2−(2xcotx+b)=limx→(π2)+(acos2x−bsinx)=acosπ−bsinπ2
⇒0+b=−a−b⇒a+2b=0 ...(2)
From equation (1) and (2)
a=π6,b=−π12