If sinx+cosx=a, then find the value of ∣sinx−cosx∣
Solution:
Key idea: For any x, sin2x+cos2x=1. Squaring sinx+cosx and sinx−cosx gives the same two square terms with opposite signs on 2sinxcosx, so knowing one square tells us the other. Also, for any real number t, ∣t∣=t2.
Step 1 — Square the given equation.
We square both sides of sinx+cosx=a to bring in sin2x+cos2x.
(sinx+cosx)2=a2
sin2x+cos2x+2sinxcosx=a2
1+2sinxcosx=a2
Step 2 — Find 2sinxcosx.
We subtract 1 from both sides of the last line.
2sinxcosx=a2−1
Step 3 — Square sinx−cosx.
We expand the square and use sin2x+cos2x=1 again.
(sinx−cosx)2=sin2x+cos2x−2sinxcosx
=1−2sinxcosx
Now we put in the value from Step 2.
(sinx−cosx)2=1−(a2−1)
=2−a2
Step 4 — Take the square root.
The positive square root of a square is the absolute value, so we take the positive root.
∣sinx−cosx∣=(sinx−cosx)2
=2−a2
Step 5 — Check with a simple value.
We test x=0, where sinx=0 and cosx=1, so a=1.
∣sin0−cos0∣=1
2−12=1
The two agree, so the formula is consistent.
Watch out: The square root is real only when 2−a2≥0. This always holds, because sinx+cosx lies between −2 and 2.
Note: The book's printed answer 2+a2 is incorrect; at x=0 it would give 3 instead of 1.