Concept:Use the substitution method and the identity sinx+cosx=2sin(x+4π) or directly transform the integrand into sec2x/(1+tanx)2 to simplify the definite integral.Explanation:We start with I=∫0π/4(sinx+cosx)2dx.Rewrite sinx=secxtanx and cosx=secx1.Then the denominator becomes (secxtanx+secx1)2=sec2x(tanx+1)2.Thus I=∫0π/4(tanx+1)2sec2xdx.Now substitute t=tanx, so dt=sec2xdx.When x=0, t=0; when x=π/4, t=1.The integral becomes I=∫01(t+1)2dt.Let v=t+1, then dv=dt.New limits: t=0⇒v=1; t=1⇒v=2.So I=∫12v2dv.Using ∫v−2dv=−v−1, we get I=[−v1]12=−21−(−11)=21.Therefore I=21.Answer:21 (Option B).