How does an infrared thermometer actually calculate temperature? I am slightly confused about infrared radiation and the equations related to it.
$P = A \epsilon \sigma T^4$ (1)
and
$B_{\lambda}(\lambda,T) = \frac{2hc^2}{\lambda^5} \frac{1}{e^{\frac{hc}{\lambda k_B T}}-1}$ (2)
I understand that equation one is just integral form of equation two. Are P and B just the power output of the black body radiation? 
Perhaps I should explain. I am working with an infrared thermometer (MLX90614) and I am wondering exactly what this picks up. Does it pick up the power of the infrared radiation through a lens and convert it to an electric signal so we can get the temperature of the object? Or does it measure the wavelength of the infrared radiation that is coming in and get temperature that way? THANKS!
 A: This thermometer is sensitive in a band 5.5um-14um.  The equation (2) (I think) shows your black-body spectrum and the IR-th integrates the intensity in the above range. 
Normally, such a probe should also measure the ambient temperature and it should know the emissivity $\epsilon$ value of the material you point at, to properly calculate the temperature. E.g. shiny metals are more difficult to measure, because the large part is reflected from other objects.  Also consult the manual, page 45.
edit: In summary, IR thermometer can see only one 'color' and the only thing it can do is to measure the intensity of this single color.  Imagine a heated iron rod. Forget about what you see in visible spectrum. If you select only this 'IR deep-red color', it's intensity will grow up with higher temperature.
A: I think, if you plot $B_{\lambda}$ in equation (2) with respect to $\lambda$ you get a distribution. As in
https://en.wikipedia.org/wiki/Black-body_radiation#/media/File:Black_body.svg
So, if you want to find the temperature from wavelength you need the find the point where the intensity peaks. That is to say you need to find the maximum point of intensity. Therefore you need to solve
$$
\frac{\partial B_{\lambda}}{\partial \lambda}=0
$$
