Creating a function from DSolve output

In summary, DSolve is a function in Mathematica used to solve differential equations symbolically. It takes in an input of a differential equation and returns the general solution. To create a function from DSolve output, the "Function" command in Mathematica can be used to specify the dependent and independent variables. This allows for easier manipulation and visualization of the solution, providing a deeper understanding of the problem. However, errors can occur when mistyping the input, dealing with complex numbers, or when the solution is not in a standard form. Lastly, not all differential equations can be solved using DSolve, as it is most effective for linear equations with constant coefficients.
  • #1
rasouza
1
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
  • #2
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:

FAQ: Creating a function from DSolve output

What is DSolve?

DSolve is a function in Mathematica that is used to solve differential equations symbolically. It takes in a differential equation as an input and returns the general solution as an output.

How do I create a function from DSolve output?

To create a function from DSolve output, you can use the "Function" command in Mathematica. This will allow you to specify the dependent variable and the independent variables in the function.

What are the benefits of creating a function from DSolve output?

Creating a function from DSolve output allows you to easily manipulate and use the solution for further calculations. It also allows you to visualize the solution and gain a deeper understanding of the problem at hand.

What are the possible errors when creating a function from DSolve output?

One of the most common errors is mistyping the input differential equation, which can lead to incorrect solutions. Another error can occur when the solution involves complex numbers, as the function may not be able to handle them. Additionally, issues may arise if the solution is not in a standard form that can be easily converted to a function.

Can I create a function from DSolve output for any type of differential equation?

No, not all differential equations can be solved using DSolve. It is most effective for linear differential equations with constant coefficients. For more complex equations, it may be necessary to use other methods or numerical approximations.

Similar threads

Replies
2
Views
2K
Replies
1
Views
1K
Replies
9
Views
6K
Replies
13
Views
2K
Replies
5
Views
3K
Replies
2
Views
1K
Replies
1
Views
1K
Back
Top