## evalc and simplify...

1. There is this weird bug:

```evalc(Re((Re(z)+I*Im(z))^2)) assuming z::complex;
2
z
```

which looks like the assumption got lost somewhere along the way.

2. simplify and evalc can't automatically handle these:

```simplify(z-Re(z)-I*Im(z));
z - Re(z) - I Im(z)

evalc(z-Re(z)-I*Im(z)) assuming z::complex;
z - Re(z) - I Im(z)

simplify(Re(z)^2+Im(z)^2-abs(z)^2);
2        2      2
Re(z)  + Im(z)  - |z|

evalc(Re(z)^2+Im(z)^2-abs(z)^2) assuming z::complex;
2        2      2
Re(z)  + Im(z)  - |z|
```

One way to make it work is to do subs(z=Re(z)+I*Im(z),...) and then pass it to evalc. But see point 1. Another way that sometimes work is convert(...,abs).

Side note on convert: convert(...,Re) allows Im as well as Re. I think that's not very useful: typically the point of convert is that I want to get rid of other functions.

3. evalc tends to leave functions of complex argument unexpanded:

```evalc(conjugate(sin(z))) assuming z::complex;
/_\
sin\z/
```

The real and imaginary parts aren't separated. Again, one way to make it work is this:

```evalc(conjugate(sin(Re(z)+I*Im(z)))) assuming z::complex;
sin(Re(z)) cosh(Im(z)) - I cos(Re(z)) sinh(Im(z))
```

But see point 1. Also, using just Re(z) and Im(z) won't always give the simplest form.

In fact, even for Re(sin(z)), which is technically already the real part, I'd say it's not very useful for evalc to just give back Re(sin(z)). sin(Re(z))*cosh(Im(z)) is a more useful output, with functions applied only to real quantities.

Using x+I*y instead of z won't help with the simplify examples, but evalc seems to work fine when all variables are assumed to be real.

## Simplification of Expression...

Why does

5103*`&Omega;`*(5*sqrt(7)+16)/((1+2*sqrt(7))^(3/2)*(7+2*sqrt(7))*(-2+sqrt(7))*(14+sqrt(7))*(2*sqrt(7)-1)*(4+sqrt(7)))

not simplify to

sqrt(1+2*sqrt(7))*`&Omega;`

???

## MeijerG simplifications and numerics...

It seems that simplify uses some transformations that aren't generically valid, and evalf relies on those transformations too:

```nint := (fz, zrng) -> evalf(add(
int(fz, op(1, zrng) = op([2, i], zrng) .. op([2, i+1], zrng)),
i = 1 .. nops(op(2, zrng))-1));
```
```f1 := z -> MeijerG([[1/2], []], [[], []], z);

simplify(f1(z));
sqrt(1/z) exp(-1/z)

evalf(f1(-1));
-9
-1.672586379 10   + 2.718281828 I

f1(-1.);
-9
-1.672586379 10   - 2.718281828 I

nint(GAMMA(1/2+y)*(-1)^y, y = [-infinity-I, -I, I, -infinity+I])/(2*Pi*I);
-11
6.652676619 10    - 2.718281828 I
```

So it seems that evalf uses the simplified form, but that form doesn't agree with the definition of MeijerG for negative z. The form that does would be 1/sqrt(z)*exp(-1/z).

```f2 := z -> MeijerG([[], [1]], [[0, 2], []], z);

simplify(f2(z));
exp(-z) z + exp(-z) - 1

evalf(f2(1));
-0.2642411177

f2(1.);
0.7357588823

nint(GAMMA(-y)*GAMMA(2-y)/GAMMA(1-y), y = [infinity-I, -1-I, -1+I, infinity+I])/(2*Pi*I);
0.7357588823 - 0. I
```

The result of simplify is off by -1. Just evaluating f2(1) doesn't use that transformation rule, but evalf apparently does.

## further simplication...

I have gotten an expression:

eq21 := collect(eq20, [exp(-sqrt(s)*x/sqrt(Dp)), exp(sqrt(s)*(-lh+x)/sqrt(Dp)), exp((-2*lh+x)*sqrt(s)/sqrt(Dp)), exp((lh-x)*sqrt(s+thetac)/sqrt(Dc))], simplify);

