1
$\begingroup$

I would like to do, in every calculation that I perform, the following substitution:

$e^x -> (1+x)$.

That is, every term with an exponential should become the Taylor series to the first-order evaluated at zero ($e^{f(x)} = 1+f`(0) x$). Surely my attempt was to try:

$e^x = (1+x)$

however it returns me that it is Protected.

I must address that I make several calculations and this term may appear in several different contexts. As examples:

$e^{2(x+y)}$ and this should return $(1+2x)e^{2y}$;

or

$e^{-x}-1$ which should become $-x$.

Is it possible to generalize this to any function following a structure, like: every exponential following a $\delta$ will be simplified, but the ones without it will not. As an example:

$e^{2(x+\delta x) + y-3\delta c} = (1+2\delta x) (1-3\delta c) e^{2x+y}$.

$\endgroup$
3
  • 1
    $\begingroup$ Exp[expr] /. {Exp[x_] :> 1 + x} will not do what you want but Exp[expr] /. {Exp[ xpr_] :> (1 + D[xpr, x] x)*(Exp[xpr /. {x :> 0}])} comes closer. $\endgroup$
    – Alan
    Commented Sep 23, 2019 at 21:17
  • $\begingroup$ Generally substitutions work better if they involve a variable rather than an expression. Try the inverse of your expression, x->Log[1+x]. You will probably still need to make some simplifications afterword. $\endgroup$
    – Bill Watts
    Commented Sep 23, 2019 at 22:21
  • $\begingroup$ You can introduce an additional parameter in the exponents and perform a series expansion with respect to it: $e^xe^{2(x+y)}\rightarrow e^{\alpha x}e^{2\alpha x+2y}$ $\endgroup$
    – yarchik
    Commented Sep 24, 2019 at 7:23

1 Answer 1

1
$\begingroup$

One way to do it.

erule[a_] = {a -> Log[1 + a]}

expr = Exp[-x] - 1

Series[expr /. erule[x], {x, 0, 1}] // Normal
(*-x*)

expr = Exp[2 (x + y)]

Series[expr /. erule[x], {x, 0, 1}] // Normal // Simplify
(*(2 x + 1) E^(2 y)*)

expr = E^(2 (x + δx) + y - 3 δc)

Series[expr /. erule[δx] /. erule[δc], {δx, 0, 1}, {δc, 0, 1}] // Normal // Simplify
(*(3 δc - 1) (2 δx + 1) (-E^(2 x + y))*)

While this method is not automated, it does work, at least for these examples.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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