4

While working a physics problem I ran into a seemingly simple trig equation I couldn't solve. I'm curious if anyone knows a way to solve the equation:

$\sin(x)+c_1 = \cos(x)+c_2$

(where $c_1$ and $c_2$ are constants) for $x$ without using Newton's method or some other form of approximation.

Nick
  • 143
  • 1
    @Yagna Patel Perhaps you should have pointed out in your edit that $c_1,c_2$ are constants, since you deleted that indication from the original. – Gregory Grant May 29 '15 at 20:09
  • 6
    A crude way is to note that $\cos x=\sin x+(c_1-c_2)$. Square both sides and replace $\cos^2 x$ by $1-\sin^2 x$. We get a quadratic in $\sin x$. Solve. The process may introduce an extraneous root. – André Nicolas May 29 '15 at 20:12

2 Answers2

10

write you equation as $$\cos (\pi/4) \cos x - \sin (\pi/4)\sin x = \frac{c_1 - c_2}{\sqrt 2} $$ now, the left hand side can be written as $$ \cos(x + \pi/4) = \frac{c_1 - c_2}{\sqrt2 } \tag 1 $$
if $|c_1 - c_2| \le \sqrt 2,$ then $(1)$ has a solution $$ x = \pm \cos^{-1}\left( \frac{c_1 - c_2}{\sqrt2 }\right) - \frac{\pi}4 + 2k\pi, \text{ where $k$ is any integer. } $$

abel
  • 29,170
  • Beat me to it - basic equations for sums and differences of trigonometric functions are easily forgotten. – Mark Bennet May 29 '15 at 20:18
  • @MarkBennet, thanks. it is still very fresh for me; just taught this last semester – abel May 29 '15 at 20:19
  • @abel Wow, seriously, thank you! I think I need to do a Trig refresher. – Nick May 29 '15 at 20:55
  • One quick add on question: if cos(x) and sin(x) had coefficients, how would that effect the equation you used: cos(A+B) = cos A cos B − sin A sin B ? – Nick May 29 '15 at 22:04
  • 1
    @Nick, if we had $a\cos x + b \sin x$ we will write is as $\sqrt{a^2+b^2}(\frac a{\sqrt{a^2 + b^2}} \cos x+ \frac b{\sqrt{a^2 + b^2}} \sin x)= \sqrt{a^2 + b^2}(\cos( x - \phi),$ where $\phi = \cos^{-1}(\frac a{\sqrt{a^2 + b^2}})$ – abel May 30 '15 at 00:18
1

$$ A\sin x + B\cos x = \sqrt{A^2+B^2}\left( \frac A {\sqrt{A^2+B^2}}\sin x+ \frac B {\sqrt{A^2+B^2}}\cos x \right) $$

Notice that the sum of the squares of the coefficients above is $1$; hence they are the coordinates of some point on the unit circle; hence there is some number $\varphi$ such that $$ \cos\varphi = \frac A {\sqrt{A^2+B^2}}\quad\text{and}\quad\sin\varphi=\frac B {\sqrt{A^2+B^2}}. $$ And notice that $\tan\varphi=\dfrac B A$, so finding $\varphi$ is computing an arctangent.

Now we have $$ A\sin x + B\cos x = \sqrt{A^2+B^2}(\cos\varphi \sin x+ \sin\varphi \cos x) = \sqrt{A^2+B^2} \sin(x+\varphi). $$

Apply this to $\sin x - \cos x$, in which $A=1$ and $B=-1$, and you get $$ \sqrt{2} \sin(x+\varphi) = c_2-c_1. $$ So you just need to find an arcsine and an arctangent. And the arctangent is easy in this case.