## Simplification of ExpressionsSuppose we compute fricas integrate(exp(-x^2/2)/sqrt(2*%pi),
In general (unlike some other computer math systems) FriCAS automatically performs only a very small number of basic simplifications. This is not one of them, so we need to provide some help. In particular we need to tell FriCAS how to expand square roots. (Since is a multi-valued function this rule is true only in a restricted sense for a particular choice of branches. Consider .) fricas expandSqrt := rule sqrt(a*b)==sqrt(a)*sqrt(b)
Next, notice that the output of the integration operation has a complicated type structure. This would interfere with the simplification, so we first simplify the type before we apply the rule. fricas (%% 1)::Expression Integer
Type: Expression(Integer)fricas expandSqrt %
Type: Expression(Integer) |