In[]:=
ClearAll["Global'*"]​​​​(*RandomCoefficients*)​​a2=(Power[-1,RandomInteger[{1,2}]])RandomInteger[{1,10}];​​a1=(Power[-1,RandomInteger[{1,2}]])RandomInteger[{1,10}];​​a0=(Power[-1,RandomInteger[{1,2}]])RandomInteger[{1,10}];​​​​(*RandomInitialConditions*)​​t0=0;​​x0=(Power[-1,RandomInteger[{1,2}]])RandomInteger[{1,5}];​​xd0=(Power[-1,RandomInteger[{1,2}]])RandomInteger[{1,5}];​​​​​​(*DifferentialEquationSecondOrderHomogenous*)​​df1[x_[t_]]=a2*D[x[t],{t,2}]+a1*D[x[t],{t,1}]+a0*D[x[t],{t,0}];​​​​Text["The homogenous linear Second Order differential equation to solve is: "<>ToString[df1[x[t]],TraditionalForm]<>" = 0, with initial conditions x(0) = "<>ToString[x0]<>" and x'(0) = "<>ToString[xd0]]​​​​(*CharachteristicPolynomial*)​​p1[x_]=x^2+(a1/a2)x+(a0/a2);​​sp1:=Solve[p1[x]==0,x]​​s1=x/.sp1[[1]];​​s2=x/.sp1[[2]];​​​​Text["The corresponding characteristic polynomial is : "<>ToString[p1[λ],TraditionalForm]]​​Text["The roots of the characteristic polynomial are λ = "<>ToString[s1,TraditionalForm]<>" and λ = "<>ToString[s2,TraditionalForm]]​​​​(*ExponentialAnsatz*)​​e1[t_]=Exp[s1*t];​​e2[t_]=If[s1==s2,t*Exp[s2*t],Exp[s2*t]];​​​​Text["
e
1
​(t) = "<>ToString[e1[t],TraditionalForm]<>" and
e
2
​(t) = "<>ToString[e2[t],TraditionalForm]<>" are two solutions to the original differential equation."]​​​​(*Wrosnkianregularitycheck*)​​w[x_,y_,t_]:={{x,y},{D[x,t],D[y,t]}}​​w1=w[e1[t],e2[t],t];MatrixForm[w1];​​dw1=Det[w1];​​Solve[dw1==0,t];​​​​Text["The wronskian of
e
1
and
e
2
is the determinant of the matrix W[​
e
1
,
e
2
​] = "<>ToString[w1,TraditionalForm]]​​Text["
e
1
and
e
2
are linearly independent on any Interval I ⊂ "<>ToString[Reals,TraditionalForm]" where W[
e
1
​(​
t
0
​) ,
e
2
​(​
t
0
​) ]​,
t
0
∈ I, is regular  det[W] ≠ 0. "]​​Text["Two linearly independent solutions
e
1
and
e
2
to the original differential equation build a fundamental system of solutions."]​​Text["The general solution to the homogenous equation is of the form
x
g
=
x
g
​(t) =
c
1​
×
e
1
​(t) +
c
2
×
e
2
​(t) =
c
1​
× "<>ToString[e1[t],TraditionalForm]<>" +
c
2
× "<>ToString[e2[t],TraditionalForm]<>",
c
1
​,
c
2​
∈ "]​​​​(*CoefficientSolutionforinitialconditions*)​​MatrixForm[w1/.t->t0];​​ls1=LinearSolve[w1/.t->t0,{x0,xd0}];​​​​Text["A particular solution to the Initial Value Problem can be found by solving the linear system of equations W[
e
1
​(0) ,
e
2
​(0)​] "<>ToString[MatrixForm[{
c
1
,
c
2
}],TraditionalForm]<>" = "<>ToString[MatrixForm[{x0,xd0}],TraditionalForm]]​​Text["The solution to the original Initial Value Problem is "<>ToString[MatrixForm[{
c
1
,
c
2
}],TraditionalForm]<>" = "<>ToString[MatrixForm[{ls1[[1]],ls1[[2]]}],TraditionalForm]]​​​​(*Solvedifferentialequationwithinitalconditions*)​​df1s=DSolve[{df1[x[t]]==0,x[t0]==x0,x'[t0]==xd0},x,t];​​df1e=Evaluate[x[t]/.df1s];​​Text["The particular solution to the original differential equation with given initial conditions is
x
p
=
x
p
​(t) = "<>ToString[df1e[[1]],TraditionalForm]]​​​​(*PlotResults*)​​Plot[Evaluate[x[t]/.df1s],{t,-8,8}]
Out[]=
The homogenous linear Second Order differential equation to solve is: -8
′′
x
(t)-3
′
x
(t)-8x(t) = 0, with initial conditions x(0) = 3 and x'(0) = 3
Out[]=
The corresponding characteristic polynomial is :
2
λ
+
3λ
8
+1
Out[]=
The roots of the characteristic polynomial are λ =
1
16
-3-
247
 and λ =
1
16
-3+
247

Out[]=
e
1
​(t) =
1
16
-3-
247
t

and
e
2
​(t) =
1
16
-3+
247
t

are two solutions to the original differential equation.
Out[]=
The wronskian of
e
1
and
e
2
is the determinant of the matrix W[​
e
1
,
e
2
​] =
1
16
-3-
247
t

1
16
-3+
247
t

1
16
-3-
247

1
16
-3-
247
t

1
16
-3+
247

1
16
-3+
247
t

Out[]=
e
1
and
e
2
are linearly independent on any Interval I ⊂  where W[
e
1
​(​
t
0
​) ,
e
2
​(​
t
0
​) ]​,
t
0
∈ I, is regular  det[W] ≠ 0.
Out[]=
Two linearly independent solutions
e
1
and
e
2
to the original differential equation build a fundamental system of solutions.
Out[]=
The general solution to the homogenous equation is of the form
x
g
=
x
g
​(t) =
c
1​
×
e
1
​(t) +
c
2
×
e
2
​(t) =
c
1​
×
1
16
-3-
247
t

+
c
2
×
1
16
-3+
247
t

​,
c
1
​,
c
2​
∈ 
Out[]=
A particular solution to the Initial Value Problem can be found by solving the linear system of equations W[
e
1
​(0) ,
e
2
​(0)​] 
c
1
c
2
 =
3
3
Out[]=
The solution to the original Initial Value Problem is 
c
1
c
2
 =
3
26
13+
247

3
26
13-
247

Out[]=
The particular solution to the original differential equation with given initial conditions is
x
p
=
x
p
​(t) =
3
13
-3t/16

247
sin
247
t
16
+13cos
247
t
16
Out[]=
-5
5
-15
-10
-5
5
10
15