# Having trouble simultaneous trigonometric equations

I'm racking my brain trying to solve some formulae that I will need to implement into a program I'm making.

The program is based around statics of a particle, as in that all forces acting on the particle must keep it in equilibrium.

Take this example (excerpt from my program because I can't be bothered to draw a detailed diagram):

Excerpt

$P$, $Q$, $F$, and $W$ are all forces acting on the particle, and $W$ is the weight.

$P$, $Q$ and $F$ have angles of $a$, $b$, and $c$ respectively.

From the basic concept of equilibrium, all the horizontal forces must cancel each other out, and all the vertical forces must cancel each other out.

Measuring each angle from the positive $x$ axis, going anti-clockwise, where $0 \le x \le 360$, I gathered these two equations:

$$P\cos a + Q\cos b + F\cos c = 0\qquad(1)$$ $$P\sin a + Q\sin b + F\sin c = W\qquad(2)$$

In order for the system to be in equilibrium, these two simultaneous equations must be true. Now I'm in the middle of trying to implement some functionality in which the user can create a situation where an angle and a magnitude, lets say, $b$ and $P$, are unknown, and the program will calculate what they need to be in order to keep the system in equilibrium.

This is where my problem arises.

Since both equation are simultaneous, I rearranged $(1)$ for $P$ to get:

$$P = \frac{-(Q\cos b + F\cos c)}{\cos a}$$

And then subbed it into $(2)$ to get:

$$-\tan a(Q\cos b + F\cos c) + Q\sin b + F\sin c = W$$

rearranged that to get all the b's on one side, and ended up with:

$$\sin b - \cos b\tan a = \frac{W + F(\cos c\tan a - \sin c)}{Q}$$

Let $N$ = the right hand side, and $K$ = $\tan a$:

$$\sin b - K\cos b = N$$

That's as far as I got. Any attempt to simplify further has been futile. I tried to plug it into to wolframalpha but it didn't seem to work, it just showed me the interpretation of the equation and no solution.

Thanks for reading and I appreciate any help.

• In the end, are you trying to solve for $b$? Mar 21, 2016 at 11:27
• Yes. Once I find $b$, I can sub it into $(1)$ to get $P$. Mar 21, 2016 at 13:16
• @NotAPro: Using McConnell's suggestion below, then a solution $b$ to $$\sin b - K \cos b = N$$ is just $$b = \arcsin\Big(\frac{N}{\sqrt{1+K^2}} \Big)+\arctan(K)$$ Mar 26, 2016 at 7:45

## 3 Answers

Solve $(1)$ for $Q\cos b$ and $(2)$ for $Q\sin b$: \begin{align} Q \cos b &= \phantom{W} - P \cos a - F \cos c \tag{1^\prime} \\ Q \sin b &= W - P \sin a - F \sin c \tag{2^\prime} \end{align} Then $$Q^2 = Q^2 \cos^2 b + Q^2 \sin^2 b = ( P \cos a + F \cos c )^2 + ( W - P \sin a - F \sin c )^2$$ so that

$$P^2 + 2 P ( F \cos(a-c) - W \sin a ) + W^2 + F^2 - 2 W F \sin c - Q^2 = 0 \tag{3}$$

Solve quadratic $(3)$ to get possible values of $P$. (Note that, since $P$ is a magnitude, any negative solution would be extraneous.)

To get $b$, divide $(2^\prime)$ by $(1^\prime)$ (assuming $Q\neq 0$):

$$\tan b = \frac{P \sin a + F \sin c- W}{P \cos a + F\cos c} \tag{4}$$

and substitute-in the value(s) of $P$ from $(3)$. If you're programming this, you would probably want to invoke "atan2" to get the value of $b$ in the appropriate quadrant.

I would recommend using the following identity:

$$A \sin x - B \cos x = R \sin (x - \alpha)$$

where $R = \sqrt{A^2 + B^2}$ and $\alpha = \arctan(\frac{B}{A})$.

$$\sin(b)-K\cos(b)=N$$

Sum formula for cosine ($\cos(b+\beta)=\sin(b)\sin(\beta)-\cos(b)\cos(\beta)$)

If we divide the formula by $\sin(\beta)$, we get:

$$\frac{\cos(b+\beta)}{\sin(\beta)}=\sin(b)-\cot(\beta)\cos(b)$$

By equating parts, we see $K=\cot(\beta)\implies\beta=\cot^{-1}(K)$.

This gives us

$$\sin(b)-K\cos(b)=\frac{\cos(b+\cot^{-1}(K))}{\sin(\cot^{-1}(K))}=N$$

$$\cos(b+\cot^{-1}(K))=N\sin(\cot^{-1}(K))$$

$$b+\cot^{-1}(K)=\arccos(N\sin(\cot^{-1}(K)))$$

$$b=\arccos(N\sin(\cot^{-1}(K)))-\cot^{-1}(K)$$

• Why the down-votes? Apr 7, 2016 at 20:35