I have the following function ($\theta$ is a parameter with known value, e.g. $\theta=1$): $$ f:=\frac{xy}{1+\theta (1-x)(1-y)} $$ and I want to maximize its second-order partial derivative in Maple for $x,y\in [0,1]$. My code was as follows:
$$ fxy:=\frac{\partial^2}{\partial x \partial y}f $$
I use "maximize()" as follows, but it gives me the wrong answer:
Optimization:-Maximize(fxy, x = 0 .. 1, y = 0 .. 1)
I would appreciate it if anyone could help me.
Note that Maple's
Optimizationpackage offers only local solvers for nonconvex multivariate problems. So the initial point can matter.Forcing a more fortuitous initial point, or another method, can help. Eg,
Unfortunately, with this particular choice of range the default method appears to be returning a saddle point (likely using an initial point of
[0.5,0.5]).Using a global solver can make this easier. Below I'll use the 3rd party add-on
DirectSearchpackage.In recent Maple versions (eg, Maple 2017 and newer) you can install that add-on package directly from Maple itself, via the MapleCloud sign-in (top right of the main menu icon bar). Or by downloading from its site on the MapleCloud.
In version Maple 2016, etc, the
DirectSearch ver.2package can still be downloaded for installation from the Application Center.