Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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
add comment

1 Answer

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. –  belisarius Jan 26 '13 at 9:25
add comment

Your Answer

 
discard

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.