q(x, s) = exp(-sqrt(s)*x/sqrt(Dp))*_F1(s)+sqrt(Dp)*(-Dp*sqrt(s+thetac)*alpha1*pinf*s^2-2*Dp*sqrt(s+thetac)*alpha1*pinf*s*thetac-Dp*sqrt(s+thetac)*alpha1*pinf*thetac^2+A2*Dp*sqrt(s+thetac)*alpha1*s+A2*Dp*sqrt(s+thetac)*alpha1*thetac+Dc*sqrt(s+thetac)*alpha1*pinf*s^2+Dc*sqrt(s+thetac)*alpha1*pinf*s*thetac+A1*Dc*alpha1*s^2+A1*Dc*alpha1*s*thetac+A1*sqrt(Dc)*sqrt(s+thetac)*s^2+A1*sqrt(Dc)*sqrt(s+thetac)*s*thetac-A2*Dc*sqrt(s+thetac)*alpha1*s)*exp(sqrt(s)*(-lh+x)/sqrt(Dp))/((s+thetac)^(3/2)*(-sqrt(Dp)*alpha1+sqrt(s))*s*(Dc*s-Dp*s-Dp*thetac))+(sqrt(Dp)*alpha1+sqrt(s))*_F1(s)*exp((-2*lh+x)*sqrt(s)/sqrt(Dp))/(-sqrt(Dp)*alpha1+sqrt(s))+Dc*A1*exp((lh-x)*sqrt(s+thetac)/sqrt(Dc))/((Dc*s-Dp*s-Dp*thetac)*sqrt(s+thetac))-(-pinf*s-pinf*thetac+A2)/((s+thetac)*s)

I need to further simplify the coefficient of

exp(sqrt(s)*(-lh+x)/sqrt(Dp))

Would you like to give some tips?

Thanks.

## How to simplify an expression...

In this expression,

q(x, s) = -(-(-thetac*s^(3/2)-s^(5/2)+(s^2+s*thetac)*alpha1*sqrt(Dp))*Dc*A1*exp((lh-x)*sqrt(s+thetac)/sqrt(Dc))+((alpha1*(s+thetac)*(-pinf*s-pinf*thetac+A2)*Dp^(3/2)+s*sqrt(Dp)*(A1*(s+thetac)*sqrt(Dc)-Dc*alpha1*(-pinf*s-pinf*thetac+A2)))*sqrt(s+thetac)+A1*sqrt(Dp)*s*Dc*alpha1*(s+thetac))*exp(sqrt(s)*(-lh+x)/sqrt(Dp))-(-_F1(s)*(-s*alpha1*(s+thetac)^2*Dp^(3/2)-s^(3/2)*Dp*thetac^2+thetac*(Dc-2*Dp)*s^(5/2)+(Dc-Dp)*s^(7/2)+sqrt(Dp)*s^2*Dc*alpha1*(s+thetac))*exp((-2*lh+x)*sqrt(s)/sqrt(Dp))+_F1(s)*(-s*alpha1*(s+thetac)^2*Dp^(3/2)-thetac*(Dc-2*Dp)*s^(5/2)+(-Dc+Dp)*s^(7/2)+s^(3/2)*Dp*thetac^2+sqrt(Dp)*s^2*Dc*alpha1*(s+thetac))*exp(-sqrt(s)*x/sqrt(Dp))+alpha1*(s+thetac)*(-pinf*s-pinf*thetac+A2)*Dp^(3/2)+(-pinf*(Dc-2*Dp)*thetac+A2*(Dc-Dp))*s^(3/2)-pinf*(Dc-Dp)*s^(5/2)-s*alpha1*Dc*(-pinf*s-pinf*thetac+A2)*sqrt(Dp)-sqrt(s)*Dp*thetac*(-pinf*thetac+A2))*sqrt(s+thetac))/((s+thetac)^(3/2)*s*((Dc-Dp)*s-Dp*thetac)*(sqrt(Dp)*alpha1-sqrt(s)))

I want to simplify the coeffcients of

exp((lh-x)*sqrt(s+thetac)/sqrt(Dc)), exp(sqrt(s)*(-lh+x)/sqrt(Dp)), exp((-2*lh+x)*sqrt(s)/sqrt(Dp)), exp(-sqrt(s)*x/sqrt(Dp)).

## How to convert arctan to arcsin?...

I am stumped with this trivial puzzle.  Let
z := arctan(x/sqrt(a^2-x^2));

How do we simplify z to.

I tried all sorts of tricks with simplify(...) and convert(...), with assumptions, but did not get anywhere.  Any clues?

Versions: Maple 2016 and 2017.

## How to simplify this solution?...

```restart;
sol:=dsolve(diff(y(x),x)= x/(sqrt(x^2-16))*1/(2*y(x)),y(x));
```

Gives

But the solution can also be written as

I just do not know how to transform the first solution to the second simpler one. I tried:

```sol:=map(x->rhs(x),[sol]);
```

The simpler solution can be found as follows

