clear all
clc

syms u v w
syms t
syms psi(t) theta(t) phi(t)

V = [u; v; w]

M_ps = [ ...
   cos(psi), sin(psi), 0; ... 
  -sin(psi), cos(psi), 0; ...
          0,      0, 1]
          
M_th = [ ...   
  cos(theta), 0, -sin(theta); ...
        0, 1,        0; ... 
  sin(theta), 0,  cos(theta)]

M_ph = [ ...
  1,        0,       0; ...
  0,  cos(phi), sin(phi); ... 
  0, -sin(phi), cos(phi)]
                      
M_fg = M_ph * M_th * M_ps

M_gf = transpose (M_fg)

M_gf_p = diff (M_gf, t)

erg_1 = simplify (M_fg * M_gf_p * V)

ph_p   = [diff(phi,t);          0;          0]
th_p   = [         0; diff(theta,t);          0]
ps_p   = [         0;          0; diff(psi,t)]

Om = ...    
  M_ph * M_th * ps_p + ...
  M_ph        * th_p + ...
                ph_p 

erg_2 = cross (Om, V)

simplify (erg_1 - erg_2)