Plotting a sum of 2 exponentials looks like... well nothing

1.3k Views Asked by At

I have been trying to plot a sum of 2 exponentials where one has positive and the other a negative exponent. I tried to plot this function:

$$ f(x) = 30e^{2x} + 3e^{-2x} $$

And i get nothing here while WolframAlpha wont even draw this! Could anyone try in mathematica and post a good image here. Is it possible that exponential functions destroy one another?


EDIT:

I tried plotting this in gnuplot by using a script and nothing was drawn. Weird.

set terminal epslatex color colortext size 9cm,5cm
set size 1.5,1.0
set output "tuneliranje_1.tex"

set style line 1 linetype 1 linewidth 3 linecolor rgb "#FF0055"
set style line 2 linetype 2 linewidth 1 linecolor rgb "#FF0055"
set style line 3 linetype 1 linewidth 3 linecolor rgb "#2C397D"
set style line 4 linetype 2 linewidth 1 linecolor rgb "#2C397D"
set style line 5 linetype 1 linewidth 3 linecolor rgb "#793715"
set style line 6 linetype 2 linewidth 1 linecolor rgb "#793715"
set style line 7 linetype 1 linewidth 3 linecolor rgb "#b1b1b1"
set style line 8 linetype 3 linewidth 1 linecolor rgb "#b1b1b1"

set grid

set samples 1000

set key at graph 1, 1.0
set key samplen 2
set key spacing 2

f(x)=30*exp(2*x)+3*exp(-2*x)

set xtics ("$0$" 0)
set ytics ("$0$" 0)

set xrange [-4:4]
set yrange [-0.5:3]

plot f(x) ls 1 title "$f(x)=30 e^{2x}+3e^{-2x}$"
4

There are 4 best solutions below

4
On BEST ANSWER

It is not possible that $30e^{2x}$ and $3e^{-2x}$ cancel out, since they are both positive everywhere on $\Bbb R$.

Here are a couple plots made with gnuplot for $x$ in $[-3,2]$ and $[-11,10]$ respectively

$\hskip 1 in$plot between -3 and 2

$\hskip 1 in$plot between -11 and 10

Edit: To plot, say, the second figure, and save the output to a png file, just open gnuplot in a terminal and type

 set terminal png
 set output '/path/to/output.png'
 plot [-11:10] 30*exp(2*x)+3*exp(-2*x)
0
On

It is parameterised form of the function $f(t)=30t+\frac{3}{t}$ for $t>0$.

0
On

For $|x|$ large, one or the other of the two functions will be very close to zero. Here is the syntax to get a representative plot in Wolfram Alpha: plot 30*exp(2*x)+3*exp(-2*x) from -3 to 2.

0
On

I am not sure exactly what is going wrong with your function, but you may be interested in the very similar and closely-related graph of the function defined by $$\cosh(x)=\frac{1}{2}(e^x+e^{-x}).$$ This is known as hyperbolic cosine (see here for more info), and you can see the graph here.