How do you plot nonhomogeous equations in Mathematica?

  • Context: Mathematica 
  • Thread starter Thread starter yitriana
  • Start date Start date
  • Tags Tags
    Mathematica Plot
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
1 reply · 2K views
yitriana
Messages
35
Reaction score
0
NDSolve[{y'[x] == y[x] Cos[x + y[x]], y[0] == 1}, y, {x, 0, 30}]

i attempted this, but it didn't work.
 
Physics news on Phys.org
Try this:

Code:
sol1 = NDSolve[{y'[x] == y[x] Cos[x + y[x]], y[0] == 1}, y, {x, 0, 30}];
Plot[y[x] /. sol1, {x, 0, 30}]