NDSolve & IVP DIFFeq HELP :(

Hey guys!! doing my math homework and I cannot figure out how to use NDsolve…and When I looked at my friends graph of their behavior it looked completely different than the one I got so I deleted all of my work and now I turn to you math gurus to help me :(( I also had her explain to me the behavior of the solution over the interval and I pretended to understand what she said but I still don’t understand question (c). Thanks for your help guys <3

  1. Consider the initial-value problem (IVP)
    y’= cos(x) ? e^?y, with y(1) = 0
    The Mathematica command DSolve fails with this problem (try it if you wish to see by yourself!), but there is the option to use the command NDSolve NDSolve: Numerically solve a differential equation—Wolfram Documentation, which uses special numerical algorithms to approximate the solution over an interval.
    (a) ?nd the solution y = f(x) with NDSolve, over the interval 0 ? x ? 2.
    (b) Graph f(x) on the interval 0 < x ? 2. Which part of the graph shows the initial condition?
    (c) Describe in words the behavior of the solution over the given interval. What is happening near x = 2? What happens with the computation of solution if the interval is extended to x = 3?

You can use NDSolve like this

ode = y'[x] == Cos[x] - Exp[-y[x]];
ic = y[1] == 0;
sol = First[y /. NDSolve[{ode, ic}, y, {x, 0, 2}]]
Plot[sol[x], {x, 0, 2}]

To see what happens as the range changes:

Manipulate[
 Module[{sol},
  sol = First[y /. NDSolve[{ode, ic}, y, {x, 0, max}]];
  Plot[sol[x], {x, 0, max}]
  ],
 {{max, 2, "max limit"}, .1, 4, .01, Appearance -> "Labeled"},
 Initialization :>
  (
   ode = y'[x] == Cos[x] - Exp[-y[x]];
   ic = y[1] == 0
   )
 ]

You’ll see the singularity after 2.0 show up.