# exponential equation real solution

How can I solve the equation
exp(2*x)+exp(-2*x)==2

to get only the real solution x==0 ?

Thanks for help.

exponential equation real solution

How can I solve the equation
exp(2*x)+exp(-2*x)==2

to get only the real solution x==0 ?

Thanks for help.

0

Well, my answer doesn't use Sage, but: your equation is equivalent to cosh(2x) == 1. The hyperbolic cosine function (cosh) has a global minimum at 0, so there's only one real solution: zero.

Other things that can help you figure this out: plot exp(2x) + exp(-2x) and see what it looks like. Show that the derivative is positive for all positive x, and negative for all negative x, and use that to prove that the function has a global minimum at 0, so that the original equation can only have one solution.

0

I don't see a built-in method for this, but you could solve the equation which makes the imaginary part of the general solution zero:

```
sage: solutions = (exp(-2*x)+exp(2*x) == 2).solve(x,to_poly_solve=True)
sage: eq1 = solutions[0]
sage: eq1
x == I*pi*z29
sage: rhs = eq1.right()
sage: rhs
I*pi*z29
sage: rhs.imag()
pi*real_part(z29)
sage: rhs.variables()
(z29,)
sage: (rhs.imag() == 0).solve(var)
[z29 == 0]
```

This gives the value of `z29`

which makes the imaginary part zero; so now substitute this value into the original equation, `eq1`

:

```
sage: solutions_2 = (rhs.imag() == 0).solve(var)
sage: eq2 = solutions_2[0]
sage: eq1
x == I*pi*z29
sage: eq2
z29 == 0
sage: eq1.substitute(eq2)
x == 0
```

This should work for any equation you start with; you could wrap this in a function if you need to call it repeatedly (if you do that, make sure to check that there is only one solution in `solutions`

and `solutions_2`

, otherwise you'll want to use those equations too).

Please start posting anonymously - your entry will be published after you log in or create a new account.

Asked: ** 2010-10-03 06:24:29 +0200 **

Seen: **2,678 times**

Last updated: **Oct 07 '10**

Using the solution of equation

check if the result is a real number

Issues with: Solving a polynomial equation with multiple variables

SAGETEX: Howto compute solution of a function

Numerical real solution of derivative

How to get all (numerical) solutions of an equation?

Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.

amalea: I notice there is some italic formatting in your question. Does it display as you intend? The askbot software will be updated soon by Evgeny to fix "escaping" issues that result in formatting problems.

For the record, this question is closely related to http://ask.sagemath.org/question/155/exponential-equation