Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm a little confused with how to use the output from DSolve. The following works

s = DSolve[{y'[x] == x, y[0] == 0}, y[x], x];
Plot[y[x] /. s, {x, 1, 10}]

but I don't understand how it works. I am familiar with /. a -> b which will replace a with b, but I don't get what y[x] /. s is doing?

share|improve this question

Dsolve[], like Solve[] (but unlike Resolve[]) returns replacement rules. You are replacing the value of y[]returned by your solve command

share|improve this answer
Thanks. I see whats going on. I can declare a mapping such as map = {a->b}; then i can use this mapping variable in a any ReplaceAll command i.e a /. map or {a,a} /. map. – David McHarg Jan 26 '13 at 2:10
@David Yes. Replacement rules (term rewriting) are very important in Mathematica. – Dr. belisarius Jan 26 '13 at 9:25

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.