Zad. 4

f[x_,y_, μ_] := μ(x-1/3 x^3) + y

g[x_ ] := -x

Solve[{f[x,y,μ]==0, g[x]==0}, {x,y}]

A=D[f[x,y,μ],{{x,y}}]

B=D[g[x],{{x,y}}]

List[A,B]//MatrixForm

macierz[x_, y_, a_] := Evaluate[{D[f[x,y,a],{{x,y}}], D[g[x],{{x,y}}]}]

Manipulate[   N[Eigenvalues[macierz[0,0,a]]]    ,{a, 0,10}]

p =VectorPlot[{f[x,y,2], g[x]}, {x,-3,3}, {y,-3,3}, StreamPoints -> Coarse, Epilog -> {Red, PointSize[0.02], Point[{0,0}]}]

Show[p, ListLinePlot[{{0,-3},{0,3}}, PlotStyle -> Magenta]]

ClearAll[x,y]

s1 = NDSolve[{x'[t]== f[x[t],y[t],2], y'[t]==g[x[t]], x[0]==2, y[0]==3}, {x[t],y[t]}, {t,0,40}]

Plot[Evaluate[{x[t],y[t]}/. s1], {t,0,40}]

ParametricPlot[Evaluate[{x[t], y[t]} /. s1], {t,0,40}]