## 6214 Reputation

7 years, 315 days

## How can I go from the lhs to the rhs in ...

Maple

Assuming u and v are both real, I want to prove this equality.

```int(Dirac(u-v), [u, v])  = min(u, v)
```

To be clear, I don't want to verify is this equality is true, but I want (I would like) to do is to get its rhs by using ad hoc transformations of its lhs.

Under the same assumptions, how can I do the same thing for this equality?

`int(Dirac(u+v-1), [u, v]) = max(u+v-1, 0)`

## A question about inverse functions...

Maple

I am presently working on bivariate functions defined this way

```C := (u, v) -> (phi@@(-1))(phi(u)+phi(v));
```

phi is a function of specific expression named the "generator". Both u and v are assumed to be in the closed interval [0,1].

Here is an example:

```restart
phi := u -> (u^(-theta)-1)/theta:
C := (u, v) -> (phi@@(-1))(phi(u)+phi(v)):
C(u, v)
/ (-theta)        (-theta)    \
| u         - 1   v         - 1|
@@(phi, -1)| ------------- + -------------|
\    theta           theta    /
```

This definition of C is correct providing that  theta in [-1, +infinity) \ {0}.
As you can see, the display of C(u, v) contains the inverse function phi@@(-1) which Maple doesn't seem to know what to do with.

What I would like is to get rid of  phi@@(-1) and get

```C(u, v);
(-1+u^(-theta)+v^(-theta))^(-1/theta)```

The only way I found to get this is to do that:

```restart
phi := u -> (u^(-theta)-1)/theta:
(phi@@(-1)) := u -> solve(phi(x)=u, x): # explicit definition of (phi@@(-1))
C := (u, v) -> simplify((phi@@(-1))(phi(u)+phi(v))) assuming theta >= -1, theta <> 0:
C(u, v);
/    1  \
|- -----|
\  theta/
/      (-theta)    (-theta)\
\-1 + u         + v        /

```

As you see I have been forced to tell Maple what the inverse function of phi was.
Is there another way do get this result without writting the bold red line?

Maple knows several inverse functions (trigonometric functions for instance), but how does it know that?
As Maple does not seem to use a (f@@(-1)) := u -> solve(f(x)=u, x) like definition, does it uses a correspondence table between functions and their inverse?
If it is so can we augment it?

PS: the ultimate goal is to do something like this Download CAC.mw  for different generators.

For the moment I have defined my own table generator <--> inverse function  as I did above with the bold red line: this works but it is not very elegant.

## How can I evaluate procedure J2?...

Maple

Why does the execution of procedure J2 in the attached file fire an error?
it looked to me as if I had built it the same way as J1.

 > restart:
 > # Basically I want do do something like that, J1 := proc()   local z:   z := proc(u) fsolve(sqrt(x)=u, x) end proc:   evalf(Int(''z''(u), u=0..1)) end proc: J1();
 (1)
 > # but when z is more complex finction of two arguments. # # Unfortunately a direct transposition of what worked above no longer works. J2 := proc()   local z:    z := proc(q1, q2)      exp(        2*(          fsolve(1/2+(1/2)*erf((1/2)*x*sqrt(2)) = q1, x)          *          fsolve(1/2+(1/2)*erf((1/2)*x*sqrt(2)) = q2, x)        )        -        fsolve(1/2+(1/2)*erf((1/2)*x*sqrt(2)) = sqrt(q1), x)^2        -        fsolve(1/2+(1/2)*erf((1/2)*x*sqrt(2)) = sqrt(q2), x)^2     )   end proc:   evalf(Int(''z''(q1, q2), q1=0..1, q2=0..1)) end proc: J2();
 >

Can you help me fix this issue?

## An issue in composing functions...

Maple

Hi,

How can I get y=x in output (4) when  g is equal to f?

 > restart
 > f := x -> F(x)
 (1)
 > ((f@@(-1))@f)(x);
 (2)
 > # Let us assume that y is defined this way y := ((f@@(-1))@g)(x);
 (3)
 > # When g is identical to f I would like to get y=x 'y' = eval(y, g=f); 'y' = eval(y, g = (x -> f(x)))
 (4)
 >

## How can we force evalf[n] to apple to al...

Maple 2015

Here is an example where evalf[n] doesn't operate on the argument of the undefined function f.

```x := rand(0. .. 1.)()
0.2342493224
y := x+f(x):
evalf[4](y)
0.2342 + f(0.2342493224)

# but, as soon as f is a known function:
evalf[4](cos(x))
0.9727

```

Here is a way to force evalf[4](f(x)) to return f(0.2342)?

I found only two ways to do this:
First: declare interface(displayprecision=4)

```interface(displayprecision=4):
y;
0.2342 + f(0.2342)
```

Or: do this (which is relatively cumbersome)

```Evalf := proc(expr, n)
local i := [indets(evalf[n](expr), numeric)[]]:
eval(expr, i =~ evalf[4](i))
end proc:

Evalf(y, 4)
0.2342 + f(0.2342)
```