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

I am trying to solve and plot a solution to an ODE, but Mathematica keeps returning other useless answers

In[0] DSolve[y'[x] == 1 + y[x]^4, y[x], x]

Out[0] DSolve[True,y(x),x]

Can someone help me on this?

Now I am trying to plot the solution

In[1] Plot[DSolve[y'[x] == 1 + y[x]^4, y[x], x], {x, -10, 10}]

Out[1] DSolve::dsvar: -9.99959 cannot be used as a variable. >>

   DSolve::dsvar: -9.99959 cannot be used as a variable. >>

   DSolve::dsvar: -9.59143 cannot be used as a variable. >>

   General::stop: Further output of DSolve::dsvar will be suppressed during this calculation. >>

It also outputed a blank plot

Trying again

sol1 = First@DSolve[y'[x] == 1 + y[x]^4, y[x], x]

Plot[y[x] /. sol1 // Evaluate , {x, -10, 10}]

share|improve this question
2  
You probably have something else defined for y. I get the solution to the DE. Clear your variables or quit your kernel and try again. – rm -rf Sep 24 '12 at 18:04
Is there a "restart" in Mathematica? – jak Sep 24 '12 at 18:05
You can either exit and reopen Mathematica or simply type Quit and evaluate it. – rm -rf Sep 24 '12 at 18:06
1  
sol = DSolve[y'[x] == 1 + y[x]^4, y[x], x][[1]] then Plot[Table[y[x] /. sol /. C[1] -> i/4, {i, 5}] // Release, {x, -1, 1}] its monday.... – chris Sep 24 '12 at 18:34
1  
@Jak You have an undefined C[1] which you have to assign a value before you can plot anything. First order DEs get you one constant. – Sjoerd C. de Vries Sep 24 '12 at 19:43
show 10 more comments

closed as too localized by rm -rf, Oleksandr R., Sjoerd C. de Vries Sep 24 '12 at 19:59

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, see the FAQ.

Browse other questions tagged or ask your own question.