1.
Cách 1: Tính bằng công thức
\(\left\{\begin{matrix} y=x-1(x>1)\\ y=1-x(x<1)\end{matrix}\right.\Rightarrow \left\{\begin{matrix} y'=1(x>1)\\ y'=-1(x<1)\end{matrix}\right.\)
Tóm gọn lại: $y'=\frac{|x-1|}{x-1}$
Cách 2: Tính bằng định nghĩa.
\(y'=\lim\limits_{x\to 1}\frac{|x-1|-0}{x-1}=\frac{|x-1|}{x-1}\)
2. Với $x\in (0;\pi)$ thì:
\(y=\sqrt{\frac{1}{2}+\frac{1}{2}\sqrt{\frac{1}{2}+\frac{1}{2}\sqrt{\frac{\cos x+1}{2}}}}=\sqrt{\frac{1}{2}+\frac{1}{2}\sqrt{\frac{1}{2}+\frac{1}{2}\sqrt{\cos ^2\frac{x}{2}}}}\)
\(=\sqrt{\frac{1}{2}+\frac{1}{2}\sqrt{\frac{1}{2}+\frac{1}{2}\cos \frac{x}{2}}}=\sqrt{\frac{1}{2}+\frac{1}{2}\sqrt{\cos ^2\frac{x}{4}}}=\sqrt{\frac{1}{2}+\frac{1}{2}\cos \frac{x}{4}}=\sqrt{\cos ^2\frac{x}{8}}=\cos \frac{x}{8}\)
\(\Rightarrow y'=-\frac{1}{8}\sin \frac{x}{8}\)