Need solution to a moderately complex maths problem

Thank you @pezzott1 ! Absolute Maths God! <3