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

How can I plot the product of the NDSolve result, e.g. x[t]/.solution and any known function, for instance, Sin[x]?

share|improve this question

In the examples you find:

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

Expand it like this for the product with Sin[t]:

Plot[Evaluate[y[t] /. s] * Sin[t], {t, 0, 30}, PlotRange -> All]
share|improve this answer

If you meant Sin[x], then I suppose something like

 Plot[Evaluate[Sin[x[t]] /. solution], {t, 0, 20}]

is what you're after. In this case, the term "product" should be read as "composition."

If, on the other hand, you meant to multiply the solution by Sin[t], then perhaps

Plot[Evaluate[Sin[t] x[t] /. solution], {t, 0, 20}]

will do. (Evaluate has to be the Head of the argument for it to override the HoldAll attribute of Plot.)

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.