1
$\begingroup$

For $\frac{2 e^4}{e^8+1}$ function ExpToTrig returns

(* (2 (Cosh[4] + Sinh[4]))/(1 + Cosh[8] + Sinh[8]) *)

which is correct, but if I use Simplify/FullSimplify, I'll receive input value $\frac{2 e^4}{e^8+1}$ instead of obvious $\frac{1}{\cosh (4)}$ or $sech (4)$. However, It works perfectly with $\frac{e^8+1}{2 e^4}$

(* Cosh[4] *)
$\endgroup$
  • $\begingroup$ The brute force workaround is 2 E^4/(E^8 + 1) // (1/# &) // FullSimplify // (1/# &) $\endgroup$ – Bob Hanlon May 7 '17 at 12:29
  • $\begingroup$ Your solution is good, but needs generalization, because it won't work if you add one or more terms, for example x + 2 E^4/(E^8 + 1) // (1/# &) // FullSimplify // (1/# &) $\endgroup$ – xhF731 May 7 '17 at 12:49
  • $\begingroup$ Please don't add bugs tag to the question until the community/WRI has confirmed it. $\endgroup$ – xzczd May 7 '17 at 12:53
  • $\begingroup$ OK, sorry for that. $\endgroup$ – xhF731 May 7 '17 at 12:55
1
$\begingroup$
simplify[expr_] := 1/FullSimplify[1/expr]

expr1 = 2 E^4/(E^8 + 1);

expr1 // simplify

(*  Sech[4]  *)

expr2 = a + expr1;

simplify /@ expr2

(*  a + Sech[4]  *)
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.