Creating a function from DSolve output

  • Thread starter Thread starter rasouza
  • Start date Start date
  • Tags Tags
    Function Output
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
1 reply · 4K views
rasouza
Messages
1
Reaction score
0
I have discovered the solution for the differential equation. I have:

DSolve[{y'[x] == 3 + 1/x}, y, x]

and got
{{y -> Function[{x}, 3 x + C[1] + Log[x]]}}

I'd like to make y a function of z, for example. I just would like to be able to use the function another time, evaluating y[2] for example.

I tried a[x_] = DSolve[{y'[x] == 3 + 1/x}, y, x] but failed
 
Physics news on Phys.org
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/" for detailed explanation.
 
Last edited by a moderator: