Question: I want help in Mathematica Coding, do you offer that U[x_, y_] := x y + 2 x ; B[Px_, x_, Py_, y_, Y_] :=
I want help in Mathematica Coding, do you offer that
U[x_, y_] := x y + 2 x ;
B[Px_, x_, Py_, y_, Y_] := Y - Px x - Py y ;
L[Px_, x_, Py_, y_, Y_, \[Lambda]_] :=
U[x, y] + \[Lambda] B[Px, x, Py, y, Y];
MUx = \!\(
\*SubscriptBox[\(\[PartialD]\), \(x\)]\(U[x, y]\)\)
MUy = \!\(
\*SubscriptBox[\(\[PartialD]\), \(y\)]\(U[x, y]\)\)
dL[Px_, x_, Py_, y_, Y_, \[Lambda]_] :=
D[L[Px, x, Py, y, Y, \[Lambda]] == 0, {{x, y, \[Lambda]}, 1}]
dL[Px, x, Py, y, Y, \[Lambda]] // MatrixForm
d2L[Px_, x_, Py_, y_, Y_, \[Lambda]_] :=
D[L[Px, x, Py, y, Y, \[Lambda]], {{x, y, \[Lambda]}, 2}]
d2L[Px, x, Py, y, Y, \[Lambda]] // MatrixForm
sol[Px_, Py_, Y_] :=
Flatten[Solve[dL[Px, x, Py, y, Y, \[Lambda]], {x, y, \[Lambda]}]]
xs[Px_, Py_, Y_] := {x} /. sol[Px, Py, Y][[1]]
ys[Px_, Py_, Y_] := {y} /. sol[Px, Py, Y][[2]]
\[Lambda]s [Px_, Py_, Y_] := {\[Lambda]} /. sol[Px, Py, Y][[3]]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
