Affinity basically used the auxillary method to convert sin x - cos x into a single trigonometric function, which I think is easier than what I did.
They are actually equivalent, it's just that they differ by a constant (which can also be considered as the arbitrary constant c)
It's pretty tricky to see and prove it but the trick is to note that: (√2 - 1)(√2 + 1) = 1
So:
cosec(x - π/4) - cot(x - π/4)
= [1 - cos(x - π/4)] / sin(x - π/4)
= [1 - cos x.cos π/4 - sin x.sin π/4] / [sin x.cos π/4 - cos x.sin π/4]
= [1 - cos x/√2 - sin x/√2] / [sin x/√2 - cos x/√2]
= [√2 - cos x - sin x] / [sin x - cos x]
= [√2 - {(1 - t²)/(1 + t²)} - {2t/(1 + t²)}] / [{2t/(1 + t²)} - {(1 - t²)/(1 + t²)}]
= [√2(1 + t²) - (1 - t²) - 2t] / [2t - (1 - t²)]
= [√2(1 + t²) - 1 + t² - 2t] / [2t - 1 + t²]
= [t²(√2 + 1) - 2t + (√2 - 1)] / [t² + 2t - 1]
= [t²(√2 + 1) - 2t + (√2 - 1)] / [t² + 2t - 1]
Now using (√2 - 1)(√2 + 1) = 1
= [t²(√2 + 1) - 2t(√2 - 1)(√2 + 1) + (√2 - 1)] / [t² + 2t + 1 - 2]
= (√2 + 1)[t² - 2t(√2 - 1) + (√2 - 1) / (√2 + 1)] / [(t + 1)² - 2]
But when rationalising denominator: (√2 - 1) / (√2 + 1) = (√2 - 1)²
= (√2 + 1)[t² - 2t(√2 - 1) + (√2 - 1)²] / [(t + 1 - √2)(t + 1 + √2)]
= (√2 + 1)[t - (√2 - 1)]² / [(t + 1 - √2)(t + 1 + √2)]
= (√2 + 1)[t + 1 - √2]² / [(t + 1 - √2)(t + 1 + √2)]
= (√2 + 1)(t + 1 - √2) / (t + 1 + √2)
Hence:
cosec(x - π/4) - cot(x - π/4) = (√2 + 1)(tan x/2 + 1 - √2) / (tan x/2 + 1 + √2)
=> ln [cosec(x - π/4) - cot(x - π/4)] = ln[(√2 + 1)(tan x/2 + 1 - √2) / (tan x/2 + 1 + √2)]
=>
ln [cosec(x - π/4) - cot(x - π/4)] = ln[(tan x/2 + 1 - √2) / (tan x/2 + 1 + √2)] + ln(√2 + 1)
So from the two answers obtained:
∫ dx / (sin x - cos x) = (1/√2)ln[(tan x/2 + 1 - √2) / (tan x/2 + 1 + √2)] + c
1
and
∫ dx / (sin x - cos x) = (1/√2)ln[cosec (x - π/4) - cot(x - π/4)] + c
2
= (1/√2){ln[(tan x/2 + 1 - √2) / (tan x/2 + 1 + √2)] + ln(√2 + 1)} + c
2
= (1/√2)ln[(tan x/2 + 1 - √2) / (tan x/2 + 1 + √2)] +
(1/√2)ln(√2 + 1) + c
2
Note that (1/√2)ln(√2 + 1) is just a constant, so it can make up part of the c
2 into another arbitrary constant c
1.
= (1/√2)ln[(tan x/2 + 1 - √2) / (tan x/2 + 1 + √2)] + c
1
Therefore the two answers are equivalent to each other (hopefully you can decipher all that working lol
)