# Minimum value with two factors

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.

-
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. – 9599 Sep 15 '13 at 21:59
And space matters, x e == x*e but xe is just a symbol with name "xe" – ssch Sep 15 '13 at 22:10
I recommend this video: Mathematica Basics you'll want to check out the introduction part of this answer – ssch Sep 15 '13 at 22:19
@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. – 9599 Sep 15 '13 at 22:23
@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? – 9599 Sep 15 '13 at 22:40

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}]


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

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


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

-