Question: How to plot a function defined using Maximize?

How do I plot the output of the Maximize command?

For example, here's a function that determines the value of x in the range [0,3] at which a particular fuction is maximized:

with(Optimization);

f := (x,t) -> -x^2+3*t*x-1

fmax := t -> rhs(Maximize(f(x,t),x=0..3)[2][1]);

Typing "fmin(1)" returns the correct result, 1.5, and I can calculate fmin for any value of t I want. However, I can't plot the function fmin. When I try, using "plot((fmax(t)),t=0..1);", I get the error message "Problem appears to be unbounded".

What do I need to do to get this to work the way I want?

Thanks a lot.

 

Please Wait...