Mirror formula is the relationship between object distance (u), image distance (v) and focal length.
The figure shows an object AB at a distance u from the pole of a concave mirror. The image A1B1 is formed at a distance v from the mirror. The position of the image is obtained by drawing a ray diagram.
Consider the D A1CB1 and D ACB
[when two angles of D A1CB1 and D ACB are equal then the third angle
But ED = AB
From equations (1) and (2)
If D is very close to P then EF = PF
But PC = R, PB = u, PB1 = v, PF = f
By sign convention
PC = -R, PB = -u, PF = -f and PB1 = -v
Equation (3) can be written as
Dividing equation (4) throughout by uvf we get
Equation (5) gives the mirror formula
We hope that clarifies your doubt