Let's write the equation system first. We have two angles, let's call the, A and B, wich are complementary. This is:

Also their difference is 40º:

The system is;

Now, if we add the two equations, since we have a "B" and a "-B", they will eliminate:

The value of one of the angles is 65º. To find the other angle, we can go back to the first equation, A + B = 90º:

And solve:

The larger angle is 65º and the smaller angle is 25º