Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How to tell to sagemath to solve for the good root

Hello, this is a simple problem of optimization

%display latex

var('w, gamma, alpha, beta, h, theta, p, A, B'); U= w^(gamma); Pi = ph^(theta)- wh; N= (U)^alpha * (Pi-B)^beta show(U) show(Pi) show(N) show(N_w) N_w= factor(N.diff(w)) assume(0 < alpha <1) assume(0 < beta <1) z=solve(N_w==0, w, solution_dict=True) show(z)

If I say no bulshit, with the assumptions only one solution is valid. But Sagemath display all solutions ? How could it be done automaticaly ?

The factoriZation shows that

assume(0 < alpha <1) assume(0 < beta <1) z=solve(N_w==0, w, solution_dict=True)