Let f(x)=cosx. Then f(x+h)=cos(x+h). By first principle, the derivative of f is f′(x)=limh→0hf(x+h)−f(x).
f′(x)=h→0limhcos(x+h)−cosx
Use cos(A+B)=cosAcosB−sinAsinB.
=h→0limhcosxcosh−sinxsinh−cosx
Group the two terms that contain cosx.
=h→0limh−cosx(1−cosh)−sinxsinh
Split into two limits. cosx and sinx do not depend on h, so they come outside the limits.
=−cosx⋅h→0limh1−cosh−sinx⋅h→0limhsinh
Use the standard limits limh→0hsinh=1 and limh→0h1−cosh=0.
=−cosx⋅0−sinx⋅1
=−sinx
∴dxd(cosx)=−sinx.