dNdx tau

Clear[taun1, taup]; 
taun1[M_] := tauan1*M^taubn1*UnitStep[M - 25]*UnitStep[9999.999 - M] + 
    (taua1n1*M^taub1n1 + taua2n1*M^taub2n1 + tauctotaln1)*UnitStep[M - 10000]*UnitStep[50000 - M]; 
tauan1 = 10.6; 
taubn1 = -0.0148; 
taua1n1 = -7.; 
taub1n1 = -1.99; 
taua2n1 = 179; 
taub2n1 = -0.763; 
tauctotaln1 = 9.09; 
taup[M_] := taua1p*M^taub1p*UnitStep[M - 25]*UnitStep[999.999 - M] + taua2p*M^taub2p*UnitStep[M - 1000]*
     UnitStep[50000 - M]; 
taua1p = 0.773; 
taub1p = 1.75; 
taua2p = 3.07; 
taub2p = 1.55; 
Clear[tautotal, logtau, M]; 
logtau[M_, x_] = 0.0026*Log[taup[M]*(1. - x)]*x^0.5*(x^2 - 2*x + 2); 
tautotal[M_, x_] := 14.7*Exp[-5.4*x^taun1[M] - 2.541/x^0.29504 + 0.3734/x^0.47 - 5.31*x^1.404] + logtau[M, x];

Plot[tautotal[5000,x],{x,0.0001,1.03},PlotRange->All]