show below
#d/dx[(cosx-cos2x)/(1-cosx)]=#
#[(1-cosx)*(-sinx+2sin2x)-(cosx-cos2x)(sinx)]/(1-cosx)^2#
#[-sinx+2sin2x+sinxcosx-2cosxsin2x-sinxcosx+sinxcos2x]/(1-cosx)^2#
#[-sinx+2sin2x-2cosxsin2x+sinxcos2x]/(1-cosx)^2#
#((1-cos(x))*(2*sin(2*x)-sin(x))-sin(x)*(cos(x)-cos(2*x)))/(1-cos(x))^2#
Rewrite/simplify
#(2*sin(2x)-sin(x))/(1-cos(x))-(sin(x)*(cos(x)-cos(2x)))/(1-cos(x))^2#
#-((2*cos(x)-2)*sin(2x)-sin(x)*cos(2x)+sin(x))/(cos(x)-1)^2#