syms l1 l2 l3 t1 t2 t3

m=[-sin(t1)*(cos(t2)*l3+l2*sin(t2)) cos(t1)*(-l3*sin(t2)+l2*cos(t2));...
    cos(t1)*(cos(t2)*l3+l2*sin(t2)) sin(t1)*(-l3*sin(t2)+l2*cos(t2))]

inv_m=inv(m)

simplify(inv_m)