display all results of sqrt()



The one_of idea may work much better with a selector or index.
I'll use the name select_one.

solve((x-10)*(x-20)*(x-%pi)=0,x)

could return
x= select_one(g45, 10,20, %pi)

What is g45?  It is a new symbolic index object never before used.

say allsols: rhs(%).    now allsols is select_one(g45,10,20,b).

sin(allsols) is   select_one (g45, sin(10), sin(20), 0)

Now if you want the result of some computation using the first solution, 
namely x=10,  then do
something like  ev(..., g45=1);

There are pretty clear rules for working with select_one expressions. 

one argument functions like sin, cos, tan, exp, etc are clear.
select_one(a, ....)+,*,-,/   etc  are pretty obvious too.

I'm not sure about using   factor, solve, etc.

Also something like 1/select_one(g46,a,b,0)     would become 
select_one(g46,1/a,1/b, oh_no_I_didnt_mean_to_divide_by_zero).

How much of Maxima would be needed to do a good job on this??

integrate(f(x,y), select_one(g48,x,y))  ?


RJF



Barton Willis wrote:
> If one_of(1,2) + 1 automatically simplified to one_of(2,3), it would
> make such problems less likely, I suppose; but I doubt it would eliminate
> them.
>
> I think my one_of idea was intended for multiple representations of
> equivalent expressions--things like
>
> (%i14) e : 4* sin(x + y) * cos(x - y);
> (%o14) 4*cos(y-x)*sin(y+x)
> (%i15) one_of(e, trigrat(e), expand(exponentialize(e)));
> (%o15) one_of(4*cos(y-x)*sin(y+x),2*sin(2*y)+2*sin(2*x),-%i*%e^
> (2*%i*y)+%i*%e^(-2*%i*y)-%i*%e^(2*%i*x)+%i*%e^(-2*%i*x))
>
> Or Bessel / hypergeometric, etc.
>
> Barton
>
> -----macrakis at gmail.com wrote: -----
>
>
>   
>> The problem here is with correlated expressions. Consider
>>
>>      expr: oneof(1,2)+1
>>
>> Presumably expr^2 can take on the values 4 and 9.  But what about
>> expand(expr^2)?  Surely that should also take on the values 4 and 9,
>> and not 4, 6, and 9...
>>
>>             -s
>>
>>     
>
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>