```restart;
sol:=dsolve(diff(y(x),x)= x/(sqrt(x^2-16))*1/(2*y(x)),y(x),'implicit');
```

But the term in the middle above is

Therefore the solution is really

```eq:=y(x)^2-sqrt(x^2-16)-_C1 = 0;
solve(eq,y(x));```

Which gives

What command to simplify the long solution to the shorter one obtained from the implicit?

## How do I collect on specific variables?...

I'm new of Mapel trying to get basics.

How do I collect on the square terms in the numerator?

## expand without simplify...

hi:

i'm using expand cmd, but surprisingly, not only execute the expand but execute simplify cmd. Is there any cmd only execute expand withoud simplify?

Best wishes,

from China

## Why simplify deteriorate my integral equations?...

I did change of variables as below:

 >
 >
 >
 >
 >
 >
 >
 (1)
 >
 (2)
 >
 >

But I amezed when I use simplify command deteriorate my eq.

Why?

## Check if simplified...

Hi all,

I am looking for a boolean logic check to see if a rational expression is simplified.

For example: x/x^2  =  1/x  I want something along the lines of issimplified(x/x^2)=FALSE

Similarily, (x^2-x-12)/(x-4) = x+3  so I would like some logic test to say (x^2-x-12)/(x-4) is NOT simplified.

Mark

## simplification example...

I am curious whether anyone here can come up with a way to simplify the expression x1 to 15*Pi/32 in fewer exact, symbolic steps. The following was performed in Maple 2016.2 for Linux.

 > restart;
 > x1 := arcsin(1/2*(2+(2+(2+2^(1/2))^(1/2))^(1/2))^(1/2));

 > x2 := evalc(convert(x1,expln));

 > x3 := convert(x2, expln);

 > # non-Pro wolframalpha can simplify x3 to 15*Pi/32 (but not x2 or x1). #
 > x4 := combine(x3);

 > x5 := simplify(x4);

 > x6 := expand(x5);

 > x7 := combine(x6);

 > simplify(x7,constant);

 > # It's a pity that last step worked while this next is inadequate. simplify(x7);

 > # Another way, using x7 simplify(evalc(x7));

 > # Another way, using x7 simplify(combine(expand(x7)));

 >

## Simplified form of equation/function ...

I am new user of Maple, couldn’t find solution for my problem in the last two days therefore I would like to turn to your community with my question. I am trying to replicate the calculations from a study to be sure about my understanding of the topic.

I cannot simplify the final equation even though the variables with their values are given. A screenshot and the file are attached, that might make easier to understand my problem.

I know what the solution should be. I cannot simplify/replace the values in the equation to get a simpler form; [(D0 - d1c - R)/ 2d1)]+c

Thank you if you have the time to help.

Joint_Pricing_Sol_.maple

## Simplify denominator with roots...

Dear all,

I have the following problem: Maple does not simplify the denominator in the following example:

which gives

16*a^8*B/((dz*L*sqrt(s)*sqrt(s+c)*sqrt(L^2*s*(s+c)*dz^2+4*a^2)+L^2*s*(s+c)*dz^2+2*a^2)^2*(-dz*L*sqrt(s)*sqrt(s+c)*sqrt(L^2*s*(s+c)*dz^2+4*a^2)+L^2*s*(s+c)*dz^2+2*a^2)^2)

However, the result should be B. If only the denomiator is expanded it works:

gives

16*a^8

which equals the nominator except for the B...

How can I use simplify in order to yield the desired result?

Thanks a lot!

## why simplify command doesn't work for Ei function?...

if I use the command below, I will get the right answer.

`assuming`([simplify((2*I)*deltas*Pi*BW*Ei(1, (2*I)*deltas*Pi*BW)-(2*I)*deltas*Pi*BW*Ei(1, -(2*I)*deltas*Pi*BW))], [real, BW > 0, deltas > 0, ts > 0, deltas <= ts, 2*BW*ts >= 1])

2*BW*Pi*deltas*(Pi-2*Si(2*BW*Pi*deltas))

while I use the same command for the compliacated Ei function, it doesn't work any more, I don't know the reason.

`assuming`([simplify(Ei(1, I*BW*Pi*deltas-(5*I)*BW*Pi*ts)-Ei(1, -I*BW*Pi*deltas+(5*I)*BW*Pi*ts), Ei)], [real, BW > 0, deltas > 0, ts > 0, deltas <= ts, 2*BW*ts >= 1])

and it's reault is :

Ei(1,I*BW*Pi*deltas-5*I*BW*Pi*ts)-Ei(1,-I*BW*Pi*deltas+5*I*BW*Pi*ts)

 1 2 3 4 5 6 7 Last Page 1 of 16
﻿