For the rest of this post I am going to assume the following conventions:
The mirror equation is
\frac{1}{d_o} + \frac{1}{d_i} = \frac{1}{f}
This equation applies to both convex and concave mirrors alike.
The convention is that the distances are positive if what they are measuring is in front of the mirror, and negative if behind the mirror. In other words, if the image is in front of the mirror then
di is positive. If the image is behind the mirror then
di is negative. The same goes for the object. (It goes without saying that the object will always be in front of the mirror. It doesn't even really make sense to put the object behind the mirror. It wouldn't have a reflection if it were placed behind the mirror. It just makes the convention easier to remember. Positive if in front of the mirror, negative if behind.)
Notice I haven't mentioned anything about the sign of focal length and how it relates to the equation. That's because I don't have to. Focal length signs work themselves out. There's another convention that says if the focal length is positive it's a concave mirror. If the focal length is negative it's convex. That same convention works with the above equation as-is.
Aoiumi said:
Homework Statement
An object is placed 50 cm in front of a convex mirror and its image is found to be 20 cm behind the mirror. What is the focal length of the mirror? Homework Equations
1/d0 + 1/di = 1/f
The Attempt at a Solution
1/50 + 1/20 = 1/-f
Two things. Firstly, the image is said to be behind the mirror. That means the
di is -20 cm. Not positive.
Secondly, don't put the negative sign in front of
f. Just leave
f as it is in the \frac{1}{d_o} + \frac{1}{d_i} = \frac{1}{f} equation. You don't need to change the equation.
If
f turns out to be negative, meaning the mirror is convex, the math will tell you. You don't need to change the equation for this. As it turns out, the problem statement's assertion about the mirror being convex was superfluous information. It didn't need to tell you that to solve the problem. You could have figured that out just by doing the math.