The main problem is that, Mathematica tries to solve your problem analytically first. So it plugs in symbolic x, and your function can't handle it.
Please refer to this question in http://www.voofie.com/concept/Mathematica/" [Broken]...
What you need to do is the following:
sol = DSolve[{y'[x] == 3 + 1/x}, y, x]
g = y /. sol[[1]]
Please refer to this http://www.voofie.com/content/81/how-to-use-the-output-from-mathematica-function-dsolve/" [Broken] for detailed explanation.