Converting a function from sympy to numpy (attribute error)
Question: 
    import numpy as np
    import sympy as sym
    from numpy import sin
    from sympy import symbols, diff
    
    func = lambda x: sin(x)
    x    = symbols('x')
    print diff(func(x),x)
    

This works if I replace my function with a polynomial, or if I place the trig
function directly into the diff operator. But in this format I get
AttributeError: sin.

Basically I think python can't recognize func as just being a trig function
which it knows how to symbolically integrate. I could just have sympy import
sin and then things would work, but then I'm stuck with func referencing sin
in the sympy namespace and there are future things I want to do with func
which require that it be defined using sin in the numpy namespace.


Answer: You should build your expression up symbolically using SymPy functions, and
then use `lambdify` to convert them into things that can be evaluated with
NumPy.

