Using the lens equation, 1/f = 1/v - 1/u, where f is the focal length, v is the image distance, and u is the object distance.
We are given that f = 25 cm, u = -40 cm (since the object is placed in front of the lens), and v = -5 cm (since the image is real).
Substituting these values into the lens equation, we get:
1/25 = 1/-5 - 1/-40
Simplifying this equation yields:
1/25 = 7/200
Multiplying both sides by 200, we get:
8 = v
Therefore, the image distance is v = -8 cm.
Using the magnification equation, m = -v/u, where m is the magnification, we can find the magnification of the image:
m = -v/u = -(-8)/(-40) = 1/5
Since the magnification is positive, the image is upright.
The height of the object, h1, is related to the height of the image, h2, by the magnification equation:
m = h2/h1
Substituting the known values of m and h2, we get:
1/5 = 5/h1
Solving for h1, we get:
h1 = 25 cm
Therefore, the height of the object is 25 cm.