# Using Around with NDSolve

I was trying to obtain the same result of a differential equation with to different methods the first one is based on DSolve and the second one is based on NDSolve

a = Around[1, 0.1];
b := DSolve[{y'[x] + y[x] == a, y == a}, y[x], {x, 0, 1090}]
f[x_] = y[x] /. b[];
f


And with this code I get that $$f=1\pm 0.1018$$.

Now I want to get the same result but using NDSolve:

soli = NDSolve[{p'[x] + p[x] == a, p == a}, p[x], {x, 0, 1090}]
solie[x_] = p[x] /. soli[];
solie


But the Mathematica V.12 gives as result

NDSolve::ndinnt: Initial condition 1.00±0.10 is not a number or a rectangular array of numbers.


The problem is that I need to use NDSolve because I have a complicated differential equation (not the equation that appears in the example)

• I think you might have to integrate each end-point value separately (ParametricNDSolve[] could help with this). Of course, you're not guaranteed to capture the full range of the trajectories, but I don't think NDSolve is programmed to do it either. Feb 8, 2020 at 22:45
• @Michael E2: The following soli = ParametricNDSolve[{p'[x] + p[x] == a, p == a}, p, {x, 0, 1090}, {a}];p1 = p[Around[1, 0.1]] /. soli; p1 /. soli does not work for me in version 12.0 on Windows 10 32bit. Feb 9, 2020 at 17:38
• @user64494 Why would you think it would work? I said "end-point" (i.e. a number), not Around[..]. Feb 9, 2020 at 18:28
• @Michael E2: I tried that, no more and no less. Feb 9, 2020 at 18:38

You can use ParametricNDSolve to analyse how sensitive the solution is to parameters or initial conditions. There are multiple examples on the reference page under "Scope".