In [10]:
import sympy
from sympy import Symbol

from sympy.abc import x, g, b

xdd = (0.0034*g*sympy.exp(-x/22000)*sympy.diff(x)**2) / (2*b) - g
y=sympy.symbols('y',cls=sympy.Function)

xdd = sympy.diff(y(x), x, x) - (0.0034*g*sympy.exp(-x/22000)*sympy.diff(x)**2)  + g


sympy.pprint(xdd)
               -x              
              ─────     2      
              22000    d       
g - 0.0034⋅g⋅ℯ      + ───(y(x))
                        2      
                      dx