\(<< graphics\Plotfield.m\)

k := 1

PlotVectorField[{x2, -k*x1}, {x1, -3, 3}, {x2, -3, 3}, 
      Axes -> True, PlotPoints -> 9]

ParametricPlot[{Sin[t], Cos[t]}, {t, 0, 2*Pi}]

PlotVectorField[{x2, -k*Sin[x1]}, {x1, -2*Pi, 2*Pi, 
        Pi/4}, {x2, -2, 2, 0.5}, Axes -> True, 
      Ticks -> {{-2*Pi, -Pi, 0, Pi, 2*Pi}, 
          Automatic}]

m := 2

PlotVectorField[{x2, -k*x1 - m*x2}, {x1, -5, 5}, {x2, -5, 
        5}, Axes -> True, PlotPoints -> 8]

k := 2
m := 3
PlotVectorField[{x2, -k*x1 - m*x2}, {x1, -3, 3}, {x2, -3, 
        3}, Axes -> True, PlotPoints -> 8]

riesenie dif .  
        rovnice (Sol =.  .. )
x[t] je neznama
t je parameter
x' = (cos^2) x

Sol = DSolve[x'[t] == Cos[x[t]]^2, x[t], t]

Plot[{x[t] /. Sol /. C[1] -> 0, x[t] /. Sol /. 
          C[1] -> 1, x[t] /. Sol /. C[1] -> 2}, {t, -2*Pi, 
        2*Pi}]

Sol1 = 
      DSolve[{x'[t] == Sin[x[t]], x[1] == Pi/2}, x[t], 
        t]

Plot[{x[t] /. Sol1 /. C[1] -> 0, x[t] /. Sol1 /. 
          C[1] -> 1, x[t] /. Sol1 /. C[1] -> 2}, {t, -2*Pi, 
        2*Pi}]

Sol1 = DSolve[x'[t] == Sin[x[t]], x[t], t]

Plot[{x[t] /. Sol1 /. C[1] -> 0, x[t] /. Sol1 /. 
          C[1] -> 1, x[t] /. Sol1 /. C[1] -> 2}, {t, -2*Pi, 
        2*Pi}]

Sol1 = 
      NDSolve[{x'[t] == Sin[x[t]], x[1] == Pi/2}, 
        x, {t, 0, 2*Pi}]
Plot[{Pi, x[t] /. Sol1}, {t, 0, 2*Pi}]

urcte funkciu ktora urci narast investicii pri vklade 10000 na 6  %  urok,  spojite urokovanie
x' (t) = 0.06  x (t)
x (0) = 10000

h = 0.06
Sol3 = 
      DSolve[{x'[t] == h*x[t], x[0] == 10000}, x[t], 
        t]
Plot[{x[t] /. Sol3, 1.06^t*10000}, {t, 0, 10}, Axes -> True, 
      PlotStyle -> RGBColor[1, 0.2, 0], GridLines -> Automatic, 
      PlotRange -> Automatic]

Do[Print[t, " kapital: ", (x[t] /. Sol3[[1]]) // N], {t, 0, 
        10}]

Do[Print[
        t, ", spojite: kapital: ", (x[t]) /. sol3[[1]] // N], {t, 
        0, 10}]
Do[Print[t, ", rocne: kapital: ", (1.06^t*10000) // N], {t, 0, 
        10}]
Do[Print[
        t, ", rozdiel: ", ((x[t]) /. 
              sol3[[1]]) - (1.06^t*10000)], {t, 0, 
        10}]
Do[Print[
        t, ", spojite: ", (x[t]) /. sol3[[1]] // 
          N, ", rocne: kapital: ", (1.06^t*10000) // 
          N, ", rozdiel: ", ((x[t]) /. 
              sol3[[1]]) - (1.06^t*10000)]  , {t, 0, 
        10}]