# Is this a bug? Trivial semantic difference => different behavior

This is a problem of no special significance or difficulty. I trimmed it down to the minimum to demonstrate the frustrating behavior:

(DSolve[{ y''[t] + +y'[t] + v y[t] == Sin[w t], y[0] == 0,
y'[0] == 0}, y[t], t][[1, 1, 2]]) // FullSimplify


assume the above is the first action in a new kernel session

Manipulate[Plot[%1, {t, .01, 10}], {v, 2, 5}, {w, 6, 10}]


This gives something that works

repeat the exact above except name the solution, and then try to use that in the second expression:

vvv = (DSolve[{ y''[t] + +y'[t] + v y[t] == Sin[w t], y[0] == 0,
y'[0] == 0}, y[t], t][[1, 1, 2]]) // FullSimplify

Manipulate[Plot[vvv, {t, .01, 10}], {v, 2, 5}, {w, 6, 10}]


This last form gives a dumb, mute manipulate. Sliders move, but you get nothing - no output.

This is Mathematica 10.1.0 on OSX 10.11.6

If this is a bug, I'm speechless. If there's something I'm missing then I'd love to know what it is).

• The second example works correctly because Manipulate is a scoping construct. I'm not sure why the first one works but I know this question was already asked here. It is just hard to search for %
– Kuba
Aug 30, 2016 at 5:29
• How are parameters evaluated for a Plot in Manipulate
– Kuba
Aug 30, 2016 at 5:33
• @kuba do you mean "the second one works incorrectly ? Aug 30, 2016 at 14:01
• No, this time I made no typo :P Manipulate scopes v and w before it sees v and w from vvv so at the end we have two sets of symbols. Have you read the link from my second topic?
– Kuba
Aug 30, 2016 at 14:03

Use explicit arguments in vvv

vvv[t_, v_, w_] =
DSolve[{y''[t] + +y'[t] + v y[t] == Sin[w t], y[0] == 0, y'[0] == 0}, y[t],
t][[1, 1, 2]] // FullSimplify;

Manipulate[
Plot[vvv[t, v, w], {t, .01, 10}],
{v, 2, 5, Appearance -> "Labeled"},
{w, 6, 10, Appearance -> "Labeled"}]


• This "just makes it work" - does not explain why the second case (giving the solution a name, in this case vvv) makes the Manipulate mute/nonfunctional. Aug 30, 2016 at 13:38
• @Paul_A - @Kuba already told you that it is a scoping issue. Manipulate has the the attribute HoldAll which keeps the variables in vvv from being associated with the control variables unless the association is made by the use of explicit arguments in vvv[t, v, w]. Alternatively, you could move the definition of vvv inside the Manipulate. Aug 30, 2016 at 14:15