Given information
The mass of the block is .
The mass of the bullet is .
The speed of the bullet is .
Step-by-step explanation
Initially the system has only the potential energy, therefore, the formula for the initial energy of the system is
Here, is the initial energy, is the mass of the bullet, is the mass of the block, is the acceleration due to gravity and is the height.
Finally the system has only the kinetic energy, therefore, the formula for the final energy of the system is
Here, is the final energy and is the final speed of the system.
According to the law of conservation of energy, the total energy of an isolated system is always conserved, i.e. the initial energy of a system is equal to its final energy.
Apply the law of conservation of energy, the formula becomes