We begin by considering second order dynamical systems of the from $\ddot x(t) + \Gamma (\dot x(t)) + \lambda(t)B(x(t))=0$, where $\Gamma: {\cal H}\rightarrow{\cal H}$ is an elliptic bounded self-adjoint linear operator defined on a real Hilbert space ${\cal H}$, $B: {\cal H}\rightarrow{\cal H}$ is a cocoercive operator and $\lambda:[0,+\infty)\rightarrow [0,+\infty)$ is a relaxation function depending on time. We show the existence and uniqueness of strong global solutions in the framework of the Cauchy-Lipschitz-Picard Theorem and prove weak convergence for the generated trajectories to a zero of the operator $B$, by using Lyapunov analysis combined with the celebrated Opial Lemma in its continuous version. The framework allows to address from similar perspectives second order dynamical systems associated with the problem of finding zeros of the sum of a maximally monotone operator and a cocoercive one. This captures as particular case the minimization of the sum of a nonsmooth convex function with a smooth convex one and allows us to recover and improve several results from the literature concerning the minimization of a convex smooth function subject to a convex closed set by means of second order dynamical systems. When considering the unconstrained minimization of a smooth convex function we prove a rate of ${\cal O}(1/t)$ for the convergence of the function value along the ergodic trajectory to its minimum value. A similar analysis is carried out also for second order dynamical systems having as first order term $\gamma(t) \dot x(t)$, where $\gamma:[0,+\infty)\rightarrow [0,+\infty)$ is a damping function depending on time.