In some sense the original poster is asking for something that can't be
effectively implemented.
At least as I read it, the question is, can Maxima handle this situation:
"I'm thinking of a number, either one or minus one. Call it e. I'm going to
write an expression (trigonometric, but really e*x is not trig..)
involving exactly one occurrence of e.
I want it simplified for either value of e, but with the result
expressed as a function
of e, in a nice form."
Well, look at this: sin(3.0+e). What are you going to do? How about 0^e?
The original question is really such a special special case that it
seems unlikely to
be a built-in "feature". On the other hand, a computer algebra system
has lots
of features and it is hard, especially for a new user, to gather what
has been
implemented or not. There are a fair number of peculiar functionalities
which
are included not so much because they are useful, but because they could be
programmed.
There is a reasonable approach if you are willing to reformulate the
problem as
actions on pairs, as suggested.
instead of sin(e*x), use {sin(x), sin(-x)}.
If both elements are identical, convert to a single value. Otherwise,
all operations are
mapped on to each of the two values. Doing this systematically might be
possible by
some cleverness.
RJF
On 4/13/12 8:17 AM, Barton Willis wrote:
> The general simplifier for trigonometric functions has a method for deciding when to apply a reflection identity; for example
>
> (%i1) sin(-x);
> (%o1) -sin(x)
>
> (%i2) cos(-x);
> (%o2) cos(x)
>
> (%i3) makelist(cos(x + (1-e) * %pi/2),e,[-1,0,1]);
> (%o3) [-cos(x),-sin(x),cos(x)]
>
> Maxima uses an ordering predicate (defined on expressions, not just numbers) to decide when to use the reflection identity:
>
> (%i4) sin(b-x);
> (%o4) -sin(x-b)
>
> (%i5) sin(b-a);
> (%o5) sin(b-a)
>
> The aim of the algorithm is to simplify as many expressions to zero as possible:
>
> (%i7) sin(b-x) + sin(x-b);
> (%o7) 0
>
> (%i8) sin(a-b) + sin(b-a);
> (%o8) 0
>
> Also, the function trigrat might be useful to you? I didn't answer your question, but maybe some of this is useful.
>
> --bw
>
> ________________________________________
> From: maxima-bounces at math.utexas.edu [maxima-bounces at math.utexas.edu] on behalf of Jean Vittor [jean.vittor at free.fr]
> Sent: Friday, April 13, 2012 06:39
> To: maxima at math.utexas.edu
> Subject: simplification
>
> Hi,
>
> I'm new to maxima and I have a hard time understanding how
> simplification works.
>
> My point is to use "sign" values (I mean integers which take their value
> from {-1;1}) and to be able to automate some trigo simplifications like
> (in the following, e is a sign and x a real expression):
> - sin(e*x) -> e*sin(x)
> - cos(e*x) -> cos(x)
> - cos(x+(1-e)*%pi/2) -> e*cos(x)
> - ...
> - and, of course, e^2 -> 1
>
> Is there a way to do this with maxima ?
>
>
> Thanks,
>
> Jean
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima