# Output with NDSolve

I use of the following differential equation:

s = NDSolve[{y'[x] == y[x] Cos[x + y[x]], y == 1}, y, {x, 0, 30}]


The solution in a plot. What is y[x]?

• For this equation you won´t get a closed form solution. You can see details by clicking the "plus"-sign in the solution, and can evaluate the solution with e.g. func = y /. Flatten[s]; func[2.5] – mgamer Jul 26 '15 at 9:44
• Many thanks. Is there any " Interpolating Polynomial" when we have some value of y[x]( For example: func = y /. Flatten[s]; func[2.5]=0.33)? – Bahram Agheli Jul 26 '15 at 14:48
• The solution itself is an approximation to the solution. If you want a polynominal. You can make a series expansion for a certain point with the "Series"function of Mathematica, but I´m not sure if this makes any sense. – mgamer Jul 26 '15 at 16:27
• Can help me about a series expansion for a certain point with the "Series" function of Mathematica? – Bahram Agheli Jul 26 '15 at 17:42

Maybe I now understand your question right, so give it a try. First the series approach. With the series function you can approximate a function with a Taylor-Series. In the first step I calculate the maxima of your solution:

seedMax = Table[t, {t, 6, 30, 0.5}];
solsMax = Quiet @ FindMaximum[func[x], {x, #}] & /@ Flatten[seedMax];
xMax = x /. (Last /@ solsMax);
xMax = Union[xMax, SameTest -> (Abs[#1 - #2] < 0.0001 &)];


The "Union Stuff" is just to identify nearby solutions as identical. Now we take the maximum near 7 as our x0 in the Taylor series

x0=xMax[]


and do the approximation (third degree here)

approx = Series[func[x], {x, x0, 3}] // Normal


In the neighborhood of the maximum this is a quite good approximation to the solution (but only in the neighborhood):

Plot[{func[x], approx}, {x, 7, 8}] You can also determine the maxima and minima and fit the resulting data with a polynominal, but this is not very satisfactory (eg. picture for approximation of degree 20). BTW I do not think, that this type of Solution produces a polynominal. It should be a (damped) trigonometric function. But polynomials could be good in the neighborhood of extrema.