# HP Forums

Full Version: CAS: Hyperbolic Functions, assume (Beta)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I am testing integrals. I don't notice any simplification when it comes to hyperbolic functions.

Example:
(e^x - e^-x)/2 doesn't simplify to sinh(x)

Just want to confirm whether CAS on the HP Prime hasn't implement algebraic rewriting commands with hyperbolic functions.

Why doesn't assume work when we want to use "not equals", example a <> 3 (a is not equals to 3)?

Other than this, I have not notice any behavior with Beta software so far.
There is no command to convert to hyperbolic function, because it's not useful in a CAS.

CAS are considering parameters like polynomials, they always assume generic value, that's the reason why assuming something like a!=0 would not do anything. The reason is that otherwise it would lead to combinatorical explosions in complexity.
There are codes especially in electronic and electrical engineering that are needed to expand a trigonometric function in exponential functions and vice versa

At least some functions dedicated to the rewriting of hyperbolic expressions would be very useful for programmers.
You can convert yourself like this:
subst(exp(x)+exp(-x),exp,cosh+sinh)
(11-06-2019 08:29 PM)parisse Wrote: [ -> ]You can convert yourself like this:
subst(exp(x)+exp(-x),exp,cosh+sinh)

It would be useful if the cas handled such cases using simplify

eg
Code:
``` simplify(i*e^((−i)*th)+(−i)*e^(i*th))/2```

Gives result
Code:
``` (i*e^((−i)*th)+(−i)*e^(i*th))/2```

Rather than the anticipated result sin(th)
One would have to create a lot of manual subst to workaround all the trig exp forms

And this integral
Code:
``` 10/(√(2*π))*int(e^((-(I))*w*t),t,(-tt)/2,tt/2)```

gives result
Code:
``` (5*i*√(2*π)*e^((−i)*tt*w/2)+(-5*i)*√(2*π)*e^(i*tt*w/2))/(π*w)```
But it would be clearer to the user if the result simplified to the equivalent sinc() function
Just found that
Code:
``` simplify(sincos((i*e^((-(i))*th)+(-(i))*e^(i*th))/2))```

Gives the much nicer result
Code:
``` sin(th)```

And
Code:
``` simplify(sincos((5*i*√(2*π)*e^((-(i))*tt*w/2)-5*i*√(2*π)*e^(i*tt*w/2))/(π*w)))```
Gives
Code:
``` 10*√(2*π)*sin(tt*w/2)/(π*w)```

So it would be handy if the cas had an option to return complex exp results in sincos form, so that simplify could do the above automatically
(12-09-2019 08:25 AM)Stevetuc Wrote: [ -> ]Just found that
Code:
``` simplify(sincos((i*e^((-(i))*th)+(-(i))*e^(i*th))/2))```

Gives the much nicer result
Code:
``` sin(th)```

And
Code:
``` simplify(sincos((5*i*√(2*π)*e^((-(i))*tt*w/2)-5*i*√(2*π)*e^(i*tt*w/2))/(π*w)))```
Gives
Code:
``` 10*√(2*π)*sin(tt*w/2)/(π*w)```

So it would be handy if the cas had an option to return complex exp results in sincos form, so that simplify could do the above automatically

Assign 'sincos' into a [key] in the User mode
Quote:='CyberAngel' pid='124776' dateline='1575883660'
Assign 'sincos' into a key in the User mode

Im using the function on cas command line
Code:
```#cas ss(x):=(subst(x,exp,cosh+sinh));simplify(sincos(x)) #end```

It use a substitution for real exp and sincos function for complex exp

Code:
```ss((e^x-e^(-x))/2) Gives sinh(x)```
And
Code:
```ss(1/2*((-(i))*e^(i*x)+i*e^((-(i))*x))) Gives sin(x)```
Simplification set to maximum
Still, it would be better built in.
Sometimes you will want exponential form, sometimes trigonometric form. That's the reason why you have commands to rewrite an expression...
Reference URL's
• HP Forums: https://www.hpmuseum.org/forum/index.php
• :