Variables of the form z_xxxx are *integer* variables created by Maxima, which attempts to give you *also* the complex roots, if any, thus ignoring the assumptions on x, y and l. Note that :
sage: solve(FOC[0], x) --------------------------------------------------------------------------- [ Snip… ] TypeError: Computation failed since Maxima requested additional constraints; using the 'assume' command before evaluation *may* help (example of legal syntax is 'assume(l>0)', see `assume?` for more details) Is l positive, negative or zero? sage: with assuming(l>0): print(solve(FOC[0], x)) [ x == (l*p_x)^(1/a) ] sage: with assuming(l<0): print(solve(FOC[0], x)) [ x^a == l*p_x ] sage: with assuming(l<0): print(solve(FOC[0], x, to_poly_solve=True)) [x == (l*p_x)^(1/a)*e^(2*I*pi*z4353/a)] Interestingly: sage: solve([FOC[0]==0,FOC[1]==0,FOC[2]==0],x,y,l) [[l == (1/p_y), x == (p_x/p_y)^(1/a)*e^(2*I*pi*z3540/a), y == -(p_x*(p_x/p_y)^(1/a)*e^(2*I*pi*z3540/a) - R)/p_y]] sage: solve([FOC[0]==0,FOC[1]==0,FOC[2]==0],x,y,l, algorithm="sympy") [{x: (p_x/p_y)^(1/a), l: 1/p_y, y: -(p_x*(p_x/p_y)^(1/a) - R)/p_y}] sage: solve([FOC[0]==0,FOC[1]==0,FOC[2]==0],x,y,l, algorithm="fricas") [[l == (1/p_y), x == (p_x/p_y)^(1/a)*e^(2*I*pi*z3891/a), y == -(p_x*(p_x/p_y)^(1/a)*e^(2*I*pi*z3891/a) - R)/p_y]] sage: giac.solve(giac(FOC),giac([x,y,l])).sage() [[(p_x/p_y)^(1/a), -(p_x*(p_x/p_y)^(1/a) - R)/p_y, 1/p_y]] HTH, Le dimanche 28 novembre 2021 à 22:13:12 UTC+1, cyrille piatecki a écrit : > On my computer the solution of > > var('a x y p_x p_y D Rev R l') > assume(a,'real') > assume(x,'real') > assume(y,'real') > assume(p_x,'real') > assume(p_y,'real') > assume(D,'real') > assume(Rev,'real') > assume(R,'real') > assume(l,'real') > assume(a<1) > assume(a>0) > assume(p_x>0) > assume(p_y>0) > assume(R>0) > U =(1/(a+1))*x^(a+1)+y > show(LatexExpr(r'\text{La fonction d}^\prime\text{utilité est }U(x,y) = > '),U) > D= x*p_x + y*p_y > show(LatexExpr(r'\text{La Dépense } D = '),D) > Rev= R > show(LatexExpr(r'\text{Le Revenu } Rev = '),R) > L=U+l*(Rev-D) > show(LatexExpr(r'\text{Le lagrangien est } \mathcal{L}(x, y, λ) = '),L) > FOC = [diff(L,x),diff(L,y),diff(L,l)] > show(LatexExpr(r'\text{Les condition du premier ordre sont } > \left\{\begin{array}{c}\mathcal{L}_x= 0\\\mathcal{L}_y= 0\\\mathcal{L}_λ= > 0\end{array}\right. ')) > show(LatexExpr(r'\text{soit }')) > show(LatexExpr(r'\mathcal{L}_x= 0 \Longleftrightarrow '),FOC[0]==0) > show(LatexExpr(r'\mathcal{L}_y= 0 \Longleftrightarrow '),FOC[1]==0) > show(LatexExpr(r'\mathcal{L}_λ= 0 \Longleftrightarrow '),FOC[2]==0) > sol=solve([FOC[0]==0,FOC[1]==0,FOC[2]==0],x,y,l) > show(sol) > > Is nearly correct, but an extra complex exponential term multiplies $x$ > and then modifies $y$. Even as an element I do not understand its form : > > $e^{(2iπz_{5797}a)}$ > > Could some one explain why ? > > -- You received this message because you are subscribed to the Google Groups "sage-support" group. To unsubscribe from this group and stop receiving emails from it, send an email to sage-support+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/sage-support/e745f8a7-df76-4def-b3b9-09ac7684e9a3n%40googlegroups.com.