\( \DeclareMathOperator{\abs}{abs} \newcommand{\ensuremath}[1]{\mbox{$#1$}} \)

multiplicador_de_Lagrange.wmmx

(%i1) kill(all);
\[\tag{%o0} \mathit{done}\]
(%i2) f:x^2+y^22·x2·y+3;   g:4·x^28·x+y^22·y+1;
\[\tag{f}{{y}^{2}}-2 y+{{x}^{2}}-2 x+3\] \[\tag{g}{{y}^{2}}-2 y+4 {{x}^{2}}-8 x+1\]
(%i5) eq1:diff(f,x)=L·diff(g,x); eq2:diff(f,y)=L·diff(g,y); eq3:g=0;
\[\tag{eq1}2 x-2=L\, \left( 8 x-8\right) \] \[\tag{eq2}2 y-2=L\, \left( 2 y-2\right) \] \[\tag{eq3}{{y}^{2}}-2 y+4 {{x}^{2}}-8 x+1=0\]
(%i6) sol:algsys([eq1, eq2, eq3], [x,y,L]);
\[\tag{sol}[[x=0,y=1,L=\frac{1}{4}],[x=2,y=1,L=\frac{1}{4}],[x=1,y=-1,L=1],[x=1,y=3,L=1]]\]
(%i8) n:length(sol)$ display(n)$
\[n=4\]
(%i9) for i:1 thru n do (  
       P[i]:subst(sol[i],[x,y]),  
       display(P[i])
);
\[\mbox{}\\\mbox{ARRSTORE: use\_ fast\_ arrays=false; allocate a new property hash table for |\$ p|}{P_1}=[0,1]{P_2}=[2,1]{P_3}=[1,-1]{P_4}=[1,3]\] \[\tag{%o9} \mathit{done}\]
Created with wxMaxima.