# A very basic question about optics and figuring out focal length

Focal Length of a lens - I was told that as an approximation I could simply put a sheet of paper with text on it on a table, hold the lens above it, and when I can see the text most clearly, the height between the lens and the table is the focal length. When I look on YouTube I see videos that basically state the same thing, although some examples use an optical bench but the method is the same, just done horizontally instead of vertically. So I look a little deeper and find the equation 1/f=1/do+1/d1. Then I made a basic optics bench. I have a flashlight at 0 inches and a white screen 40 inches away. I slide a lens forward and back to find the sharpest image on the screen. If the best image is when the lens is 13 inches from the flashlight, I used to think 13 inches was the focal length. But using the equation, the focal length is about 9 inches. There's a huge difference between the two. So what the heck is the actual focal length?? I'm guessing the difference may be because the flashlight is close to the lens? (I actually sell lenses to kaleidoscope artists so I'd really like to know!)

$$\frac{1}{f} = \frac{1}{d_i}+\frac{1}{d_o} = \frac{1}{13}+\frac{1}{40-13} \Rightarrow f=8.775$$
The first statement, that $f$ is the distance from the object at which the clearest image is projected onto the screen, is actually an approximation to the above: it works when your screen is very far away. What you will find, if you make your screen a little further away, is that the focal length calculated by the first method would be a little less than 13 inches, and as you made the screen further and further away the "focal length" as found by your first method would slowly approach 8.8 inches.
You can see that your equation is the "screen at infinity" limit: when $d_o\to\infty$ in the thin lens equation, then we are left with $f\to d_i$, which is your first rule.
The first rule is good for things like microscope objectives, where $d_o$ is of the order of millimetres and adjust to cast an image on a screen a couple of metres away, or if you hold a thin lens above a desk to find the distance from the desk at which it images the fluorescent tubes on the ceiling and its focal length is centimetres, whereas the distance to the fluorescent tubes on the ceiling is likely to be three metres or so.