This is a demo code to show the use of DSolve for a second order differential equation. The DE is first solved symbolically using DSolve. Then the solution output is converted into a function called funct[tdum_]. The solution function is then  plotted using Plot. To plot the curve, we must supply two values for the arbitrary parameters as appeared in the analytical solution, namely C[1] and C[2]. These two parameters are determined by the intial conditions, corresponds to the initial position and angular velocity of the pendulum.

omega=10;
Asol=DSolve[theta''[t]==-omega^2 theta[t],theta,t];
(*Print[Asol];*)
Aexpres=theta[t]/.Asol[[1]];
funct[tdum_]:=Aexpres/.{C[1]->1.0,C[2]->1.0,t->tdum};
Print[funct[t]];T=2Pi/omega;
Plot[funct[t],{t,0,2T}]

The code below shows the use of NDSolve for the same DE as in above. To this end, two intial conditions must be supplied. In the example here, the bondary conditions are theta[0]==theta0,theta’[0]==0.

theta0=5;omega=10;T=2Pi/omega;
s=NDSolve[{theta''[t]==-omega^2 theta[t],theta[0]==theta0,theta'[0]==0},theta,{t,0,2T}]
(*Print[Asol];*)
Plot[
Evaluate[theta[t]/.s],{t,0,2T}
]

This is a demo code to show the use of DSolve for a second order differential equation. The DE is first solved symbolically using DSolve. Then the solution output is converted into a function called funct[tdum_]. The solution function is then  plotted using Plot.