Section 2.1 Homogeneous Linear ODEs of Second Order

We want to solve the equation: y’’+ p(x)y’ + q(x)y = 0

DSolve[y''[x]+y[x]==0,y[x],x]

eqn=y''[x]+y[x]==0

sol=DSolve[{eqn,y[0]==3, y'[0]==-0.5},y,x]

eqn /. sol

y[5] /.sol

f[x_]:= y[x] /. sol

Plot[f[x],{x,0, 4Pi}]

eqn=(x^2-x)y''[x]-x y'[x] + y[x] ==0

sol=DSolve[eqn,y,x]

eqn=y''[x]==k y'[x]

DSolve[eqn,y,x]

(Motion) A small body moves on a straight line. Its
velocity equals twice the reciprocal of its acceleration.
If at t = 0 the body has distance 1 m from the origin
and velocity 2 m/sec, what are its distance and velocity
after 3 sec?

eqn=y'[t]==2 / y''[t]

sol=DSolve[{eqn,y[0]==1,y'[0]==2},y,t]

y[0] /.sol

y'[0] /. sol

y[3] /. sol

y'[3] /. sol

velocity[t_]:=y'[t] /. sol

Plot[velocity[t],{t,1,5},PlotLegends->"Expressions",AxesLabel->{"time (s)","m/sec"}]