Since the equation of the SML is the capital asset pricing model, you can determine if a stock is over- or underpriced graphically or mathematically. Your answers will always be the same.
Graphically: If you plot a stock’s expected return on the SML and it falls below the line, it indicates that the stock is currently overpriced, causing its expected return to be too low. If the plot is above the line, it indicates that the stock is underpriced. If the plot falls on the SML, it indicates the stock is properly priced.
Mathematically: In the context of the SML, a security is underpriced if the required return is less than the holding period (or expected) return, is overpriced if the required return is greater the holding period (or expected) return, and is correctly priced if the required return equals the holding period (or expected) return.