dNdx w

Clear[Wb1, Wc1, Wd1, Wp, Wj]; 
Wb1[M_] := (Wa1b1*M^Wb1b1 + Wa2b1*M^Wb2b1)*UnitStep[M - 100]*UnitStep[199.999 - M] + 
    Wab1*M^Wbb1*UnitStep[M - 200]*UnitStep[1000 - M]; 
Wa1b1 = 0.0433; 
Wb1b1 = 0.765; 
Wa2b1 = 46.4; 
Wb2b1 = -0.382; 
Wab1 = 9.29; 
Wbb1 = -0.0139; 
Wc1[M_] := (Wa1c1*M^Wb1c1 + Wa2c1*M^Wb2c1 + Wc1c1)*UnitStep[M - 100]*UnitStep[199.999 - M] + 
    Wac1*M^Wbc1*UnitStep[M - 200]*UnitStep[1000 - M]; 
Wa2c1 = 35.0184; 
Wb2c1 = -0.0643105; 
Wa1c1 = -26.9977; 
Wb1c1 = -0.240221; 
Wc1c1 = -16.4625; 
Wac1 = 0.743; 
Wbc1 = 0.0331; 
Wd1[M_] := Wad1*M^Wbd1*UnitStep[M - 235]*UnitStep[1000 - M] + (Wa1d1*M^Wb1d1 + Wa2d1*M^Wb2d1)*UnitStep[M - 100]*
     UnitStep[234.99999 - M]; 
Wad1 = 0.265; 
Wbd1 = -0.0137; 
Wa1d1 = 0.000264; 
Wb1d1 = 1.024; 
Wa2d1 = 2.28; 
Wb2d1 = -0.47; 
Wp[M_] := (Wa1p*M^Wb1p + Wa2p*M^Wb2p)*UnitStep[M - 100]*UnitStep[1000 - M]; 
Wa1p = 100000; 
Wb1p = -1.13; 
Wa2p = 285; 
Wb2p = 0.0794; 
Wj[M_] := (10^(0.906454*Log[M/8.77019^2]^0.107957^2 - 0.0053008*Log[M]) - 2.56772^2)*UnitStep[M - 100]*
     UnitStep[384.999 - M] + Wa1j*M^Wb1j*UnitStep[M - 385]*UnitStep[1000 - M]; 
Waj = 0.906454; 
Wbj = 2.56772; 
Wcj = 0.107957; 
Wdj = 8.77019; 
Wa2j = -0.0053008; 
Wa1j = 0.943; 
Wb1j = 0.00852; 
Clear[Wtotal, M]; 
Wtotal[M_, x_] := 25.8*Exp[(-Wb1[M])*x^0.51 - Wc1[M]/x^Wd1[M]]*(Log[Wp[M]*(Wj[M]^1 - x)]/Log[Wp[M]])^3.;

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