# How to solve $\sin x +\cos x = 1$?

No matter how I do it, I always end up with $x = 0, 90, 270$ and $360$. All of those except $270$ is right, but I can't quite figure out how to get the $270$ degrees out of the answer. I've tried using trig identities, I've tried squaring both sides, but I always end up with $$2\sin x\cos x$$ which then leads me to $x = 0, 90, 270, 360$. But $$\sin (270) + \cos (270) = -1$$ so I'm doing something wrong.

• flooding with answers !!!!!! Dec 25, 2013 at 18:50
• There are multiple approaches to solving a linear equation in sine and cosine, so that isn't too surprising... Dec 25, 2013 at 19:05
• You have squared, so you get additional solutions. Just throw away those that do not satisfy the original equation. Dec 25, 2013 at 19:24
• You're not doing anything “wrong”. It's simply that $A^2=B^2$ means $|A|=|B|\iff A=\pm B$. Obviously, $|-1|=|1|$. All that's left to do now is to trim those “extra” solutions, that's all. :-) Dec 25, 2013 at 21:01

The steps you followed are perfectly correct! The only thing you have to do that you haven't done already is check for extraneous solutions. Whenever we square both sides, there is the chance that we get more solutions than we're looking for.

So, you have correctly deduced that the list $0,90,270,360$ (all angles in degrees) contains all potential solutions. After checking, you've noticed that $270$ is not a solution, but the rest are. So, the solutions are $0,90,$ and $360$.

As for why we get extra solutions: notice that although $270$ does not satisfy the original equation, we have $$(\sin(270)+\cos(270))^2=(-1)^2=1$$ Which makes sense, since we just solved the equation $$(\sin(x) + \cos(x))^2 = 1$$

• This is the one answer that fits the original question. Dec 25, 2013 at 19:28
• Okay, I see. But is it mathematically good form to do it this way? Since I'm doing this for an assignment, I'd imagine they want some sort of answer where I arrive at 0, 90 and 360 without needing to check each solution to find a wrong one. Or is it alright to do it by squaring like this and then weeding out erronoeus solutions once I've solved for x? Dec 25, 2013 at 20:21
• It is indeed fine mathematical form to do it this way. Yes, you could take an alternate approach not involving extraneous roots (see Fly By Night's answer or RecklessReckoner's), but that doesn't make your method any less valid. I would be very surprised to see a teacher/professor take points off for doing things in the way you've done them. Dec 25, 2013 at 20:44
• You might, however, lose points for mentioning $0$ and $360$ as separate solutions, since most contexts call for one or the other. Usually, the question will say something like "find all solutions $x$ (in degrees) to the equation that satisfy $0 \leq x < 360$". Dec 25, 2013 at 20:49
• Ah, they include both 0 and 360 in their own example exercises, so I don't think that will be a problem. Thanks! Dec 25, 2013 at 21:16

Hint:

Use the formula $\sin(A+B) \equiv \sin A \cos B + \sin B \cos A$ to write $\sin x + \cos x$ in the form $R\sin(x+\alpha)$, where $R$ and $\alpha$ are numbers that you need to find.

Once you have your $R$ and $\alpha$, simply solve $R\sin(x+\alpha)=1$.

Another way to look at this is to consider the equation as representing the intersection of two "curves" in polar coordinates, one being $\ r = 1 \$ (the unit circle), the other being the line $\ \sin \theta \ + \ \cos \theta \ = \ 1 \ \ \Rightarrow \ \ r \sin \theta \ + \ r \cos \theta \ = \ r \ \ \Rightarrow \ \ r \ = \ x + y \ ,$ with $\ r \$ set equal to 1 . The line has intercepts at ( 1 , 0 ) and ( 0 , 1 ) , meeting the circle at $\ \theta = 0º \ \ \text{and} \ \ \theta = 90º$ . (360º is considered to be merely another "angle-name" for 0º , so it is not really a distinct solution.)

• "The line" meaning the line whose equation is $x + y = 1$. This is a beautiful answer. Dec 25, 2013 at 19:04
• Neat solution! I wonder if, were a student to write this solution for this problem in a precalculus class, it could be taken for granted that there are exactly two intersections, or what justification might be necessary. Dec 25, 2013 at 20:55
• Depending on what topics were covered in their course, the student might solve the system of nonlinear equations, $\ x + y = 1 \$ and $\ x^2 \ + \ y^2 \ = \ 1 \$ ; or solve the improper inequality $\ \sqrt{1 - x^2} \ \ge \ 1 - x \$ to show that the equality only holds at $\ x = 0 , 1 \$ and the inequality on $\ ( 0 , 1 ) \$ , so the curves only make contact at the axis intercepts (and the circle lies "above" the line in between them). Dec 25, 2013 at 21:22

