Explanation:
It is given that,
The object distance from the lens is 10 cm, u = -10 cm
Image is formed at a distance of 40 cm away from the lens, u = 40 cm
The lens formula is : [tex]\dfrac{1}{v}-\dfrac{1}{u}=\dfrac{1}{f}[/tex], v is image distance
[tex]\dfrac{1}{40}-\dfrac{1}{-10}=\dfrac{1}{f}\\\\f=8\ cm[/tex]
The focal length is 8 cm
Magnification,
[tex]m=\dfrac{v}{u}\\\\m=\dfrac{40}{-10}\\\\m=-4[/tex]
The magnification is negative, it means that the formed image is inverted.