# How is it possible to prevent separation of negative and positive exponents when symbolic simplifying?

As parts of my computations, I use InverseLaplaceTransform for some symbolic expressions. As an example, when I have the following transformation for sum of two similar expressions:

InverseLaplaceTransform[(b  E^-(b x)^n (b x)^(-1 + n))/ s + (b (b x)^(-1 + n))/s, s, t]


then, Mathematica simplifies and converts it into a form which the negative numeric exponent is separated from the symbolic part of exponent and is brought into the denominator as:

(E^-(b x)^n (1 + E^(b x)^n) (b x)^n)/x


and this becomes a challenge in next step, once evaluating the expression for some values of the parameters at x=0, which has become now the root of the denominator. I think this is not really related to the InverseLaplaceTransform, since similar results could also appear when using Simplify, for example, the following simplification:

Simplify[b (b x)^(-1 + n), n>1]


would also result in:

(b x)^n/x


Regarding that simplifying is necessary in my computations, is there a way to prevent only this type of simplification? I was thinking of using some options similar to those used in HoldForm, but I don’t know if it is possible and how to do it.

• I am not sure how to change the simplification. May be special rules are needed. But if I were you, I would just make separate function that handles x=0 case? Something like this r[x_]=InverseLaplaceTransform[(b E^-(b x)^n (b x)^(-1+n))/s+(b (b x)^(-1+n))/s,s,t]; r[x_/;x==0]:=0 (*or what ever*) now you can safetly do r[x] and it will not break. If x=0 then it will use the safe function, else it will use the main function.This is another way to do exception handling by making a function to handle the exceptions. – Nasser Feb 28 '18 at 5:58
• Generally, it’s a good idea, but as I said, this was a part of my computations I briefly presented here. I am also using other functions including successive differentiating as well in an iteration process, and just at the end of the iterations, I might evaluate the result at values assigned to the parameters. So, I could not hold the transformations uncalculated until this step to use the modification you proposed. @Naser – Hossein Feb 28 '18 at 6:51

Restricting the appearance of $x^{-1}$ with ComplexityFunction option in FullSimplify helps here:

invlapl = InverseLaplaceTransform[(b E^-(b x)^n (b x)^(-1 + n))/
s + (b (b x)^(-1 + n))/s, s, t];
f[e_] := LeafCount[e] + 100*Boole[ ! FreeQ[e, x^(-1)]]
FullSimplify[invlapl, ComplexityFunction -> f]


gives

$$b e^{-(b x)^n} \left(e^{(b x)^n}+1\right) (b x)^{n-1}.$$

Try the following simple approach. Here is your expression:

expr1 = (E^-(b x)^n (1 + E^(b x)^n) (b x)^n)/x


The way to remove x from the denominator and include it into the expression in the numerator is to apply PowerExpand:

expr2 = MapAt[PowerExpand, expr1, 4]

(*  b^n E^-(b x)^n (1 + E^(b x)^n) x^(-1 + n)  *)


However, if you want to protect some combination (say, (b x)^(-1 + n)) from further changes you may, of course use a command from the Hold group, but there is also a more simple and convenient way. You may simply rename this combination. For example, here I give it the name c:

 expr3 = expr2 /. x^(-1 + n) -> c/b^(-1 + n)

(*  b c E^-(b x)^n (1 + E^(b x)^n) *)


Now you may do any transformation you need, and AFTER that replace c back: c -> b^(-1 + n) x^(-1 + n).

Have fun!

• @Alexei although your proposition is very efficient and I really appreciate that, but it is still general, since the real position of x in my computations is not always 4 when using MapAt. Also, I wonder why PowerExpand is not merely adequate supposed that I don’t mind preserving other combination (as you considered), just like the following: PowerExpand[1/x E^(-b^n x^n) (x^n - 2 b x^n)] (* (E^(-b^n x^n) (x^n - 2 b x^n))/x *) while even using MapAt returns the same result: MapAt[PowerExpand, 1/x E^(-b^n x^n) (x^n - 2 b x^n), {{}}] – Hossein Feb 28 '18 at 12:25
• Please, note that since I have a long and complicated expression which is obtained through successive transformations and differentiation, it would not be easy for me to predict the exact form of the final expression, so I had to provide some very short parts of my computations in order to be able to discuss more convenient. – Hossein Feb 28 '18 at 12:28
• @ Hossein I think that if you want to transform it, you need to each time feed MapAt with the tree coordinate of the expression to which you need to apply PowerExpand. Otherwise it does not work. – Alexei Boulbitch Mar 5 '18 at 9:45
{"ft_lang_label":"__label__en","ft_lang_prob":0.84926796,"math_prob":0.97989964,"size":1543,"snap":"2019-35-2019-39","text_gpt3_token_len":423,"char_repetition_ratio":0.11111111,"word_repetition_ratio":0.0,"special_character_ratio":0.27284512,"punctuation_ratio":0.09968847,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.99855906,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2019-09-20T15:22:12Z\",\"WARC-Record-ID\":\"<urn:uuid:5680c0c6-31ea-4457-99e2-3ca31d6dd98c>\",\"Content-Length\":\"149787\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:79c22a6d-03dd-4c52-9fb2-9ff5aa603606>\",\"WARC-Concurrent-To\":\"<urn:uuid:ce4368c1-6d02-4551-88e3-eb0c7af4aaf7>\",\"WARC-IP-Address\":\"151.101.193.69\",\"WARC-Target-URI\":\"https://mathematica.stackexchange.com/questions/166800/how-is-it-possible-to-prevent-separation-of-negative-and-positive-exponents-when\",\"WARC-Payload-Digest\":\"sha1:Z5EOOTAV6RRMBQQCXK4FKXELXFC5DBWE\",\"WARC-Block-Digest\":\"sha1:4ZD6V77PZKNGE7WPOWBQPKSPE46NE3HQ\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2019/CC-MAIN-2019-39/CC-MAIN-2019-39_segments_1568514574039.24_warc_CC-MAIN-20190920134548-20190920160548-00378.warc.gz\"}"}