Use $$a\sin x + b\cos x = \sqrt{a^2+b^2}\cos(x- \tan^{-1}(\frac ba))$$

$$\sqrt2\cos(x-\frac\pi4) = 1$$

$$\cos(x-\frac\pi4) = \frac1{\sqrt2}$$

$$x - \frac\pi4 = 2n\pi \pm \frac\pi4$$

Solving this gives 0,90,360 as solution.

• This answer would be better if it replaced the unmemorable formula with a method to derive it (as in Fly By Night's answer). Precalculus students already learn too well that math is just about using the right formula. Dec 25, 2013 at 19:03
• Moreover, the formula isn't even really true. It needs to use "atan2" or similar. For instance, replace a and b with their negatives; the LHS changes, but the RHS does not. Jun 5, 2016 at 5:34

Hint. Square both sides to get $$(\sin x+\cos x)^2=1+2\sin x\cos x=1+\sin 2x=1^2=1\implies\sin 2x=0.$$ The important thing here is to notice $2\sin x\cos x=\sin 2x$. Notice I wrote an implication, not an equivalence, so we can get some extraneous solutions at the end. A routine check can spot all of them.

• Squaring both sides may introduce invalid solutions. For example, if you have $x=1$ and your square both sides you get $x^2=1$, which adds the invalid solution $x=-1$. Dec 25, 2013 at 18:23
• @FlybyNight this is an important remark. However, we should always test the solutions, so we are safe. Dec 25, 2013 at 18:26
• I am not keen on this approach. User2369284s solution provides the systematic way of answer this. Avoid squaring whenever possible. Dec 25, 2013 at 21:03
• @Lost1 I don't understand your reluctance. After all, factoring $a\sin x+b\cos x$ gives the same extraneous solutions. Dec 25, 2013 at 21:12
• I dont think it does, pal Dec 25, 2013 at 21:58

Avoid squaring wherever practicable as it immediately introduces extraneous roots

Using Weierstrass substitution we have $$\frac{2t}{1+t^2}+\frac{1-t^2}{1+t^2}=1$$ where $t=\tan\frac x2$

$$\implies 2t+1-t^2=1+t^2\iff t^2-t=0\iff t=1,0$$

If $\displaystyle\tan\frac x2=0\iff \frac x2=n180^\circ\iff x=n360^\circ$ where $n$ is any integer

If $\displaystyle\tan\frac x2=1\iff \frac x2=m180^\circ+45^\circ\iff x=m360^\circ+90^\circ$ where $m$ is any integer

• @user107827, Try this method when $$\sin x+\cos x=-1$$ Dec 26, 2013 at 13:46

Using Double-Angle Formulas,

$$\sin x+\cos x=1\implies 2\sin\frac x2\cos\frac x2=1-\cos x=2\sin^2\frac x2$$

$$\implies \sin\frac x2\left(\cos\frac x2-\sin\frac x2\right)=0$$

$$(i)\sin\frac x2=0\implies \frac x2=n\pi\text{ where }n \text{ is any integer}$$

$$(ii) \cos\frac x2-\sin\frac x2=0\implies\cos\frac x2=\sin\frac x2\iff \tan\frac x2=1$$ Find the rest in my other answer

$\sin x + \cos x = 1 \rightarrow (\sin x + \cos x )^2=1^2 \iff \color{green}{\underbrace{(\sin^2 x + \cos^2 x)}_{=1}}+2\sin x \cos x =\color{green}{1} \iff \sin x \cos x = 0$

Now look at the unit circle to see when this is true. After you have found the values of $x$ for which this holds, be sure to check the outcome of $\sin x + \cos x$ for each of these values, to eliminate the outcomes that generate value $-1$ (these values of $x$ came in because of the squaring - but are not truly solutions).

• @DanielFischer My bad. Good point. Dec 25, 2013 at 18:27
• Note that squaring may add ghost solutions. You need to mention this. If we start with $x=1$ then there is one solution: $x=1$. Squaring both sides gives $x^2=1$, which has two solutions: $x=\pm 1$. One solution, $x=1$, is a correct solution of the original problem while the other, $x=-1$, is a ghost solution introduced by squaring. Dec 25, 2013 at 19:17
• @FlybyNight You're right. Therefore, it would be good indeed to check the answer. Dec 25, 2013 at 19:22
• The equation $\cos x \sin x =0$ has $x=180^{\circ}$ and $x=270^{\circ}$ as solutions. However $\sin(180^{\circ})+\cos(180^{\circ})=-1$ and $\sin(270^{\circ})+\cos(270^{\circ})=-1$. The OP asked for solutions to $\sin x + \cos x =1$. Dec 25, 2013 at 19:46
• @FlybyNight No, those are not the only ones. $x=90^{\circ}$ and $x=0^{\circ}$ are also solutions , which both result in $\sin x + \cos x =1$. Dec 25, 2013 at 20:10