a is a first quadrant angle. sin(a)=8/17, the numbers are two sides of an 8,15,17 right triangle. cos(a)=15/17
b is a second quadrant angle. tan(b)=-7/24, the numbers are two sides of a 7,24,25 right triangle. The -7 is along the x-axis, the 24 is parallel to the y-axis. sin(b)=24/25, cos(b)=-7/25
cos(a+b)=cos(a)cos(b)-sin(a)sin(b)=(15/17)(-7/25)+(8/17)(24/25)
=87/425