Robotics;magical expressions regarding the inverse kinematic problem

On pages 9 , 10, 12, 13 of the PDF “Notes week 6-7”. I think the problem is that intermediate mathematical steps are missing. Could you explain how to get to those expressions step by step? You can also refer to the attached book (pages 92, 94, 95, 96). But please explain to me all the intermediate steps and reasoning because I’m not good at math. Thank you