(a) There is no "formula." It's called thinking.
Consider quadrilateral BCDE. The interior angles, in counter-clockwise order, are 180-y, 40, 180 - (2y+15), and 140. These add up to 360, so set up an equation and solve for y.
(b) Once you have found y, note that triangles ABE and ACD have an angle in common. You can probably use AAA similarity.