arguments of a function, op function (19.9.00)

Tom Lovie

I wanted to know if there is a function that will return the argument to a RootOf function. Like an inverse RootOf function.

Example:


now, I’d like to get at the quantity _Z^2+4*_Z+5 so I could pass it to a discrim function.

Paul Goossens (20.9.00)

Try

op(1,RootOf(_Z^2+4*_Z+5));

Kevin Ulmes (20.9.00)

You could try the op function, to break down the root of function. The op function breaks down larger complex expressions into components, so used in this case, it would look something like this:


You can assign that last result to a variable and pass it to the discrim function, or to any other function that you want.

Robert Israel (20.9.00)

op(%);

or, for other forms of RootOf,

op(1,%);

Douglas Wilhelm Harder (20.9.00)

In this case, op( * ) will work, but if something has multiple arguments, you can use op( N, * ) to select the Nth operand:

> op( f( a, b, c ) ); 
                            a, b, c 
 
> op( 1, f( a, b, c ) ); 
                               a 
 
> op( 2, f( a, b, c ) ); 
                               b 
 
> A := RootOf( _Z^2+4*_Z+5 ): 
> op( 1, A ); 
                             2 
                           _Z  + 4 _Z + 5

although it is probably a good idea to change the _Z to some other variable as _Z is recognized as being special in a number of cases in Maple:

> eval( op( 1, A ), _Z = x ); 
                              2 
                             x  + 4 x + 5

You could always just enter the routine:


to do this for you automatically.