# Solve system of equations involving cos and sin

I have come up with the following system, I want to solve it for $a$ and $c$:

$a \sin (x_0) - c \sin(x_0 - L) = 0\\ c \cos(x_0 - L) - a \cos(x_0) = 1$

In this system $x_0$ and $L$ are arbitrary.

p.s. why can't $L$ be $n\pi$?

-
so you want to solve it for a and c am I right? –  iostream007 May 29 '13 at 10:23
Yes, sorry forgot to mention it –  user54297 May 29 '13 at 10:25

I assume you are solving for $a$ and $c$. Then the solution may be written in matrix form as

\begin{align}\left ( \begin{array}\\a\\c\end{array}\right) &= \frac{1}{\sin{x_0} \cos{(x_0-L)} - \cos{x_0} \sin{(x_0-L)}} \left ( \begin{array}\\\cos{(x_0-L)} & \sin{(x_0-L)}\\\cos{x_0} & \sin{x_0}\end{array}\right)\left ( \begin{array}\\0\\1\end{array}\right) \\ &= \frac{1}{\sin{L}}\left ( \begin{array}\\\sin{(x_0-L)}\\\sin{x_0}\end{array}\right)\end{align}

Note that I used the sine addition formula to simplify the denominator term. This explains why $L \ne n \pi$: the denominator would be zero.

Then

$$a = \frac{\sin{(x_0-L)}}{\sin{L}}$$

$$c = \frac{\sin{x_0}}{\sin{L}}$$

-

$a \sin (x_0) - c \sin(x_0 - L) = 0\\ c \cos(x_0 - L) - a \cos(x_0) = 1$

from eqn (1)

$$a \sin (x_0) =c \sin(x_0 - L)\implies a=\dfrac {c \sin(x_0 - L)}{\sin (x_0)}$$

in eqn (2)

$$c \cos(x_0 - L) - \cos(x_0)\cdot\dfrac{c \sin(x_0 - L)}{\sin (x_0)} = 1$$ $$c[\cos(x_0 - L)\cdot\sin (x_0)-\sin(x_0 - L)\cdot\cos(x_0)]=\sin {(x_0)}$$ $$c[\sin (x_0-(x_0 - L))]=\sin {(x_0)}$$ $$c=\dfrac{\sin {(x_0)}}{\sin (L)}$$

Now $$a=\dfrac {c \sin(x_0 - L)}{\sin (x_0)}$$ $$a=\dfrac {\dfrac{\sin {(x_0)}}{\sin (L)}\cdot\sin(x_0 - L)}{\sin (x_0)}$$ $$a=\dfrac{\sin(x_0-L)}{\sin L}$$

-

Writing $P:= \sin x_0$, $Q := \sin(x_0-L)$, $R := \cos x_0$, $S := \cos(x_0-L)$, we solve this far-less-intimidating system ... \begin{align} \phantom{-}a P - c Q &= 0 \\ - a R + c S &= 1 \end{align} ... to get ... $$a = \frac{Q}{PS-QR} \qquad c = \frac{P}{PS-QR}$$

Then, we invoke trig's angle-difference formula to simplify: \begin{align} PS-QR &= \sin x_0 \cos(x_0-L)-\sin(x_0-L)\cos x_0 \\[4pt] &= \sin\left(x_0-(x_0-L)\right) \\[4pt] &= \sin L \end{align} so that $$a = \frac{\sin(x_0-L)}{\sin L} \qquad c = \frac{\sin x_0}{\sin L}$$ where $\sin L \neq 0$ (whence $L \neq n \pi$ for any $n$).

-