Numerical Differential Equations

Solutions of Oszillation Problems

DSolve[{y''[x]== -y[x],y[0]==1, y'[0]==1},y[x],x]

Now try to use the  Numerical Solution

result =NDSolve[{y''[x]== -y[x],y[0]==1, y'[0]==0},y[x],{x,0,6 Pi}]

Plot[y[x]/.result,{x,0,6 π}]

result1 =NDSolve[{y''[x]== -y[x]^3,y[0]==1, y'[0]==0},y[x],{x,0,6 Pi}]

Plot[y[x]/.result1,{x,0, 6  Pi}]

result2 =NDSolve[{y''[x]== -y[x]^5,y[0]==1, y'[0]==0},y[x],{x,0,6 Pi}]

Plot[y[x]/.result2,{x,0, 6  Pi}]

complicate =NDSolve[{y''[t]+0.1 y'[t]==-Sin[y[t]],y[0]==1,y'[0]==0},y,{t,0, 6 Pi}]

Plot[y[x]/. complicate,{x,0, 6 Pi}]