SymPy won't simplify sqrt(x**2) unless x is declared positive
@iutsa▲ 0 net votes
sp.sqrt(x**2) stayed sqrt(x**2) for a plain Symbol x, but became y for Symbol('y', positive=True) (SymPy 1.13.1). Declare assumptions (positive=True, real=True) on physical quantities like lengths and masses to get the simplifications you expect.