We would like to find extrama of on the curve with equation
. We set up and solve system of equations for Lagrange's multipliers:
fricas
(1) -> f := x^2 + y^2 - 2*x + 4*y + 5
Type: Polynomial(Integer)
fricas
g := 2*x^4 + 3*y^7 - 4
Type: Polynomial(Integer)
fricas
dfx := D(f, x) - l*D(g,x)
Type: Polynomial(Integer)
fricas
dfy := D(f, y) - l*D(g, y)
Type: Polynomial(Integer)
fricas
)set output tex off
fricas
)set output algebra on
r1 := solve([g, dfx, dfy], 1.0e-15)
(5)
[
[
y
=
0.9208297689_3710153170_2034169691_3819039444_1382982572_8057479579_008
7622506_6610299122_7720402279_4236135414_3512919130_1925525120_59548528
21_0249360484
,
x = - 1.0373393332_54388858,
l
=
0.4562898854_2744960049_4865614063_3636455024_1672207281_8815376923_522
6096440_0032082177_9819858606_1445957048_6060348282_1979071104_57890667
02_127456665
]
,
[y = - 0.8526080934_9016125576, x = - 1.2563366987_746125493,
l
=
0.2844629945_1171337269_5579861614_8489100133_6205527230_4243593768_166
3989631_1268805817_6205268127_7290243939_8182115881_6636341271_07798121
86_9564056396
]
,
[y = - 1.1416637803_267151789,
x
=
1.5513349690_2801873789_3770322428_2563302905_0169770846_7275566242_580
5498910_8857124756_6803091958_3494850823_0917955654_4637921892_90514021
58_240811401
,
l
=
0.0369180540_4167569804_0713896075_2132995192_5078820127_9289458299_138
6283076_5542713778_8059588147_7007596438_6175822184_9989070051_37880332
76_7963409423_8
]
]
Type: List(List(Equation(Polynomial(Float))))
Now we substitute values info :
fricas
eval(f, r1(1))
(6) 12.6819980979_34599666
Type: Polynomial(Float)
fricas
eval(f, r1(2))
(7) 6.4075634853_613991814
Type: Polynomial(Float)
fricas
eval(f, r1(3))
(8) 1.0407113140_76151838
Type: Polynomial(Float)
One can see that goes to infinity when and go to infinity, so the third point gives minimal value,
that is attains minimal value at , .
Consequently the second point gives local minimum and first gives local maximum.