The mechanical efficiency of an internal combustion engine is calculated using the formula n = (Pb / Pig) = 1 - (Pf / Pig), where Pb is brake power, Pig is gross indicated power, and Pf is friction power. The discussion also touches on the formulas for indicated power (ip) for both 4-stroke and 2-stroke engines, though specific formulas for ip were not provided. Clarification was sought regarding the term "ip," with a suggestion that it might refer to indicated pressure. Understanding these formulas is crucial for evaluating engine performance and efficiency. The conversation highlights the importance of precise terminology in discussing engine mechanics.