In [1]:
from sympy import init_printing, latex
init_printing()
In [2]:
import sympy as sp
In [3]:
x,y,z,u,v = sp.symbols('x y z u v',real=True)
In [4]:
F = sp.Function('F', real=True)
In [5]:
F(x,y)
Out[5]:
$\displaystyle F{\left(x,y \right)}$
In [6]:
F(x,y).diff(x)
Out[6]:
$\displaystyle \frac{\partial}{\partial x} F{\left(x,y \right)}$
In [7]:
diffeq = sp.Eq(F(x,y).diff(x),F(x,y).diff(y))
diffeq
Out[7]:
$\displaystyle \frac{\partial}{\partial x} F{\left(x,y \right)} = \frac{\partial}{\partial y} F{\left(x,y \right)}$
In [8]:
sol1 = sp.dsolve(diffeq, F(x,y))
sol1
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-8-5484b85ccb91> in <module>
----> 1 sol1 = sp.dsolve(diffeq, F(x,y))
      2 sol1

~/.local/lib/python3.6/site-packages/sympy/solvers/ode.py in dsolve(eq, func, hint, simplify, ics, xi, eta, x0, n, **kwargs)
    644         hints = _desolve(eq, func=func,
    645             hint=hint, simplify=True, xi=xi, eta=eta, type='ode', ics=ics,
--> 646             x0=x0, n=n, **kwargs)
    647         eq = hints.pop('eq', eq)
    648         all_ = hints.pop('all', False)

~/.local/lib/python3.6/site-packages/sympy/solvers/deutils.py in _desolve(eq, func, hint, ics, simplify, **kwargs)
    211     if kwargs.get('classify', True):
    212         hints = classifier(eq, func, dict=True, ics=ics, xi=xi, eta=eta,
--> 213         n=terms, x0=x0, prep=prep)
    214 
    215     else:

~/.local/lib/python3.6/site-packages/sympy/solvers/ode.py in classify_ode(eq, func, dict, ics, **kwargs)
    968     if func and len(func.args) != 1:
    969         raise ValueError("dsolve() and classify_ode() only "
--> 970         "work with functions of one variable, not %s" % func)
    971 
    972     # Some methods want the unprocessed equation

ValueError: dsolve() and classify_ode() only work with functions of one variable, not F(x, y)
In [9]:
l1 = list(sol1.rhs.atoms(sp.Symbol))
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-9-e05246851996> in <module>
----> 1 l1 = list(sol1.rhs.atoms(sp.Symbol))

NameError: name 'sol1' is not defined
In [12]:
result = sol1.rhs.subs({x:2, 'C1':1})
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-12-02c3e0282a7a> in <module>
----> 1 result = sol1.rhs.subs({x:2, 'C1':1})

NameError: name 'sol1' is not defined
In [15]:
sp.N(result)
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-15-cb0b5040aaca> in <module>
----> 1 sp.N(result)

NameError: name 'result' is not defined
In [19]:
from sympy.abc import x, y
u, X, T = map(sp.Function, 'uXT')

May want to explore the exact differential equation. Thats what this is. What does that imply? Doesnt that have something to do with a conservative field? https://en.wikipedia.org/wiki/Conservative_vector_field A conservative vector field has the property that the line integral is path independent. the choice of any path between two points does not change the value of the line integral. Vector fields represent forces of physical systems in which energy is conserved. So the probability function has properties of a system where energy is conserved. Energy conservation and complexity go hand in hand. The total energy of the system selects a different function? What is a line integral in the context of a probability function?

In [20]:
from sympy import Derivative as D
In [21]:
D(F(x,y),x) + D(F(x,y),y)*D(y,x)
Out[21]:
$\displaystyle \frac{d}{d x} y \frac{\partial}{\partial y} F{\left(x,y \right)} + \frac{\partial}{\partial x} F{\left(x,y \right)}$
In [22]:
P,Q = map(sp.Function,['P','Q'])
In [23]:
t,x0,y0 = sp.symbols('t, x0, y0')
In [24]:
eq1 = sp.Eq(F(x,y), sp.Integral(P(t,y),(t,x0,x))+sp.Integral(Q(x,t),(t,y0,y)))
eq1
Out[24]:
$\displaystyle F{\left(x,y \right)} = \int\limits_{x_{0}}^{x} P{\left(t,y \right)}\, dt + \int\limits_{y_{0}}^{y} Q{\left(x,t \right)}\, dt$
In [25]:
def differential_operation(func_in):
    return D(func_in, x)+D(func_in, yy)*D(yy(x),x)
In [26]:
yy = sp.Function('y')
In [27]:
D(F(x,yy(x)),x)
Out[27]:
$\displaystyle \frac{d}{d x} F{\left(x,y{\left(x \right)} \right)}$
In [28]:
D(x*y,x)
Out[28]:
$\displaystyle \frac{\partial}{\partial x} x y$
In [29]:
sp.diff(x*y,x)
Out[29]:
$\displaystyle y$
In [30]:
F(x,yy(x)).diff(x)
Out[30]:
$\displaystyle \frac{d}{d x} y{\left(x \right)} \left. \frac{\partial}{\partial \xi_{2}} F{\left(x,\xi_{2} \right)} \right|_{\substack{ \xi_{2}=y{\left(x \right)} }} + \left. \frac{\partial}{\partial \xi_{1}} F{\left(\xi_{1},y{\left(x \right)} \right)} \right|_{\substack{ \xi_{1}=x }}$
In [31]:
F(x,y).diff(x) + F(x,y).diff(y)*yy(x).diff(x)
Out[31]:
$\displaystyle \frac{\partial}{\partial x} F{\left(x,y \right)} + \frac{\partial}{\partial y} F{\left(x,y \right)} \frac{d}{d x} y{\left(x \right)}$