Creating a function from DSolve output

  • Thread starter Thread starter rasouza
  • Start date Start date
  • Tags Tags
    Function Output
Click For Summary
SUMMARY

The discussion focuses on creating a function from the output of the DSolve function in Mathematica. The user successfully solved the differential equation y'[x] == 3 + 1/x and obtained the solution {{y -> Function[{x}, 3 x + C[1] + Log[x]]}}. To utilize this solution as a function of another variable, the user demonstrated the correct approach by assigning the solution to a variable g using the syntax g = y /. sol[[1]]. This allows for the evaluation of the function, such as y[2].

PREREQUISITES
  • Familiarity with Mathematica syntax and functions
  • Understanding of differential equations and their solutions
  • Knowledge of function manipulation in Mathematica
  • Basic understanding of variable substitution in programming
NEXT STEPS
  • Explore advanced features of DSolve in Mathematica
  • Learn about function evaluation and variable substitution in Mathematica
  • Investigate the use of initial conditions with DSolve
  • Study the implications of using symbolic computation in Mathematica
USEFUL FOR

Mathematica users, mathematicians, and students studying differential equations who want to enhance their skills in symbolic computation and function manipulation.

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:

Similar threads

  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 9 ·
Replies
9
Views
6K
  • · Replies 4 ·
Replies
4
Views
4K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 13 ·
Replies
13
Views
3K
  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 5 ·
Replies
5
Views
4K