∫π0|cosx−sinx|dx=√2∫π0∣∣∣sin(π4−x)∣∣∣dx
=√2∫π40∣∣∣sin(π4−x)∣∣∣dx+√2∫ππ4∣∣∣sin(π4−x)∣∣∣dx
=√2[−∫π40sin(x−π4)dx+∫ππ4sin(x−π4)dx]
=√2[[cos(x−π4)]π/40−[cos(x−π4)]ππ/4]
=√2[+(1−1√2)−(−1√2−1)]
=√2[2]=2√2