### Related

? dispfun;

Calculate

##### dispfun-ev-integrate-noundisp-nouns-pi-plot2d-print-ratsimp-rhs-solve-tex-true

noundisp : true;

circ: x^2+y^2=1;

half(x) := rhs(solve(...

Calculate

##### dispfun-ev-integrate-noundisp-nouns-plot2d-print-rhs-solve-tex-true

noundisp : true;

circ: x^2+y^2=1;

half(x) := rhs(solve(...

Calculate

##### dispfun-ev-integrate-noundisp-nouns-pi-plot2d-print-ratsimp-rhs-solve-tex-true

noundisp : true;

circ: x^2+y^2=1;

half(x) := rhs(solve(...

Calculate

##### dispfun-ev-integrate-noundisp-nouns-pi-plot2d-print-ratsimp-rhs-solve-tex-true

noundisp : true;

circ: x^2+y^2=1;

half(x) := rhs(solve(...

Calculate

##### dispfun-ev-integrate-noundisp-nouns-plot2d-print-ratsimp-rhs-solve-tex-true

noundisp : true;

circ: x^2+y^2=1;

half(x) := rhs(solve(...

Calculate

##### dispfun-ev-integrate-noundisp-nouns-plot2d-print-ratsimp-rhs-solve-tex-true

noundisp : true;

circ: x^2+y^2=1;

half(x) := rhs(solve(...

Calculate

##### dispfun-ev-integrate-noundisp-nouns-pi-plot2d-print-ratsimp-rhs-solve-tex-true

noundisp : true;

circ: x^2+y^2=1;

half(x) := rhs(solve(...

Calculate

##### dispfun-ev-integrate-noundisp-nouns-pi-plot2d-print-ratsimp-rhs-solve-tex-true

noundisp : true;

circ: x^2+y^2=1;

half(x) := rhs(solve(...

Calculate

##### dispfun-ev-integrate-noundisp-nouns-pi-plot2d-print-ratsimp-rhs-solve-tex-true

noundisp : true;

circ: x^2+y^2=1;

half(x) := rhs(solve(...

Calculate

### dispfun

Run Example
(%i1)? dispfun;

-- Function: dispfun (<f_1>, ..., <f_n>)
-- Function: dispfun (all)
Displays the definition of the user-defined functions <f_1>, ...,
<f_n>.  Each argument may be the name of a macro (defined with
::='), an ordinary function (defined with :=' or define'), an
array function (defined with :=' or define', but enclosing
arguments in square brackets [ ]'), a subscripted function,
(defined with :=' or define', but enclosing some arguments in
square brackets and others in parentheses ( )') one of a family
of subscripted functions selected by a particular subscript value,
or a subscripted function defined with a constant subscript.

dispfun (all)' displays all user-defined functions as given by
the functions', arrays', and macros' lists, omitting
subscripted functions defined with constant subscripts.

dispfun' creates an intermediate expression label (%t1', %t2',
etc.)  for each displayed function, and assigns the function
definition to the label.  In contrast, fundef' returns the
function definition.

dispfun' quotes its arguments; the quote-quote operator '''
defeats quotation.  dispfun' returns the list of intermediate
expression labels corresponding to the displayed functions.

Examples:

(%i1) m(x, y) ::= x^(-y);
- y
(%o1)                   m(x, y) ::= x
(%i2) f(x, y) :=  x^(-y);
- y
(%o2)                    f(x, y) := x
(%i3) g[x, y] :=  x^(-y);
- y
(%o3)                     g     := x
x, y
(%i4) h[x](y) :=  x^(-y);
- y
(%o4)                     h (y) := x
x
(%i5) i[8](y) :=  8^(-y);
- y
(%o5)                     i (y) := 8
8
(%i6) dispfun (m, f, g, h, h[5], h[10], i[8]);
- y
(%t6)                   m(x, y) ::= x

- y
(%t7)                    f(x, y) := x

- y
(%t8)                     g     := x
x, y

- y
(%t9)                     h (y) := x
x

1
(%t10)                     h (y) := --
5        y
5

1
(%t11)                    h  (y) := ---
10         y
10

- y
(%t12)                    i (y) := 8
8

(%o12)       [%t6, %t7, %t8, %t9, %t10, %t11, %t12]
(%i12) ''%;
- y              - y            - y
(%o12) [m(x, y) ::= x   , f(x, y) := x   , g     := x   ,
x, y
- y           1              1             - y
h (y) := x   , h (y) := --, h  (y) := ---, i (y) := 8   ]
x              5        y   10         y   8
5             10

(%o1)                                true
(%i2) 
Run Example
noundisp : true;
(%o1)                                true
(%i2) circ:  x^2+y^2=1;
2    2
(%o2)                             y  + x  = 1
(%i3) half(x) := rhs(solve(circ, y)[2])*2;
(%o3)                  half(x) := rhs(solve(circ, y) ) 2
2
(%i4) tex(half(x));
$$2\,\sqrt{1-x^2}$$
(%o4)                                false
(%i5) penum(x) := ''(ratsimp(''(integrate(half(x), x))));
2
(%o5)                penum(x) := asin(x) + x sqrt(1 - x )
(%i6) dispfun(penum);
2
(%t6)                penum(x) := asin(x) + x sqrt(1 - x )

(%o6)                                [%t6]
(%i7) print(penum(x));
2
asin(x) + x sqrt(1 - x )
2
(%o7)                      asin(x) + x sqrt(1 - x )
(%i8) pgrad(x) := 0.5 + (ev(penum(2*x-1), nouns) / (%pi / 2));
ev(penum(2 x - 1), nouns)
(%o8)             pgrad(x) := 0.5 + -------------------------
%pi
---
2
$${{2\,\left(\arcsin \left(2\,x-1\right)+\left(2\,x-1\right)\,\sqrt{1 -\left(2\,x-1\right)^2}\right)}\over{\pi}}+0.5$$
(%o9)                                false
(%i10) plot2d(penum(x), [x, -1, 1]);
plotplot2d(''pgrad(x), [x, 0, 1]);
plot
Run Example
noundisp : true;
(%o1)                                true
(%i2) circ:  x^2+y^2=1;
2    2
(%o2)                             y  + x  = 1
(%i3) half(x) := rhs(solve(circ, y)[2])*2;
(%o3)                  half(x) := rhs(solve(circ, y) ) 2
2
(%i4) tex(half(x));
$$2\,\sqrt{1-x^2}$$
(%o4)                                false
(%i5) penum(x) := ''(integrate(half(x), x));
2
asin(x)   x sqrt(1 - x )
(%o5)              penum(x) := 2 (------- + --------------)
2            2
(%i6) dispfun(penum);
2
asin(x)   x sqrt(1 - x )
(%t6)              penum(x) := 2 (------- + --------------)
2            2

(%o6)                                [%t6]
(%i7) print(penum(x));
2
asin(x)   x sqrt(1 - x )
2 (------- + --------------)
2            2
2
asin(x)   x sqrt(1 - x )
(%o7)                    2 (------- + --------------)
2            2
(%i8) pgrad(x) := 0.5 + (ev(penum(2*x-1), nouns) / (%pi / 2));
ev(penum(2 x - 1), nouns)
(%o8)             pgrad(x) := 0.5 + -------------------------
%pi
---
2
$${{4\,\left({{\arcsin \left(2\,x-1\right)}\over{2}}+{{\left(2\,x-1 \right)\,\sqrt{1-\left(2\,x-1\right)^2}}\over{2}}\right)}\over{\pi}} +0.5$$
plot