In computer graphics applications its often needed to calculate the reflection ray for example if you are writing a ray tracer, a shader for some advanced lighting , or environment mapping etc.
Dot product between two unit vectors gives the cosine of the angle between them. So using this idea we can find
R = DotProduct[ I, N ] * N + P . ---> Eq(1)
We don't know P now. But I + P = N * DotProduct[ I,N].
So by rearranging P = N * DotProduct[ I,N] - I. Substituting the value of P now in equation(1) gives the final equation.
Here it is the final equation R = 2 * N * ( DotProduct[ I,N] ) - I