Use MatLab to convert coupled Diff Eqs to a single Diff Eq

This script requires the MatLab's symbolic toolbox

% Start by clearing everything
clear all
clc

Declare all symbolic variables

syms s m b k1 k2 Fa X Y

Solve quation for free body diagram at y

Y=solve('b*s*Y + k1*Y - b*s*X = 0',Y);

Substitute Y into free body equation at x

eq1=subs('m*s^2*X+b*s*X+k2*X-b*s*Y=Fa')
 
eq1 =
 
X*k2 + X*b*s + X*m*s^2 - (X*b^2*s^2)/(k1 + b*s) = Fa
 

Substitue for the value of Y

X=solve(eq1,X)
 
X =
 
Fa/(k2 + b*s + m*s^2 - (b^2*s^2)/(k1 + b*s))
 

Collect terms and simplify

collect(simple(X),s)
pretty(ans)
 
ans =
 
((Fa*b)*s + Fa*k1)/((b*m)*s^3 + (k1*m)*s^2 + (b*k1 + b*k2)*s + k1*k2)
 
 
                 (Fa b) s + Fa k1 
  ---------------------------------------------- 
         3           2 
  (b m) s  + (k1 m) s  + (b k1 + b k2) s + k1 k2