dNdx Z

Clear[Zb1, Zc1, Zd1, Zp, Zj]; 
Zb1[M_] := (10^(-2.53835*Log[M/7.79364^2]^0.655038^2 + 0.446562*Log[M]) + 
      2.9747^2)*UnitStep[M - 100]*UnitStep[211.999 - M] + 
    (10^(-0.374128*Log[M]^1.27749^2 + Log[M]) + 2.97959^2)*
     UnitStep[M - 212]*UnitStep[479.999 - M] + 
    Za1b1*M^Zb1b1*UnitStep[M - 480]*UnitStep[1000 - M]; 
Zab1 = -2.53835; 
Zcb1 = 0.655038; 
Zdb1 = 7.79364; 
Za3b1 = 0.446562; 
Zbb1 = 2.9747; 
Za2b1 = -0.374128; 
Zb2b1 = 2.97959; 
Zc2b1 = 1.27749; 
Za1b1 = 9.35663; 
Zb1b1 = -0.00707144; 
Zac1 = 1.18432; 
Zbc1 = 3.73836; 
Zcc1 = 0.0833786; 
Zdc1 = 8.51364; 
Za2c1 = -0.00317581; 
Zc1bis[M_] := 10^(Zac1*Log[M/Zdc1^2]^Zcc1^2 + Za2c1*Log[M]) - Zbc1^2; 
Zac1 = 1.18432; 
Zbc1 = 3.73836; 
Zcc1 = 0.0833786; 
Zdc1 = 8.51364; 
Za2c1 = -0.00317581; 
Za1c1 = 0.765; 
Zb1c1 = 0.0098; 
Zc1[M_] := Zc1bis[M]*UnitStep[M - 100]*UnitStep[499.999 - M] + 
    (0.003221247696206575 + Za1c1*M^Zb1c1)*UnitStep[M - 500]*
     UnitStep[1000 - M]; 
Zd1[M_] := (Za1d1*M^Zb1d1 + Za2d1*M^Zb2d1)*UnitStep[M - 100]*
     UnitStep[190.999 - M] + (Za3d1*M^Zb3d1 + Za4d1*M^Zb4d1)*
     UnitStep[M - 191]*UnitStep[361.999 - M] + 
    Zad1*M^Zbd1*UnitStep[M - 362]*UnitStep[1000 - M]; 
Za1d1 = 21.5; 
Zb1d1 = -1.01; 
Za2d1 = 0.00999; 
Zb2d1 = 0.53; 
Za3d1 = 0.491; 
Zb3d1 = -0.115; 
Za4d1 = 2.02/10^9; 
Zb4d1 = 2.56; 
Zad1 = 0.272; 
Zbd1 = -0.0099; 
Zp[M_] := (Zm3p*M^Zn3p + Zm2p*M^Zn2p)*UnitStep[M - 170] + 
    (10^(-11.1*Log[M/7.68^2]^0.625^2 + 2.64*Log[M]) + 59.4^2)*
     UnitStep[170 - M]; 
Zm3p = 8550; 
Zn3p = -0.166; 
Zm2p = 0.476; 
Zn2p = 0.984; 
Zap = -11.0639; 
Zbp = 59.4138; 
Zcp = 0.625042; 
Zdp = 7.68322; 
Za2p = 2.64108; 
fZjbis[M_] := 10^(Za*Log[M/Zd^2]^Zc^2 + Za2*Log[M]) - Zb^2; 
Za = 1.18814; 
Zb = 3.71421; 
Zc = 0.0726272; 
Zd = 9.12985; 
Za2 = -0.00356157; 
Za1j = 0.884; 
Zb1j = 0.0175; 
Zj[M_] := fZjbis[M]*UnitStep[M - 100]*UnitStep[349.999 - M] + 
    Za1j*M^Zb1j*UnitStep[M - 350]*UnitStep[1000 - M]; 
Clear[Ztotal, M]; 
Ztotal[M_, x_] := 25.8*Exp[(-Zb1[M])*x^0.5 - Zc1[M]/x^Zd1[M]]*
    (Log[Zp[M]*(Zj[M]^2 - x)]/Log[Zp[M]])^3.87;

Clear[ZTotal,M]

ZTotal[M_,x_]:=Piecewise[{{0.000001,M<100},{Ztotal[M,x],100≤ M≤ 1000},{Ztotal[1000,x],1000<M<50000}}];
Plot[ZTotal[5000,x],{x,0.0001,1.0},PlotRange->All]