Step 1: Analyze the initial condition.
A convex lens forms a real image of the same size as the object only when the object is placed at a distance of twice the focal length (2f) from the optical center.
Initial object distance, \(u = -2f\).
The image is also formed at 2f on the other side.
Step 2: Analyze the second condition.
The object is moved 12 cm closer to the lens.
New object distance, \(u' = u + 12 = -2f + 12\). (The negative sign is included in the value).
A real image is formed, which is three times the size. For a real image from a convex lens, the magnification (\(m\)) is negative (inverted).
Magnification, \(m = -3\).
Step 3: Use the magnification formula.
\(m = \frac{v'}{u'}\)
\[ -3 = \frac{v'}{-2f + 12} \]
\[ v' = -3(-2f + 12) = 6f - 36 \]
This is the new image distance. Since \(v'\) is positive, the image is real, which matches the problem description.
Step 4: Use the lens formula.
\[ \frac{1}{f} = \frac{1}{v'} - \frac{1}{u'} \]
Substitute the expressions for \(u'\) and \(v'\):
\[ \frac{1}{f} = \frac{1}{6f - 36} - \frac{1}{-2f + 12} \]
\[ \frac{1}{f} = \frac{1}{6f - 36} + \frac{1}{2f - 12} \]
Find a common denominator:
\[ \frac{1}{f} = \frac{1}{3(2f - 12)} + \frac{1}{2f - 12} \]
\[ \frac{1}{f} = \frac{1 + 3}{3(2f - 12)} \]
\[ \frac{1}{f} = \frac{4}{3(2f - 12)} \]
Cross-multiply:
\[ 3(2f - 12) = 4f \]
\[ 6f - 36 = 4f \]
\[ 2f = 36 \]
\[ f = 18 \text{ cm} \]
The focal length of the lens is 18 cm.