Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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

Can somebody explain this notation to me? Using Mathematica's first example in the NDSolve documentation:

s = NDSolve[{y'[x] == y[x] Cos[x + y[x]], y[0] == 1}, y, {x, 0, 30}]

The output is:

{{y -> InterpolatingFunction[{{0.,30.}}, <>]}}

What do all the curly brackets and the angle signs indicate? Why is there no indication of dependence on x?

I'm also curious why you have to use this result in what I consider to be an awkward way:

Plot[Evaluate[y[x] /. s], {x, 0, 30}, PlotRange -> All]

as opposed to simply:

Plot[s, {x, 0, 30}, PlotRange -> All]
share|improve this question
up vote 4 down vote accepted

The angle signs mean that you're looking at a shorthanded expression. Take a look at


to see the real thing.

The curly braces are there because NDSolve is going to give you consistently formatted results whether you look for only one function with only one solution or your solution involves more than one function, and more than one possible set.

As for the Evaluate thing inside the Plot isn't really needed, although in my opinion shows clearly what you're doing. In any case, if that disturbs you, you may do:

Plot[s[[1, 1, 2]][x], {x, 0, 30}, PlotRange -> All]


The form of s is

s == {{y->InterpolatingFunction[{{0.,30.}},<>]}}


s[[1]] == {y->InterpolatingFunction[{{0.,30.}},<>]}


s[[1,1]] == y->InterpolatingFunction[{{0.,30.}},<>]


s[[1,1,2]] == InterpolatingFunction[{{0.,30.}},<>]

and that's why we are plotting s[[1, 1, 2]]

share|improve this answer

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.