I am trying to use sympy help me simplify some equations and check whether two formula are equivelant. But in one case I find it quite confusing when handling Abs(cos(inc))/sqrt(cos(inc)**2). I expect the output should be 1 but the original expression is given back. from sympy import simplify, parse_expr,Symbol inc=Symbol('inc',positive=True,real=True) exp_str='1*Abs(cos(inc))/sqrt(cos(inc)**2)' exp=parse_expr(exp_str) tmp=exp.subs("Abs(cos(inc))/sqrt(cos(inc)**2)","1") which gives the following output: Abs(cos(inc))/sqrt(cos(inc)**2) instead of simply 1. Note that I already restrict the inc to be positive real number, I wonder what to do to make it work and understand why the formula is not simplified. Some reference about the difference of expression, function is also welcomed. Continue reading...