Jason Grout wrote: > David Joyner wrote: >> Its exact, so you can do this: >> >> sage: x = var("x") >> sage: y = function("y",x) >> sage: M = x-y >> sage: N = -x+y^2 >> sage: desolve(diff(y,x)==-M/N,y) >> 1/2*x^2 + 1/3*y(x)^3 - x*y(x) == c >> > > Ah, right; thanks for the great reply. However, if I define y as a > function of x, then checking exactness (another part of this student > worksheet) doesn't work very well: > > sage: diff(M,y) > Traceback (most recent call last): > ... > TypeError: argument symb must be a symbol >
This is what I settled on. Apparently maxima doesn't solve symbolic partial differential equations, which is I guess what I was really looking for here. var('x,y') F=vector([x-y, -x+y^2]) M,N=F My=diff(M,y) Nx=diff(N,x) yfun=function('yfun',x) solution=desolve(diff(yfun,x)==(-M/N).subs(y=yfun),yfun).subs_expr(yfun==y) potential=solution.lhs()-solution.rhs() from sage.misc.html import math_parse as mp html.table([ [mp("$(M,N)$"), (M,N)], [mp("$(M_y,N_x)$"), (My,Nx)], [mp("Check $M_y=N_x$"),bool(My==Nx)], [mp("$\int M dx$"), integrate(M,x)], [mp("$\int N dy$"), integrate(N,y)], [mp("Potential (where c is a constant)"), potential], ]) Thanks, Jason -- Jason Grout --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---