Hi Christos
I have written MATLAB code to find a simpler form of the transfer function I have made use of some in built MATLAB functions. I have added those documentation at the end for your reference:
syms s U(s) u(t) e h P z
% Define the differential equation
f = diff(u(t), t, 2) + 2*z*diff(u(t), t) + u(t) + e*(u(t))^3 - h^2 *P*cos(h*t);
% Take the Laplace transform
F = laplace(f, t, s);
% Rearrange the terms to isolate the Laplace transform of the output variable
F = collect(F, laplace(u(t), t, s));
% Divide both sides by the Laplace transform of the input variable
H = F / U(s);
% Simplify the transfer function
H = simplify(H);
% Display the transfer function
disp(H);