∵f(x) is continuous everywhere ⇒f(x) is continuous at x=0 and x=2∴ LHL at (x=0)= RHL at (x=0)=f(0)x→0−limf(x)=x→0+limf(x)=2x→0−lim(1+cosx)=x→0+lim(a−x)=2⇒1+1=a−0=2⇒a=2 and LHL at (x=2)= RHL at (x=2)=f(2)x→2−limf(x)=x→2+limf(x)=a−2⇒x→2−lim(a−x)=x→2+lim(x2−b2)=2−2 or 2−2=22−b2=0⇒b2=4∴a2+b2=4+4=8