simplification



Yes, you can certainly define patterns like sin(e*x) => e*sin(x) where 'e'
has a certain property.  See chapter 34 of the manual (you can get to it
with ?? patterns on the command line).  And you can use 'trigexpand' to
transform cos(x+e*%pi/4) => cos(%pi*e/4)*cos(x)-sin(%pi*e/4)*sin(x), which
then includes expressions of the form cos(e*x).

You can also define patterns like e^n => 1 if n is an odd integer and e if
n is an even integer.

           -s
On Sun, Apr 15, 2012 at 15:08, Jean Vittor <jean.vittor at free.fr> wrote:

> Thanks for all response I got.
>
>
> I've tried {subst(1, e1, %), subst(-1, e1, %)}; then union((subst(1, e2,
> %), subst(-1, e2, %)) and so on...
>
> It kinda works: I get some simplifications but I lose variables e1, e2...
> and the result set is large (as I have a lot of iterations with at least
> one sign variable for each iteration). Moreover, I would like to use
> functions that returns either 1 or -1.
>
> Is there a solution which would consist in:
>   - declaring a variable type (or feature, or property, I'm not familiar
> with maxima's vocabulary) : say 'sign';
>   - adding some rules like tellsimp(sin(e*x), e*sin(x)) if e is a 'sign'
> and x an expression that leads to a real number ?
>
> Even a 'function' (let's call it simplify_sign) could fit if I could have:
> simplify_sign(e, sin(e*a_complex_expression)) returns
> e*sin(a_complex_expression).
>
>
> Thanks,
>
> Jean
>
> Le 13/04/2012 17:56, Stavros Macrakis a ?crit :
>
>> [...]
>>
>
> ______________________________**_________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/**mailman/listinfo/maxima<http://www.math.utexas.edu/mailman/listinfo/maxima>;
>