1
$\begingroup$

Approximate the minimum value of $2e^{x-2}-6x+xe^{x-2}$.

Is my input correct? If not can you please correct it?

                In: MinValue[2 E^(x-2)-6 x+x E^(x-2), x]

I also read that you can find this answer by writing a program to to take the derivative to find this answer. Is this how you do it?

                    In[1]: f[x]= MinValue[2 E^[x-2]-6 x+x E^[x-2]

then it would give you the out[1].

Then you would do this:

                  In[2]:f'[x]

then it would give you out[2].

This is what I know. Can you please help me with the rest? I am trying to learn this by myself and it would be nice if you could help. I also did some research and this is what I came up with.

$\endgroup$
6
  • $\begingroup$ Yes I did some research. I saw that we can take the MinValue of this question. I also read that you can take the derivative. I will write that part for you to show you that I did it. I do not have mathematica though. e is the Euler constant. I am also learning this by myself through reading some resources. $\endgroup$
    – 9599
    Commented Sep 15, 2013 at 21:59
  • $\begingroup$ And space matters, x e == x*e but xe is just a symbol with name "xe" $\endgroup$
    – ssch
    Commented Sep 15, 2013 at 22:10
  • $\begingroup$ I recommend this video: Mathematica Basics you'll want to check out the introduction part of this answer $\endgroup$
    – ssch
    Commented Sep 15, 2013 at 22:19
  • $\begingroup$ @Kuba I meant I did not have it with me at the time. I do now. I did some research for this problem. That is how I knew about the second question. $\endgroup$
    – 9599
    Commented Sep 15, 2013 at 22:23
  • $\begingroup$ @ssch Thanks that is where I went to first. That is how I got some of my information. I wanted to know if what I am doing is correct though. Is it possible to get some help here? $\endgroup$
    – 9599
    Commented Sep 15, 2013 at 22:40

1 Answer 1

1
$\begingroup$

If you want to find the minimum value of a function, a good way is to plot it and see. For instance:

f[x_] := 2 E^(x - 2) - 6 x + x E^(x - 2)

defines your function (note you had a couple of minor syntax issues). Then plot:

Plot[f[x], {x, -10, 10}]

enter image description here

You can see the minimum occurs somewhere near 2, so plot just this region:

Plot[f[x], {x, 1, 3}]

enter image description here

Now you can make a pretty good estimate of where the min occurs and what its value is. Of course, you could keep zooming in to get better answers.

If you prefer working with calculus, the procedure is to take the derivative and set it equal to zero. This can be done:

Solve[D[f[x], x] == 0, x] // N

which gives

{{x -> 2.15231}}

in rough agreement with the picture above. The steps in the above line of code are:

(1) take the derivative of the function: D[f[x], x]

(2) set that equal to zero: D[f[x], x] == 0

(3) solve for the value of x where the derivative is zero: Solve[D[f[x], x] == 0, x]

(4) express the answer as a number (instead of having E remaining): //N

$\endgroup$
0

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.