We all know that 00 is indeterminate.
But, javascript says that:
Math.pow(0, 0) === 1 // true
For this to understand you need to solve calculus:
Expanding x^x
around zero using Taylor series, we get:
So to understand what's going on with limit when x
goes to zero,
we need to find out what's going on with second term x log(x)
, because other terms are proportional to x log(x)
raised to some power.
We need to use transformation:
Now after this transformation we can use L'Hôpital's rule, which states that:
So differentiating that transformation we get:
So we've calculated that term log(x)*x
approaches 0 when x approaches 0.
It's easy to see that other consecutive terms also approaches zero and even faster than second term.
So at point x=0
, series becomes 1 + 0 + 0 + 0 + ...
and thus equals to 1.