 LagrangeMultipliers - Maple Help

# Online Help

###### All Products    Maple    MapleSim

Home : Support : Online Help : Education : Student Packages : Multivariate Calculus : Visualization : Student/MultivariateCalculus/LagrangeMultipliers

Student[MultivariateCalculus]

 LagrangeMultipliers
 solve types of optimization problems using the method of Lagrange multipliers Calling Sequence LagrangeMultipliers(f(x,y,..), [g(x,y,..), h(x,y,..),..], [x,y,..], opts) Parameters

 f(x, y, ..) - algebraic expression; objective function [g(x, y, ..), h(x, y, ..), ..] - algebraic expression; constraint functions, assumed equal to 0 [x, y, ..] - list of names; independent variables opts - (optional) equation(s) of the form option=value where option is one of constraintoptions, levelcurveoptions, pointoptions, output, showconstraints, showlevelcurves, showpoints, or view; output options Description

 • The LagrangeMultipliers command returns the local minima, maxima, or saddle points of the objective function f subject to the conditions imposed by the constraints, using the method of Lagrange multipliers. The output option can also be used to obtain a detailed list of the critical points, Lagrange multipliers, and function values, or the plot showing the objective function, the constraints, the solution points, and the level curves of the objective function through those solution points.
 • The output=plot option is only available for functions of 2 variables.
 • The opts argument can contain any of the following equations that set output options.
 constraintoptions = list
 Specifies the plot options for plotting the constraint functions. For more information on plotting options, see plot/options.
 levelcurveoptions = list
 Specifies the plot options for plotting the level curves of where the (constrained) extrema are located. For more information on plotting options, see plot/options.
 pointoptions = list
 Specifies the plot options for plotting the extrema. For more information on plotting options, see plot/options.
 output = value, detailed, or plot
 This option controls the return value of the function.
 * output = value specifies that the minimum and maximum points are returned. Plot options are ignored if output = value. The default is output = value.
 * output = detailed specifies that the minimum and maximum points, the Lagrange multipliers, and the function values at the critical points are returned. Plot options are ignored if output = detailed.
 * output = plot specifies that a plot displays, which shows the function and the points.
 showconstraints = true or false
 Determines whether the constraint functions are plotted. The default is true.
 showlevelcurves = true or false
 Determines whether the level curves are plotted. The default is true.
 showpoints = true or false
 Determines whether the points are plotted. The default is true.
 view = [realcons..realcons, realcons..realcons, realcons..realcons]
 Specifies the plot view.
 caption = anything
 A caption for the plot.
 The default caption is constructed from the parameters and the command options. caption = "" disables the default caption. For more information about specifying a caption, see plot/typesetting. For more information, see plot/options.
 • For information on changing the default colors, see the Student[SetColors] help page. Examples

 > $\mathrm{with}\left(\mathrm{Student}\left[\mathrm{MultivariateCalculus}\right]\right):$
 > $\mathrm{LagrangeMultipliers}\left(xy,\left[\frac{{x}^{2}}{8}+\frac{{y}^{2}}{2}-1\right],\left[x,y\right]\right)$
 $\left[{2}{,}{1}\right]{,}\left[{2}{,}{-1}\right]{,}\left[{-2}{,}{1}\right]{,}\left[{-2}{,}{-1}\right]$ (1)

The LagrangeMultipliers command can also handle symbolic parameters in the objective function or in the constraints:

 > $\mathrm{LagrangeMultipliers}\left(yx,\left[-{r}^{2}+{x}^{2}+{y}^{2}\right],\left[x,y\right]\right)$
 $\left[\frac{\sqrt{{2}}{}{r}}{{2}}{,}{-}\frac{\sqrt{{2}}{}{r}}{{2}}\right]{,}\left[{-}\frac{\sqrt{{2}}{}{r}}{{2}}{,}\frac{\sqrt{{2}}{}{r}}{{2}}\right]{,}\left[\frac{\sqrt{{2}}{}{r}}{{2}}{,}\frac{\sqrt{{2}}{}{r}}{{2}}\right]{,}\left[{-}\frac{\sqrt{{2}}{}{r}}{{2}}{,}{-}\frac{\sqrt{{2}}{}{r}}{{2}}\right]$ (2)
 > $\mathrm{LagrangeMultipliers}\left(\frac{y}{{x}^{2}+{a}^{2}},\left[-{r}^{2}+{x}^{2}+{y}^{2}\right],\left[x,y\right]\right)$
 $\left[{0}{,}{-}{r}\right]{,}\left[{0}{,}{r}\right]{,}\left[\sqrt{{{a}}^{{2}}{+}{2}{}{{r}}^{{2}}}{,}\sqrt{{-}{{a}}^{{2}}{-}{{r}}^{{2}}}\right]{,}\left[\sqrt{{{a}}^{{2}}{+}{2}{}{{r}}^{{2}}}{,}{-}\sqrt{{-}{{a}}^{{2}}{-}{{r}}^{{2}}}\right]{,}\left[{-}\sqrt{{{a}}^{{2}}{+}{2}{}{{r}}^{{2}}}{,}\sqrt{{-}{{a}}^{{2}}{-}{{r}}^{{2}}}\right]{,}\left[{-}\sqrt{{{a}}^{{2}}{+}{2}{}{{r}}^{{2}}}{,}{-}\sqrt{{-}{{a}}^{{2}}{-}{{r}}^{{2}}}\right]$ (3)

The output option detailed can be used to return a detailed list of the critical points, Lagrange multipliers, and function values.

 > $\mathrm{LagrangeMultipliers}\left(xy,\left[\frac{{x}^{2}}{8}+\frac{{y}^{2}}{2}-1\right],\left[x,y\right],\mathrm{output}=\mathrm{detailed}\right)$
 $\left[{x}{=}{2}{,}{y}{=}{1}{,}{{\mathrm{\lambda }}}_{{1}}{=}{2}{,}{x}{}{y}{=}{2}\right]{,}\left[{x}{=}{2}{,}{y}{=}{-1}{,}{{\mathrm{\lambda }}}_{{1}}{=}{-2}{,}{x}{}{y}{=}{-2}\right]{,}\left[{x}{=}{-2}{,}{y}{=}{1}{,}{{\mathrm{\lambda }}}_{{1}}{=}{-2}{,}{x}{}{y}{=}{-2}\right]{,}\left[{x}{=}{-2}{,}{y}{=}{-1}{,}{{\mathrm{\lambda }}}_{{1}}{=}{2}{,}{x}{}{y}{=}{2}\right]$ (4)
 > $\mathrm{LagrangeMultipliers}\left(xy,\left[\frac{{x}^{2}}{8}+\frac{{y}^{2}}{2}-1\right],\left[x,y\right],\mathrm{output}=\mathrm{plot}\right)$ The command to create the plot from the Plotting Guide is:

 > $\mathrm{LagrangeMultipliers}\left(xy,\left[\frac{{x}^{2}}{8}+\frac{{y}^{2}}{2}-1\right],\left[x,y\right],\mathrm{output}=\mathrm{plot},\mathrm{showlevelcurves}=\mathrm{false}\right)$ > 

 See Also