Xs = 5;
Xs_dot = 0;

%

dxdt = @(t, x) [x(2); (B * (Xs_dot - x(2)) + k * (Xs - x(1)) + a * (Xs - x(1))^3) / m]

%

m = 100;
k = 1000;
a = 400;
B = 200;

%

x0 = [-5; 0];

%

[t, x] = ode45(dxdt, linspace(0, 5), x0)

%

plot(t, x(:, 1))

%

xk = linspace(0, max(x(:,1)));
fk = k * xk + a * xk.^3;
plot(xk, fk)