Ask Your Question

Revision history [back]

Most of the work has been done with the code in the question.

Only a little step remains.

After defining

sage: t = var('t', domain='real')
sage: z, w = var('z w')
sage: p(z, w) = 5*z^2*w + 3*z*w + 2*z
sage: solns = p(e^(I*t), w).solve(w)

the name solns refers to as a list of solutions

sage: solns
[w == -2/(5*e^(I*t) + 3)]

which in this case has only one element, accessed as

sage: solns[0]
w == -2/(5*e^(I*t) + 3)

and whose left hand side and right hand side are

sage: solns[0].lhs()
w
sage: solns[0].rhs()
-2/(5*e^(I*t) + 3)

so we can define

sage: f(t) = solns[0].rhs()
sage: f(t)
-2/(5*e^(I*t) + 3)