# Solving DE's with maple

This topic is 4080 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I have a couple of differential equations I need to solve, or rather just check my solution to, so I am wondering how I could use maple either solve the differential equations for me, or plug in my solution and see if it works.

##### Share on other sites
Maple can sometimes solve DE's for which there is an analytic solution. Its been a while (years) since I used Maple for this, so I remember nothing and can't advise on how to do it.

I can say that although Maple can do this for you, its solution often is not presented in the most simple form. Unless your problem is quite simple, the Maple symbolic solution is likely to be extremely difficult to compare with something you've done, and presumbly simplified, by hand. I'd give it at best a 10% chance of producing something clean. The numerical solutions may be much better, but you'd have to have a way to plot or evaluate your own solution to compare against Maple's numerical solution.

##### Share on other sites
Indeed, hidden monsters lurk within. Nevertheless, some code to solve an ODE goes along the lines of:
> ODE1 := diff(y(x), x$2) - x*diff(y(x), x) = y(x);> dsolve(ODE1); This will solve y''' -xy' = y for y(x). Obviously, there's a lot more to Maple than this, but there's nothing like an example to get you started. Suppose I wanted to verify that z(x) = Aeix is a solution to z''' = -z, I would do something like: > z := x -> A*exp(I*x);> ddz := x -> diff(z(x), x$2);> simplify(ddz(x) + z(x));
or equivalently, using the implicit D operator,
> z := x -> A*exp(I*x);> ddz := D(D(z));> simplify(ddz(x) + z(x));
and ensure that the result is zero (in either case).

Good luck

Edit: Thanks, Todo.

[Edited by - TheAdmiral on March 24, 2007 4:15:33 PM]

##### Share on other sites
Quote:
 Original post by TheAdmiralIndeed, hidden monsters lurk within. Nevertheless, some code to solve an ODE goes along the lines of:> ODE1 := diff(y(x), x$2) - x*diff(y(x), x) = y(x);> dsolve(ODE1);This will solve y'''' -xy' = y for y(x). Obviously, there's a lot more to Maple than this, but there's nothing like an example to get you started.Suppose I wanted to verify that z(x) = Aeix is a solution to z'''' = -z, I would do something like:> z := x -> A*exp(I*x);> ddz := x -> diff(z(x), x$2);> simplify(ddz(x) + z(x));or equivalently, using the implicit D operator,> z := x -> A*exp(I*x);> ddz := D(D(z));> simplify(ddz(x) + z(x));and ensure that the result is zero (in either case).Good luckAdmiral

A small correction due to the forum killing of pairs of single quotes ;-).

• 23
• 15
• 23
• 10
• 19