I am trying to obtain numerically the roots of a function, but Mathematica is not able to obtain them. I used NSolve, FindRoot and even the custom Jens' findAllRoots function, but none of them work. Any solution? The code that I used is the following:
ClearAll[ff, f, FF, F, kb, T, TL, TR, m, mr, ml, V]
ff[e_, m_?NumberQ, t_?NumberQ] := 1/(1 + Exp[(e - m)/t])(temperature is expressed in units of T/Subscript[k, B])
tt[e_, e0_?NumberQ, w_?NumberQ] := 1/(1 + Exp[-(e - e0)/w])(transmission probability)
e0 = 0;
w = .3;
ml = .4;
mr = -.4;
tl = 1;
tr = 1;
kk[e_] = D[tt[e, e0, w]*(ff[e, ml, tl] - ff[e, ml, tl]^2 +
ff[e, mr, tr] - ff[e, mr, tr]^2), e];
NSolve[kk[e]==0,e]
FindRoot[kk[e],{e,0}]
findAllRoots[kk[e], {e, -2, 5}, "ShowPlot" -> False]
The outputs show convergence problems. Thanks for your help.

FindRoot[kk[e], {e, 1}] (* {e -> 0.694818} *)Plottingff[e]helps to find a starting value. – LouisB Jan 21 '21 at 21:30NSolve[kk[e] == 0, e, Reals] (* {e -> 0.694818} *)also works. – LouisB Jan 21 '21 at 21:37ffandttto being numbers is unnecessary since these functions do not use numeric techniques. However, if it were necessary to restrict their arguments,NumericQshould be used rather thanNumberQ.NumberQreturnsFalsefor symbolic numbers such asPiorE. – Bob Hanlon Jan 21 '21 at 22:02NSolve[kk[e] == 0 && -2 < e < 5, e], using the limits in yourfindAllRoots, also works. – Michael E2 Jan 21 '21 at 23:47NSolvedeals primarily with linear and polynomial equations." Your problem is neither and Mathematica generally assumes that all variables can be complex. In this case it needs to be told that the variable is real, either explicitly by specifying the domain or implicitly by using the variable in an inequality. The performance ofFindRootis always highly dependent on the starting value. – Bob Hanlon Jan 22 '21 at 16:10NSolvecan try, but only if you specify a bounded interval. BTW, no one has mentioned it butNSolve[kk[e] == 0, e]works fine in V12.2 and returns several infinite families of roots in the complex plane. – Michael E2 Jan 28 '21 at 18:51