login  home  contents  what's new  discussion  bug reports     help  links  subscribe  changes  refresh  edit

In FriCAS expression are represented as rational functions in kernels. exp(2*x) and exp(x) are different kernels, so

exp(2*x) - exp(x)^2

\label{eq1}{{e}^{2 \  x}}-{{{e}^{x}}^{2}}(1)
Type: Expression(Integer)

gives nonzero result. To recognize that this is really 0 we need to perform extra computation. In this case normalize is enough

normalize(exp(2*x) - exp(x)^2)

Type: Expression(Integer)

In general, to express function in terms of algebraically independent kernels one can use rischNormalize. It takes two arguments, the first argument is list of expressions to analize, the second is list of variables (rischNormalize treats variables and constants in slightly different way). For example:

rischNormalize([exp(2*x), exp(x)],[x])

\label{eq3}\left[{funcs ={\left[{{{e}^{x}}^{2}}, \:{{e}^{x}}\right]}}, \:{kers ={\left[{{e}^{2 \  x}}\right]}}, \:{vals ={\left[{{{e}^{x}}^{2}}\right]}}\right](3)
Type: Record(funcs: List(Expression(Integer)),kers: List(Kernel(Expression(Integer))),vals: List(Expression(Integer)))

The result has three parts. First is list of rewritten expression. Second is list of kernels that were rewritten. The third is list of values assigned to kernels.

  Subject:   Be Bold !!
  ( 14 subscribers )  
Please rate this page: