from sympy import (Derivative as D, Eq, exp, sin,
    Function, Symbol, symbols, cos, log)
from sympy.core import S
from sympy.solvers.pde import (pde_separate, pde_separate_add, pde_separate_mul,
    pdsolve, classify_pde, checkpdesol)
from sympy.testing.pytest import raises


a, b, c, x, y = symbols('a b c x y')

def test_pde_separate_add():
    x, y, z, t = symbols("x,y,z,t")
    F, T, X, Y, Z, u = map(Function, 'FTXYZu')

    eq = Eq(D(u(x, t), x), D(u(x, t), t)*exp(u(x, t)))
    res = pde_separate_add(eq, u(x, t), [X(x), T(t)])
    assert res == [D(X(x), x)*exp(-X(x)), D(T(t), t)*exp(T(t))]


def test_pde_separate():
    x, y, z, t = symbols("x,y,z,t")
    F, T, X, Y, Z, u = map(Function, 'FTXYZu')

    eq = Eq(D(u(x, t), x), D(u(x, t), t)*exp(u(x, t)))
    raises(ValueError, lambda: pde_separate(eq, u(x, t), [X(x), T(t)], 'div'))


def test_pde_separate_mul():
    x, y, z, t = symbols("x,y,z,t")
    c = Symbol("C", real=True)
    Phi = Function('Phi')
    F, R, T, X, Y, Z, u = map(Function, 'FRTXYZu')
    r, theta, z = symbols('r,theta,z')

    # Something simple :)
    eq = Eq(D(F(x, y, z), x) + D(F(x, y, z), y) + D(F(x, y, z), z), 0)

    # Duplicate arguments in functions
    raises(
        ValueError, lambda: pde_separate_mul(eq, F(x, y, z), [X(x), u(z, z)]))
    # Wrong number of arguments
    raises(ValueError, lambda: pde_separate_mul(eq, F(x, y, z), [X(x), Y(y)]))
    # Wrong variables: [x, y] -> [x, z]
    raises(
        ValueError, lambda: pde_separate_mul(eq, F(x, y, z), [X(t), Y(x, y)]))

    assert pde_separate_mul(eq, F(x, y, z), [Y(y), u(x, z)]) == \
        [D(Y(y), y)/Y(y), -D(u(x, z), x)/u(x, z) - D(u(x, z), z)/u(x, z)]
    assert pde_separate_mul(eq, F(x, y, z), [X(x), Y(y), Z(z)]) == \
        [D(X(x), x)/X(x), -D(Z(z), z)/Z(z) - D(Y(y), y)/Y(y)]

    # wave equation
    wave = Eq(D(u(x, t), t, t), c**2*D(u(x, t), x, x))
    res = pde_separate_mul(wave, u(x, t), [X(x), T(t)])
    assert res == [D(X(x), x, x)/X(x), D(T(t), t, t)/(c**2*T(t))]

    # Laplace equation in cylindrical coords
    eq = Eq(1/r * D(Phi(r, theta, z), r) + D(Phi(r, theta, z), r, 2) +
            1/r**2 * D(Phi(r, theta, z), theta, 2) + D(Phi(r, theta, z), z, 2), 0)
    # Separate z
    res = pde_separate_mul(eq, Phi(r, theta, z), [Z(z), u(theta, r)])
    assert res == [D(Z(z), z, z)/Z(z),
            -D(u(theta, r), r, r)/u(theta, r) -
        D(u(theta, r), r)/(r*u(theta, r)) -
        D(u(theta, r), theta, theta)/(r**2*u(theta, r))]
    # Lets use the result to create a new equation...
    eq = Eq(res[1], c)
    # ...and separate theta...
    res = pde_separate_mul(eq, u(theta, r), [T(theta), R(r)])
    assert res == [D(T(theta), theta, theta)/T(theta),
            -r*D(R(r), r)/R(r) - r**2*D(R(r), r, r)/R(r) - c*r**2]
    # ...or r...
    res = pde_separate_mul(eq, u(theta, r), [R(r), T(theta)])
    assert res == [r*D(R(r), r)/R(r) + r**2*D(R(r), r, r)/R(r) + c*r**2,
            -D(T(theta), theta, theta)/T(theta)]


def test_issue_11726():
    x, t = symbols("x t")
    f  = symbols("f", cls=Function)
    X, T = symbols("X T", cls=Function)

    u = f(x, t)
    eq = u.diff(x, 2) - u.diff(t, 2)
    res = pde_separate(eq, u, [T(x), X(t)])
    assert res == [D(T(x), x, x)/T(x),D(X(t), t, t)/X(t)]


def test_pde_classify():
    # When more number of hints are added, add tests for classifying here.
    f = Function('f')
    eq1 = a*f(x,y) + b*f(x,y).diff(x) + c*f(x,y).diff(y)
    eq2 = 3*f(x,y) + 2*f(x,y).diff(x) + f(x,y).diff(y)
    eq3 = a*f(x,y) + b*f(x,y).diff(x) + 2*f(x,y).diff(y)
    eq4 = x*f(x,y) + f(x,y).diff(x) + 3*f(x,y).diff(y)
    eq5 = x**2*f(x,y) + x*f(x,y).diff(x) + x*y*f(x,y).diff(y)
    eq6 = y*x**2*f(x,y) + y*f(x,y).diff(x) + f(x,y).diff(y)
    for eq in [eq1, eq2, eq3]:
        assert classify_pde(eq) == ('1st_linear_constant_coeff_homogeneous',)
    for eq in [eq4, eq5, eq6]:
        assert classify_pde(eq) == ('1st_linear_variable_coeff',)


def test_checkpdesol():
    f, F = map(Function, ['f', 'F'])
    eq1 = a*f(x,y) + b*f(x,y).diff(x) + c*f(x,y).diff(y)
    eq2 = 3*f(x,y) + 2*f(x,y).diff(x) + f(x,y).diff(y)
    eq3 = a*f(x,y) + b*f(x,y).diff(x) + 2*f(x,y).diff(y)
    for eq in [eq1, eq2, eq3]:
        assert checkpdesol(eq, pdsolve(eq))[0]
    eq4 = x*f(x,y) + f(x,y).diff(x) + 3*f(x,y).diff(y)
    eq5 = 2*f(x,y) + 1*f(x,y).diff(x) + 3*f(x,y).diff(y)
    eq6 = f(x,y) + 1*f(x,y).diff(x) + 3*f(x,y).diff(y)
    assert checkpdesol(eq4, [pdsolve(eq5), pdsolve(eq6)]) == [
        (False, (x - 2)*F(3*x - y)*exp(-x/S(5) - 3*y/S(5))),
         (False, (x - 1)*F(3*x - y)*exp(-x/S(10) - 3*y/S(10)))]
    for eq in [eq4, eq5, eq6]:
        assert checkpdesol(eq, pdsolve(eq))[0]
    sol = pdsolve(eq4)
    sol4 = Eq(sol.lhs - sol.rhs, 0)
    raises(NotImplementedError, lambda:
        checkpdesol(eq4, sol4, solve_for_func=False))


def test_solvefun():
    f, F, G, H = map(Function, ['f', 'F', 'G', 'H'])
    eq1 = f(x,y) + f(x,y).diff(x) + f(x,y).diff(y)
    assert pdsolve(eq1) == Eq(f(x, y), F(x - y)*exp(-x/2 - y/2))
    assert pdsolve(eq1, solvefun=G) == Eq(f(x, y), G(x - y)*exp(-x/2 - y/2))
    assert pdsolve(eq1, solvefun=H) == Eq(f(x, y), H(x - y)*exp(-x/2 - y/2))


def test_pde_1st_linear_constant_coeff_homogeneous():
    f, F = map(Function, ['f', 'F'])
    u = f(x, y)
    eq = 2*u + u.diff(x) + u.diff(y)
    assert classify_pde(eq) == ('1st_linear_constant_coeff_homogeneous',)
    sol = pdsolve(eq)
    assert sol == Eq(u, F(x - y)*exp(-x - y))
    assert checkpdesol(eq, sol)[0]

    eq = 4 + (3*u.diff(x)/u) + (2*u.diff(y)/u)
    assert classify_pde(eq) == ('1st_linear_constant_coeff_homogeneous',)
    sol = pdsolve(eq)
    assert sol == Eq(u, F(2*x - 3*y)*exp(-S(12)*x/13 - S(8)*y/13))
    assert checkpdesol(eq, sol)[0]

    eq = u + (6*u.diff(x)) + (7*u.diff(y))
    assert classify_pde(eq) == ('1st_linear_constant_coeff_homogeneous',)
    sol = pdsolve(eq)
    assert sol == Eq(u, F(7*x - 6*y)*exp(-6*x/S(85) - 7*y/S(85)))
    assert checkpdesol(eq, sol)[0]

    eq = a*u + b*u.diff(x) + c*u.diff(y)
    sol = pdsolve(eq)
    assert checkpdesol(eq, sol)[0]


def test_pde_1st_linear_constant_coeff():
    f, F = map(Function, ['f', 'F'])
    u = f(x,y)
    eq = -2*u.diff(x) + 4*u.diff(y) + 5*u - exp(x + 3*y)
    sol = pdsolve(eq)
    assert sol == Eq(f(x,y),
    (F(4*x + 2*y)*exp(x/2) + exp(x + 4*y)/15)*exp(-y))
    assert classify_pde(eq) == ('1st_linear_constant_coeff',
    '1st_linear_constant_coeff_Integral')
    assert checkpdesol(eq, sol)[0]

    eq = (u.diff(x)/u) + (u.diff(y)/u) + 1 - (exp(x + y)/u)
    sol = pdsolve(eq)
    assert sol == Eq(f(x, y), F(x - y)*exp(-x/2 - y/2) + exp(x + y)/3)
    assert classify_pde(eq) == ('1st_linear_constant_coeff',
    '1st_linear_constant_coeff_Integral')
    assert checkpdesol(eq, sol)[0]

    eq = 2*u + -u.diff(x) + 3*u.diff(y) + sin(x)
    sol = pdsolve(eq)
    assert sol == Eq(f(x, y),
         F(3*x + y)*exp(x/5 - 3*y/5) - 2*sin(x)/5 - cos(x)/5)
    assert classify_pde(eq) == ('1st_linear_constant_coeff',
    '1st_linear_constant_coeff_Integral')
    assert checkpdesol(eq, sol)[0]

    eq = u + u.diff(x) + u.diff(y) + x*y
    sol = pdsolve(eq)
    assert sol.expand() == Eq(f(x, y),
        x + y + (x - y)**2/4 - (x + y)**2/4 + F(x - y)*exp(-x/2 - y/2) - 2).expand()
    assert classify_pde(eq) == ('1st_linear_constant_coeff',
    '1st_linear_constant_coeff_Integral')
    assert checkpdesol(eq, sol)[0]
    eq = u + u.diff(x) + u.diff(y) + log(x)
    assert classify_pde(eq) == ('1st_linear_constant_coeff',
    '1st_linear_constant_coeff_Integral')


def test_pdsolve_all():
    f, F = map(Function, ['f', 'F'])
    u = f(x,y)
    eq = u + u.diff(x) + u.diff(y) + x**2*y
    sol = pdsolve(eq, hint = 'all')
    keys = ['1st_linear_constant_coeff',
        '1st_linear_constant_coeff_Integral', 'default', 'order']
    assert sorted(sol.keys()) == keys
    assert sol['order'] == 1
    assert sol['default'] == '1st_linear_constant_coeff'
    assert sol['1st_linear_constant_coeff'].expand() == Eq(f(x, y),
        -x**2*y + x**2 + 2*x*y - 4*x - 2*y + F(x - y)*exp(-x/2 - y/2) + 6).expand()


def test_pdsolve_variable_coeff():
    f, F = map(Function, ['f', 'F'])
    u = f(x, y)
    eq = x*(u.diff(x)) - y*(u.diff(y)) + y**2*u - y**2
    sol = pdsolve(eq, hint="1st_linear_variable_coeff")
    assert sol == Eq(u, F(x*y)*exp(y**2/2) + 1)
    assert checkpdesol(eq, sol)[0]

    eq = x**2*u + x*u.diff(x) + x*y*u.diff(y)
    sol = pdsolve(eq, hint='1st_linear_variable_coeff')
    assert sol == Eq(u, F(y*exp(-x))*exp(-x**2/2))
    assert checkpdesol(eq, sol)[0]

    eq = y*x**2*u + y*u.diff(x) + u.diff(y)
    sol = pdsolve(eq, hint='1st_linear_variable_coeff')
    assert sol == Eq(u, F(-2*x + y**2)*exp(-x**3/3))
    assert checkpdesol(eq, sol)[0]

    eq = exp(x)**2*(u.diff(x)) + y
    sol = pdsolve(eq, hint='1st_linear_variable_coeff')
    assert sol == Eq(u, y*exp(-2*x)/2 + F(y))
    assert checkpdesol(eq, sol)[0]

    eq = exp(2*x)*(u.diff(y)) + y*u - u
    sol = pdsolve(eq, hint='1st_linear_variable_coeff')
    assert sol == Eq(u, F(x)*exp(-y*(y - 2)*exp(-2*x)/2))

[((295, 315), 'sympy.symbols', 'symbols', (['"""a b c x y"""'], {}), "('a b c x y')\n", (302, 315), False, 'from sympy import Derivative as D, Eq, exp, sin, Function, Symbol, symbols, cos, log\n'), ((363, 381), 'sympy.symbols', 'symbols', (['"""x,y,z,t"""'], {}), "('x,y,z,t')\n", (370, 381), False, 'from sympy import Derivative as D, Eq, exp, sin, Function, Symbol, symbols, cos, log\n'), ((647, 665), 'sympy.symbols', 'symbols', (['"""x,y,z,t"""'], {}), "('x,y,z,t')\n", (654, 665), False, 'from sympy import Derivative as D, Eq, exp, sin, Function, Symbol, symbols, cos, log\n'), ((896, 914), 'sympy.symbols', 'symbols', (['"""x,y,z,t"""'], {}), "('x,y,z,t')\n", (903, 914), False, 'from sympy import Derivative as D, Eq, exp, sin, Function, Symbol, symbols, cos, log\n'), ((923, 945), 'sympy.Symbol', 'Symbol', (['"""C"""'], {'real': '(True)'}), "('C', real=True)\n", (929, 945), False, 'from sympy import Derivative as D, Eq, exp, sin, Function, Symbol, symbols, cos, log\n'), ((956, 971), 'sympy.Function', 'Function', (['"""Phi"""'], {}), "('Phi')\n", (964, 971), False, 'from sympy import Derivative as D, Eq, exp, sin, Function, Symbol, symbols, cos, log\n'), ((1041, 1061), 'sympy.symbols', 'symbols', (['"""r,theta,z"""'], {}), "('r,theta,z')\n", (1048, 1061), False, 'from sympy import Derivative as D, Eq, exp, sin, Function, Symbol, symbols, cos, log\n'), ((2541, 2554), 'sympy.Eq', 'Eq', (['res[1]', 'c'], {}), '(res[1], c)\n', (2543, 2554), False, 'from sympy import Derivative as D, Eq, exp, sin, Function, Symbol, symbols, cos, log\n'), ((3008, 3022), 'sympy.symbols', 'symbols', (['"""x t"""'], {}), "('x t')\n", (3015, 3022), False, 'from sympy import Derivative as D, Eq, exp, sin, Function, Symbol, symbols, cos, log\n'), ((3032, 3058), 'sympy.symbols', 'symbols', (['"""f"""'], {'cls': 'Function'}), "('f', cls=Function)\n", (3039, 3058), False, 'from sympy import Derivative as D, Eq, exp, sin, Function, Symbol, symbols, cos, log\n'), ((3070, 3098), 'sympy.symbols', 'symbols', (['"""X T"""'], {'cls': 'Function'}), "('X T', cls=Function)\n", (3077, 3098), False, 'from sympy import Derivative as D, Eq, exp, sin, Function, Symbol, symbols, cos, log\n'), ((3365, 3378), 'sympy.Function', 'Function', (['"""f"""'], {}), "('f')\n", (3373, 3378), False, 'from sympy import Derivative as D, Eq, exp, sin, Function, Symbol, symbols, cos, log\n'), ((4684, 4696), 'sympy.solvers.pde.pdsolve', 'pdsolve', (['eq4'], {}), '(eq4)\n', (4691, 4696), False, 'from sympy.solvers.pde import pde_separate, pde_separate_add, pde_separate_mul, pdsolve, classify_pde, checkpdesol\n'), ((4708, 4732), 'sympy.Eq', 'Eq', (['(sol.lhs - sol.rhs)', '(0)'], {}), '(sol.lhs - sol.rhs, 0)\n', (4710, 4732), False, 'from sympy import Derivative as D, Eq, exp, sin, Function, Symbol, symbols, cos, log\n'), ((5403, 5414), 'sympy.solvers.pde.pdsolve', 'pdsolve', (['eq'], {}), '(eq)\n', (5410, 5414), False, 'from sympy.solvers.pde import pde_separate, pde_separate_add, pde_separate_mul, pdsolve, classify_pde, checkpdesol\n'), ((5628, 5639), 'sympy.solvers.pde.pdsolve', 'pdsolve', (['eq'], {}), '(eq)\n', (5635, 5639), False, 'from sympy.solvers.pde import pde_separate, pde_separate_add, pde_separate_mul, pdsolve, classify_pde, checkpdesol\n'), ((5870, 5881), 'sympy.solvers.pde.pdsolve', 'pdsolve', (['eq'], {}), '(eq)\n', (5877, 5881), False, 'from sympy.solvers.pde import pde_separate, pde_separate_add, pde_separate_mul, pdsolve, classify_pde, checkpdesol\n'), ((6035, 6046), 'sympy.solvers.pde.pdsolve', 'pdsolve', (['eq'], {}), '(eq)\n', (6042, 6046), False, 'from sympy.solvers.pde import pde_separate, pde_separate_add, pde_separate_mul, pdsolve, classify_pde, checkpdesol\n'), ((6245, 6256), 'sympy.solvers.pde.pdsolve', 'pdsolve', (['eq'], {}), '(eq)\n', (6252, 6256), False, 'from sympy.solvers.pde import pde_separate, pde_separate_add, pde_separate_mul, pdsolve, classify_pde, checkpdesol\n'), ((6550, 6561), 'sympy.solvers.pde.pdsolve', 'pdsolve', (['eq'], {}), '(eq)\n', (6557, 6561), False, 'from sympy.solvers.pde import pde_separate, pde_separate_add, pde_separate_mul, pdsolve, classify_pde, checkpdesol\n'), ((6831, 6842), 'sympy.solvers.pde.pdsolve', 'pdsolve', (['eq'], {}), '(eq)\n', (6838, 6842), False, 'from sympy.solvers.pde import pde_separate, pde_separate_add, pde_separate_mul, pdsolve, classify_pde, checkpdesol\n'), ((7125, 7136), 'sympy.solvers.pde.pdsolve', 'pdsolve', (['eq'], {}), '(eq)\n', (7132, 7136), False, 'from sympy.solvers.pde import pde_separate, pde_separate_add, pde_separate_mul, pdsolve, classify_pde, checkpdesol\n'), ((7678, 7701), 'sympy.solvers.pde.pdsolve', 'pdsolve', (['eq'], {'hint': '"""all"""'}), "(eq, hint='all')\n", (7685, 7701), False, 'from sympy.solvers.pde import pde_separate, pde_separate_add, pde_separate_mul, pdsolve, classify_pde, checkpdesol\n'), ((8242, 8287), 'sympy.solvers.pde.pdsolve', 'pdsolve', (['eq'], {'hint': '"""1st_linear_variable_coeff"""'}), "(eq, hint='1st_linear_variable_coeff')\n", (8249, 8287), False, 'from sympy.solvers.pde import pde_separate, pde_separate_add, pde_separate_mul, pdsolve, classify_pde, checkpdesol\n'), ((8428, 8473), 'sympy.solvers.pde.pdsolve', 'pdsolve', (['eq'], {'hint': '"""1st_linear_variable_coeff"""'}), "(eq, hint='1st_linear_variable_coeff')\n", (8435, 8473), False, 'from sympy.solvers.pde import pde_separate, pde_separate_add, pde_separate_mul, pdsolve, classify_pde, checkpdesol\n'), ((8615, 8660), 'sympy.solvers.pde.pdsolve', 'pdsolve', (['eq'], {'hint': '"""1st_linear_variable_coeff"""'}), "(eq, hint='1st_linear_variable_coeff')\n", (8622, 8660), False, 'from sympy.solvers.pde import pde_separate, pde_separate_add, pde_separate_mul, pdsolve, classify_pde, checkpdesol\n'), ((8795, 8840), 'sympy.solvers.pde.pdsolve', 'pdsolve', (['eq'], {'hint': '"""1st_linear_variable_coeff"""'}), "(eq, hint='1st_linear_variable_coeff')\n", (8802, 8840), False, 'from sympy.solvers.pde import pde_separate, pde_separate_add, pde_separate_mul, pdsolve, classify_pde, checkpdesol\n'), ((8973, 9018), 'sympy.solvers.pde.pdsolve', 'pdsolve', (['eq'], {'hint': '"""1st_linear_variable_coeff"""'}), "(eq, hint='1st_linear_variable_coeff')\n", (8980, 9018), False, 'from sympy.solvers.pde import pde_separate, pde_separate_add, pde_separate_mul, pdsolve, classify_pde, checkpdesol\n'), ((4965, 4977), 'sympy.solvers.pde.pdsolve', 'pdsolve', (['eq1'], {}), '(eq1)\n', (4972, 4977), False, 'from sympy.solvers.pde import pde_separate, pde_separate_add, pde_separate_mul, pdsolve, classify_pde, checkpdesol\n'), ((5030, 5054), 'sympy.solvers.pde.pdsolve', 'pdsolve', (['eq1'], {'solvefun': 'G'}), '(eq1, solvefun=G)\n', (5037, 5054), False, 'from sympy.solvers.pde import pde_separate, pde_separate_add, pde_separate_mul, pdsolve, classify_pde, checkpdesol\n'), ((5107, 5131), 'sympy.solvers.pde.pdsolve', 'pdsolve', (['eq1'], {'solvefun': 'H'}), '(eq1, solvefun=H)\n', (5114, 5131), False, 'from sympy.solvers.pde import pde_separate, pde_separate_add, pde_separate_mul, pdsolve, classify_pde, checkpdesol\n'), ((5330, 5346), 'sympy.solvers.pde.classify_pde', 'classify_pde', (['eq'], {}), '(eq)\n', (5342, 5346), False, 'from sympy.solvers.pde import pde_separate, pde_separate_add, pde_separate_mul, pdsolve, classify_pde, checkpdesol\n'), ((5472, 5492), 'sympy.solvers.pde.checkpdesol', 'checkpdesol', (['eq', 'sol'], {}), '(eq, sol)\n', (5483, 5492), False, 'from sympy.solvers.pde import pde_separate, pde_separate_add, pde_separate_mul, pdsolve, classify_pde, checkpdesol\n'), ((5555, 5571), 'sympy.solvers.pde.classify_pde', 'classify_pde', (['eq'], {}), '(eq)\n', (5567, 5571), False, 'from sympy.solvers.pde import pde_separate, pde_separate_add, pde_separate_mul, pdsolve, classify_pde, checkpdesol\n'), ((5718, 5738), 'sympy.solvers.pde.checkpdesol', 'checkpdesol', (['eq', 'sol'], {}), '(eq, sol)\n', (5729, 5738), False, 'from sympy.solvers.pde import pde_separate, pde_separate_add, pde_separate_mul, pdsolve, classify_pde, checkpdesol\n'), ((5797, 5813), 'sympy.solvers.pde.classify_pde', 'classify_pde', (['eq'], {}), '(eq)\n', (5809, 5813), False, 'from sympy.solvers.pde import pde_separate, pde_separate_add, pde_separate_mul, pdsolve, classify_pde, checkpdesol\n'), ((5959, 5979), 'sympy.solvers.pde.checkpdesol', 'checkpdesol', (['eq', 'sol'], {}), '(eq, sol)\n', (5970, 5979), False, 'from sympy.solvers.pde import pde_separate, pde_separate_add, pde_separate_mul, pdsolve, classify_pde, checkpdesol\n'), ((6058, 6078), 'sympy.solvers.pde.checkpdesol', 'checkpdesol', (['eq', 'sol'], {}), '(eq, sol)\n', (6069, 6078), False, 'from sympy.solvers.pde import pde_separate, pde_separate_add, pde_separate_mul, pdsolve, classify_pde, checkpdesol\n'), ((6222, 6236), 'sympy.exp', 'exp', (['(x + 3 * y)'], {}), '(x + 3 * y)\n', (6225, 6236), False, 'from sympy import Derivative as D, Eq, exp, sin, Function, Symbol, symbols, cos, log\n'), ((6352, 6368), 'sympy.solvers.pde.classify_pde', 'classify_pde', (['eq'], {}), '(eq)\n', (6364, 6368), False, 'from sympy.solvers.pde import pde_separate, pde_separate_add, pde_separate_mul, pdsolve, classify_pde, checkpdesol\n'), ((6455, 6475), 'sympy.solvers.pde.checkpdesol', 'checkpdesol', (['eq', 'sol'], {}), '(eq, sol)\n', (6466, 6475), False, 'from sympy.solvers.pde import pde_separate, pde_separate_add, pde_separate_mul, pdsolve, classify_pde, checkpdesol\n'), ((6644, 6660), 'sympy.solvers.pde.classify_pde', 'classify_pde', (['eq'], {}), '(eq)\n', (6656, 6660), False, 'from sympy.solvers.pde import pde_separate, pde_separate_add, pde_separate_mul, pdsolve, classify_pde, checkpdesol\n'), ((6747, 6767), 'sympy.solvers.pde.checkpdesol', 'checkpdesol', (['eq', 'sol'], {}), '(eq, sol)\n', (6758, 6767), False, 'from sympy.solvers.pde import pde_separate, pde_separate_add, pde_separate_mul, pdsolve, classify_pde, checkpdesol\n'), ((6814, 6820), 'sympy.sin', 'sin', (['x'], {}), '(x)\n', (6817, 6820), False, 'from sympy import Derivative as D, Eq, exp, sin, Function, Symbol, symbols, cos, log\n'), ((6946, 6962), 'sympy.solvers.pde.classify_pde', 'classify_pde', (['eq'], {}), '(eq)\n', (6958, 6962), False, 'from sympy.solvers.pde import pde_separate, pde_separate_add, pde_separate_mul, pdsolve, classify_pde, checkpdesol\n'), ((7049, 7069), 'sympy.solvers.pde.checkpdesol', 'checkpdesol', (['eq', 'sol'], {}), '(eq, sol)\n', (7060, 7069), False, 'from sympy.solvers.pde import pde_separate, pde_separate_add, pde_separate_mul, pdsolve, classify_pde, checkpdesol\n'), ((7272, 7288), 'sympy.solvers.pde.classify_pde', 'classify_pde', (['eq'], {}), '(eq)\n', (7284, 7288), False, 'from sympy.solvers.pde import pde_separate, pde_separate_add, pde_separate_mul, pdsolve, classify_pde, checkpdesol\n'), ((7375, 7395), 'sympy.solvers.pde.checkpdesol', 'checkpdesol', (['eq', 'sol'], {}), '(eq, sol)\n', (7386, 7395), False, 'from sympy.solvers.pde import pde_separate, pde_separate_add, pde_separate_mul, pdsolve, classify_pde, checkpdesol\n'), ((7436, 7442), 'sympy.log', 'log', (['x'], {}), '(x)\n', (7439, 7442), False, 'from sympy import Derivative as D, Eq, exp, sin, Function, Symbol, symbols, cos, log\n'), ((7454, 7470), 'sympy.solvers.pde.classify_pde', 'classify_pde', (['eq'], {}), '(eq)\n', (7466, 7470), False, 'from sympy.solvers.pde import pde_separate, pde_separate_add, pde_separate_mul, pdsolve, classify_pde, checkpdesol\n'), ((8347, 8367), 'sympy.solvers.pde.checkpdesol', 'checkpdesol', (['eq', 'sol'], {}), '(eq, sol)\n', (8358, 8367), False, 'from sympy.solvers.pde import pde_separate, pde_separate_add, pde_separate_mul, pdsolve, classify_pde, checkpdesol\n'), ((8536, 8556), 'sympy.solvers.pde.checkpdesol', 'checkpdesol', (['eq', 'sol'], {}), '(eq, sol)\n', (8547, 8556), False, 'from sympy.solvers.pde import pde_separate, pde_separate_add, pde_separate_mul, pdsolve, classify_pde, checkpdesol\n'), ((8725, 8745), 'sympy.solvers.pde.checkpdesol', 'checkpdesol', (['eq', 'sol'], {}), '(eq, sol)\n', (8736, 8745), False, 'from sympy.solvers.pde import pde_separate, pde_separate_add, pde_separate_mul, pdsolve, classify_pde, checkpdesol\n'), ((8898, 8918), 'sympy.solvers.pde.checkpdesol', 'checkpdesol', (['eq', 'sol'], {}), '(eq, sol)\n', (8909, 8918), False, 'from sympy.solvers.pde import pde_separate, pde_separate_add, pde_separate_mul, pdsolve, classify_pde, checkpdesol\n'), ((3771, 3787), 'sympy.solvers.pde.classify_pde', 'classify_pde', (['eq'], {}), '(eq)\n', (3783, 3787), False, 'from sympy.solvers.pde import pde_separate, pde_separate_add, pde_separate_mul, pdsolve, classify_pde, checkpdesol\n'), ((3880, 3896), 'sympy.solvers.pde.classify_pde', 'classify_pde', (['eq'], {}), '(eq)\n', (3892, 3896), False, 'from sympy.solvers.pde import pde_separate, pde_separate_add, pde_separate_mul, pdsolve, classify_pde, checkpdesol\n'), ((4781, 4825), 'sympy.solvers.pde.checkpdesol', 'checkpdesol', (['eq4', 'sol4'], {'solve_for_func': '(False)'}), '(eq4, sol4, solve_for_func=False)\n', (4792, 4825), False, 'from sympy.solvers.pde import pde_separate, pde_separate_add, pde_separate_mul, pdsolve, classify_pde, checkpdesol\n'), ((6526, 6536), 'sympy.exp', 'exp', (['(x + y)'], {}), '(x + y)\n', (6529, 6536), False, 'from sympy import Derivative as D, Eq, exp, sin, Function, Symbol, symbols, cos, log\n'), ((4225, 4236), 'sympy.solvers.pde.pdsolve', 'pdsolve', (['eq'], {}), '(eq)\n', (4232, 4236), False, 'from sympy.solvers.pde import pde_separate, pde_separate_add, pde_separate_mul, pdsolve, classify_pde, checkpdesol\n'), ((4437, 4449), 'sympy.solvers.pde.pdsolve', 'pdsolve', (['eq5'], {}), '(eq5)\n', (4444, 4449), False, 'from sympy.solvers.pde import pde_separate, pde_separate_add, pde_separate_mul, pdsolve, classify_pde, checkpdesol\n'), ((4451, 4463), 'sympy.solvers.pde.pdsolve', 'pdsolve', (['eq6'], {}), '(eq6)\n', (4458, 4463), False, 'from sympy.solvers.pde import pde_separate, pde_separate_add, pde_separate_mul, pdsolve, classify_pde, checkpdesol\n'), ((4658, 4669), 'sympy.solvers.pde.pdsolve', 'pdsolve', (['eq'], {}), '(eq)\n', (4665, 4669), False, 'from sympy.solvers.pde import pde_separate, pde_separate_add, pde_separate_mul, pdsolve, classify_pde, checkpdesol\n'), ((5002, 5021), 'sympy.exp', 'exp', (['(-x / 2 - y / 2)'], {}), '(-x / 2 - y / 2)\n', (5005, 5021), False, 'from sympy import Derivative as D, Eq, exp, sin, Function, Symbol, symbols, cos, log\n'), ((5079, 5098), 'sympy.exp', 'exp', (['(-x / 2 - y / 2)'], {}), '(-x / 2 - y / 2)\n', (5082, 5098), False, 'from sympy import Derivative as D, Eq, exp, sin, Function, Symbol, symbols, cos, log\n'), ((5156, 5175), 'sympy.exp', 'exp', (['(-x / 2 - y / 2)'], {}), '(-x / 2 - y / 2)\n', (5159, 5175), False, 'from sympy import Derivative as D, Eq, exp, sin, Function, Symbol, symbols, cos, log\n'), ((5448, 5459), 'sympy.exp', 'exp', (['(-x - y)'], {}), '(-x - y)\n', (5451, 5459), False, 'from sympy import Derivative as D, Eq, exp, sin, Function, Symbol, symbols, cos, log\n'), ((6332, 6339), 'sympy.exp', 'exp', (['(-y)'], {}), '(-y)\n', (6335, 6339), False, 'from sympy import Derivative as D, Eq, exp, sin, Function, Symbol, symbols, cos, log\n'), ((8511, 8527), 'sympy.exp', 'exp', (['(-x ** 2 / 2)'], {}), '(-x ** 2 / 2)\n', (8514, 8527), False, 'from sympy import Derivative as D, Eq, exp, sin, Function, Symbol, symbols, cos, log\n'), ((8700, 8716), 'sympy.exp', 'exp', (['(-x ** 3 / 3)'], {}), '(-x ** 3 / 3)\n', (8703, 8716), False, 'from sympy import Derivative as D, Eq, exp, sin, Function, Symbol, symbols, cos, log\n'), ((8759, 8765), 'sympy.exp', 'exp', (['x'], {}), '(x)\n', (8762, 8765), False, 'from sympy import Derivative as D, Eq, exp, sin, Function, Symbol, symbols, cos, log\n'), ((8932, 8942), 'sympy.exp', 'exp', (['(2 * x)'], {}), '(2 * x)\n', (8935, 8942), False, 'from sympy import Derivative as D, Eq, exp, sin, Function, Symbol, symbols, cos, log\n'), ((6601, 6620), 'sympy.exp', 'exp', (['(-x / 2 - y / 2)'], {}), '(-x / 2 - y / 2)\n', (6604, 6620), False, 'from sympy import Derivative as D, Eq, exp, sin, Function, Symbol, symbols, cos, log\n'), ((6619, 6629), 'sympy.exp', 'exp', (['(x + y)'], {}), '(x + y)\n', (6622, 6629), False, 'from sympy import Derivative as D, Eq, exp, sin, Function, Symbol, symbols, cos, log\n'), ((6925, 6931), 'sympy.cos', 'cos', (['x'], {}), '(x)\n', (6928, 6931), False, 'from sympy import Derivative as D, Eq, exp, sin, Function, Symbol, symbols, cos, log\n'), ((8319, 8334), 'sympy.exp', 'exp', (['(y ** 2 / 2)'], {}), '(y ** 2 / 2)\n', (8322, 8334), False, 'from sympy import Derivative as D, Eq, exp, sin, Function, Symbol, symbols, cos, log\n'), ((6304, 6314), 'sympy.exp', 'exp', (['(x / 2)'], {}), '(x / 2)\n', (6307, 6314), False, 'from sympy import Derivative as D, Eq, exp, sin, Function, Symbol, symbols, cos, log\n'), ((6315, 6329), 'sympy.exp', 'exp', (['(x + 4 * y)'], {}), '(x + 4 * y)\n', (6318, 6329), False, 'from sympy import Derivative as D, Eq, exp, sin, Function, Symbol, symbols, cos, log\n'), ((6893, 6915), 'sympy.exp', 'exp', (['(x / 5 - 3 * y / 5)'], {}), '(x / 5 - 3 * y / 5)\n', (6896, 6915), False, 'from sympy import Derivative as D, Eq, exp, sin, Function, Symbol, symbols, cos, log\n'), ((8502, 8509), 'sympy.exp', 'exp', (['(-x)'], {}), '(-x)\n', (8505, 8509), False, 'from sympy import Derivative as D, Eq, exp, sin, Function, Symbol, symbols, cos, log\n'), ((8867, 8878), 'sympy.exp', 'exp', (['(-2 * x)'], {}), '(-2 * x)\n', (8870, 8878), False, 'from sympy import Derivative as D, Eq, exp, sin, Function, Symbol, symbols, cos, log\n'), ((5928, 5933), 'sympy.core.S', 'S', (['(85)'], {}), '(85)\n', (5929, 5933), False, 'from sympy.core import S\n'), ((5940, 5945), 'sympy.core.S', 'S', (['(85)'], {}), '(85)\n', (5941, 5945), False, 'from sympy.core import S\n'), ((6914, 6920), 'sympy.sin', 'sin', (['x'], {}), '(x)\n', (6917, 6920), False, 'from sympy import Derivative as D, Eq, exp, sin, Function, Symbol, symbols, cos, log\n'), ((9063, 9074), 'sympy.exp', 'exp', (['(-2 * x)'], {}), '(-2 * x)\n', (9066, 9074), False, 'from sympy import Derivative as D, Eq, exp, sin, Function, Symbol, symbols, cos, log\n'), ((4513, 4517), 'sympy.core.S', 'S', (['(5)'], {}), '(5)\n', (4514, 4517), False, 'from sympy.core import S\n'), ((4524, 4528), 'sympy.core.S', 'S', (['(5)'], {}), '(5)\n', (4525, 4528), False, 'from sympy.core import S\n'), ((4575, 4580), 'sympy.core.S', 'S', (['(10)'], {}), '(10)\n', (4576, 4580), False, 'from sympy.core import S\n'), ((4587, 4592), 'sympy.core.S', 'S', (['(10)'], {}), '(10)\n', (4588, 4592), False, 'from sympy.core import S\n'), ((5695, 5699), 'sympy.core.S', 'S', (['(8)'], {}), '(8)\n', (5696, 5699), False, 'from sympy.core import S\n'), ((7231, 7250), 'sympy.exp', 'exp', (['(-x / 2 - y / 2)'], {}), '(-x / 2 - y / 2)\n', (7234, 7250), False, 'from sympy import Derivative as D, Eq, exp, sin, Function, Symbol, symbols, cos, log\n'), ((8057, 8076), 'sympy.exp', 'exp', (['(-x / 2 - y / 2)'], {}), '(-x / 2 - y / 2)\n', (8060, 8076), False, 'from sympy import Derivative as D, Eq, exp, sin, Function, Symbol, symbols, cos, log\n'), ((5682, 5687), 'sympy.core.S', 'S', (['(12)'], {}), '(12)\n', (5683, 5687), False, 'from sympy.core import S\n')]