So, you add them together, and those terms cancel. Meanwhile, the thing we are supposed to solve for is the first term on the right hand sides, and they both have the same sign, so they don't cancel. Divide by two, switch sides, and you have the stated identity. These formulas won't work, then. If you have a sum or difference of squares in, say, a square root, things can become much simpler if you turn that stuff in the root into a perfect square.
Trigonometric substitutions do exactly that.
This also works for a number of other situations, but it works best with a half-power. The technique of partial fractions helps solve integrals of nasty rational functions, by splitting up the fraction itself. Then we'll deal with more complicated expressions, reducing them in terms of these. The basic rational functions we can always integrate are of the following two kinds. Note also that the numerator is 1 in the first case, and at most linear in the second.