Written by Colin+ in ask uncle colin.

Dear Uncle Colin,

I’m given that $0 \le x \lt 180^o$, and that $\cos(x) + \sin(x) = \frac{1}{2}$. I have to find $p$ and $q$ such that $\tan(x) = -\frac{p + \sqrt{q}}{3}$. Where do I even start?

- Some Identity Needing Evaluation

Hi, SINE, and thanks for your message! There are three approaches that spring to mind here, and I’ll let you take your pick.

Squaring both sides gives you $1 + 2\sin(x)\cos(x) = \frac{1}{4}$, so $\sin(2x) = - \frac{3}{4}$. (This means that $2x > 180$, so $x > 90$).

From that, you can work out that $\tan(2x) = \pm \frac{3}{\sqrt{7}}$ (by drawing a triangle).

You want $\tan(x)$, which I’ll call $t$: using the double-angle formula, $\pm\frac{3}{\sqrt{7}} = \frac{2t}{1-t^2}$.

That rearranges to give $\pm(3-3t^2) = 2\sqrt{7}t$, or $3t^2 \pm 2\sqrt{7}t - 3 = 0$.

Honestly, I’d throw the formula at that. $t = \frac{\pm 2\sqrt{7}t \pm \sqrt{28 + 36}}{6}$, so $t = \frac{1}{3}( \pm 4 \pm \sqrt{7})$. But which? Since $x$ is in the second quadrant, $\tan(x) < 0$, so it must be either $\frac{1}{3}(- 4 - \sqrt{7})$ or $\frac{1}{3}{-4 + \sqrt{7}}$.

You may use graphs, triangles or estimation skills (or a calculator, I guess) to show that it’s the first of those - which feels a bit unsatisfactory to me.

Another way to write $\cos(x) + \sin(x)$ is $\sqrt{2} \sin\left( x + 45^o \right)$.

If we let $\theta = x + 45^o$, then we have $\sin(\theta) = \frac{1}{2\sqrt{2}}$.

Again drawing a triangle, we get $\tan(\theta) = - \frac{1}{\sqrt{7}}$, because $\cos(\theta)$ is negative if $90^o < x < 180^o$.

Letting $t = \tan(\theta)$, we know that $\tan(x + 45^o) = \frac{1 + t}{1-t} = -\frac{1}{\sqrt{7}}$

This rearranges to $(1+t)\sqrt{7} = t-1$, so $1 + \sqrt{7} = (1-\sqrt{7})t$.

This gives $t = \frac{1+\sqrt{7}}{1-\sqrt{7}}$, which rationalises to $-\frac{8 + 2\sqrt{7}}{6}$, or $-\frac{1}{3}\left(4 + \sqrt{7}\right)$. Nice!

Dividing everything by $\cos(x)$ gives us $\tan(x) + 1 = \frac{1}{2}\sec(x)$.

We know that $\sec^2(x) = 1 + \tan^2(x)$.

Letting $t=\tan(x)$, we get $2(t + 1) = \sqrt{1 + t^2}$, or $4(t+1)^2 = 1 + t^2$.

That expands as $3t^2 + 8t + 3 = 0$.

It looks like it factorises, but actually doesn’t: $t = \frac{-8 \pm \sqrt{64 - 36}}{6}$, or $-\frac{1}{3}(4 \pm \sqrt{7})$, which is what we had first time out.

Because we squared the equation, we get an extraneous solution. How can we tell which one it is (other that by using the methods above)? We can check the original equation!

We have $t = -\frac{1}{3} (4 \pm \sqrt{7})$. We can see that as a triangle with an opposite side of $4\pm \sqrt{7}$ and an adjacent side of 3, so the square on the hypotenuse is $32 \pm 8\sqrt{7}$. (We also know that $\sin(x) > 0$ and $\cos(x) < 0$ because we’re in the second quadrant.)

Blimey. So, $\sin(x) + \cos(x)$ would be $\frac{1 \pm \sqrt{7}}{\sqrt{32 \pm 8\sqrt{7}}}$. This needs to be positive, so the positive root is the only one that works.

Phew! I think I like the middle way best, but I hope at least one of them helps you!

- Uncle Colin